* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2a44;
}

.page {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 20px;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hero-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero p {
  color: #6b7280;
}

.user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  gap: 4px;
}

.user-center-label {
  font-size: 13px;
  color: #6b7280;
  margin-right: 2px;
}

.user-nickname {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.user-credits {
  font-size: 13px;
  color: #3867f5;
  font-weight: 600;
  background: #f1f5ff;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 6px;
}

.user-coins {
  font-size: 13px;
  color: #b45309;
  font-weight: 600;
  background: #fef3c7;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 6px;
}

.invite-code-label {
  font-size: 13px;
  color: #6b7280;
  margin-right: 2px;
}

.invite-code-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-size: 13px;
  color: #374151;
}
.user-invite-code {
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* 积分流水列表 */
.credit-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.credit-log-item:last-child {
  border-bottom: none;
}
.credit-log-reason {
  font-size: 14px;
  color: #374151;
}
.credit-log-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}
.credit-log-change {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 12px;
}
.credit-log-change.positive {
  color: #0f9d58;
}
.credit-log-change.negative {
  color: #dc2626;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.platforms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.platforms-row .link-btn {
  margin-top: 0;
  flex-shrink: 0;
}

.platforms-row .platforms {
  flex: 1;
  min-width: 0;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.platform {
  border: 1px dashed #c5cad4;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f3f5;
  cursor: pointer;
  color: #6b7280;
}

.platform-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.platform-icon-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-icon {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.platform-name {
  font-weight: 600;
}

.platform:hover {
  background: #e8ecf2;
  border-color: #b0b8c4;
}

.platform.active {
  border-style: solid;
  border-color: #3867f5;
  box-shadow: 0 0 0 2px rgba(56, 103, 245, 0.15);
  background: #f1f5ff;
  color: #1f2a44;
}


.platform .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #3867f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #3867f5;
  font-size: 12px;
  opacity: 0;
}

.platform.active .check {
  opacity: 1;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="text"] {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d5dcec;
  font-size: 14px;
}

.hint {
  color: #8a93a5;
  font-size: 13px;
}

.link-btn {
  margin-top: 10px;
  background: transparent;
  border: none;
  color: #3867f5;
  cursor: pointer;
}

.tag-input {
  border: 1px solid #d5dcec;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #eef3ff;
  color: #3867f5;
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.tag button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #3867f5;
}

.primary {
  background: #3867f5;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, opacity 0.2s;
}

.primary.btn-disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.actions {
  text-align: center;
}

.actions-buttons {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.detection-with-hint {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detection-with-hint .primary {
  width: 100%;
}

.check-cost-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

.actions-buttons .btn-example {
  flex-shrink: 0;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #c41e3a;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin-right: 4px;
  font-weight: 500;
}

.ghost {
  background: #f1f5ff;
  border: 1px solid #d0ddff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #3867f5;
}

.ghost.report-btn {
  background: linear-gradient(135deg, #3867f5, #60a5fa);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: all 0.2s;
}

.ghost.report-btn:hover {
  background: linear-gradient(135deg, #2851d8, #3b82f6);
  box-shadow: 0 4px 12px rgba(56,103,245,0.3);
}

.ghost.report-btn.report-btn-disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: 0.5;
}

.ghost.report-btn.report-btn-disabled:hover {
  background: #94a3b8;
  box-shadow: none;
}

/* 示例按钮：更显眼，便于新用户发现 */
.btn-example {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff !important;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}
.btn-example:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}
.btn-example::before {
  content: "✨ ";
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: #f8faff;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.stat span {
  font-size: 22px;
  font-weight: 700;
  color: #3867f5;
  display: block;
  margin-bottom: 4px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d5dcec;
}

.table {
  border: 1px solid #e5e9f2;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: 120px 1.5fr 1fr 100px 70px 70px 70px 70px 90px;
  gap: 6px;
  padding: 12px 16px;
  align-items: center;
  min-width: 880px;
}

/* 平台列：图标 + 名称 */
.col-platform {
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-platform-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-platform-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* 问题和关键词：尽量一行显示，超出省略 */
.col-single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.table-header .col-single-line {
  white-space: nowrap;
}

.table-header {
  background: #f7f9fc;
  font-weight: 600;
  color: #6b7280;
}

.table-row {
  border-top: 1px solid #e5e9f2;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.success {
  background: #e8fff1;
  color: #0f9d58;
}

.badge.fail {
  background: #fdecec;
  color: #f44336;
}

.badge.pending {
  background: #f3f4f6;
  color: #9ca3af;
}

/* 检测状态进度条 */
.status-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 80px;
}

.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #3867f5;
  width: 0%;
}

.progress-bar-fill.progress-active {
  width: 100%;
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #e5e7eb 30%,
    #3867f5 50%,
    #e5e7eb 70%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: progress-sweep 1.5s ease-in-out infinite;
}

@keyframes progress-sweep {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-label {
  font-size: 12px;
  color: #3867f5;
  font-weight: 500;
  text-align: center;
}

.link {
  color: #3867f5;
  cursor: pointer;
  border: none;
  background: transparent;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  width: min(900px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e9f2;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e9f2;
  background: #f8faff;
}

.modal-stat {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.modal-stat span {
  font-size: 20px;
  font-weight: 700;
  color: #3867f5;
  display: block;
  margin-bottom: 4px;
}

.icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.modal-tabs {
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  background: #f7f9fc;
}

.tab {
  border: none;
  background: transparent;
  padding: 6px 10px;
  cursor: pointer;
  color: #6b7280;
}

.tab.active {
  color: #3867f5;
  border-bottom: 2px solid #3867f5;
}

.modal-content {
  padding: 16px 20px;
  overflow: auto;
}

.tab-panel {
  display: none;
  line-height: 1.8;
  color: #374151;
}

.tab-panel.active {
  display: block;
}

/* AI对话问答样式 */
.answer-content {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.8;
  color: #1f2937;
}

.answer-content p {
  margin: 0 0 12px 0;
  line-height: 1.8;
  color: #1f2937;
}

.answer-content p:last-child {
  margin-bottom: 0;
}

/* 问题标题 */
.answer-question {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

/* 思考过程（可折叠） */
.answer-thinking {
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.answer-thinking summary {
  padding: 8px 14px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.answer-thinking summary:hover {
  background: #dcfce7;
}

.answer-thinking .thinking-content {
  padding: 12px 14px;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  color: #6b7280;
}

.answer-thinking .thinking-content p {
  margin: 0 0 8px 0;
  line-height: 1.6;
  color: #6b7280;
}

/* 表格 */
.answer-table-wrap {
  margin: 12px 0;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.answer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.answer-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #374151;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.answer-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #4b5563;
  vertical-align: top;
}

.answer-table tbody tr:hover {
  background: #f8fafc;
}

.answer-table tbody tr:last-child td {
  border-bottom: none;
}

/* 列表 */
.answer-list {
  margin: 8px 0 12px 0;
  padding-left: 20px;
}

.answer-list li {
  margin-bottom: 6px;
  line-height: 1.7;
  color: #374151;
}

/* 小标题 */
.answer-heading {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
}

/* 引用来源样式 - 简洁列表 */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.source-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.source-number {
  font-weight: 600;
  color: #6b7280;
  font-size: 14px;
  min-width: 30px;
}

.source-domain {
  font-size: 14px;
  color: #3867f5;
  font-weight: 500;
}

.source-title {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.6;
  margin: 4px 0;
}

.source-url {
  color: #3867f5;
  text-decoration: none;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.5;
}

.source-url:hover {
  text-decoration: underline;
}

.source-tag {
  display: inline-block;
  font-size: 12px;
  color: #f97316;
  background: #fff7ed;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f1f5ff;
  color: #3867f5;
  font-size: 12px;
  margin-left: 6px;
}

/* ===== 账号管理样式 ===== */
.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.account-header h2 {
  margin-bottom: 0;
}

.account-toggle {
  font-size: 13px;
  padding: 4px 12px;
}

.account-panel.hidden {
  display: none;
}

.account-panel {
  margin-top: 14px;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-platform {
  background: #f8faff;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e5e9f2;
}

.account-platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-platform-name {
  font-weight: 600;
  font-size: 15px;
  color: #1f2a44;
}

.account-add-btn {
  background: #3867f5;
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.account-add-btn:hover {
  background: #2851d8;
}

.account-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e9f2;
}

.account-item-name {
  font-weight: 500;
  font-size: 14px;
  flex: 1;
}

.account-item-node {
  font-size: 12px;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f3f4f6;
}

.account-item-env {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f4ff;
  color: #4f46e5;
}

.account-env-select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d5dcec;
  background: #fff;
  color: #374151;
  cursor: pointer;
  min-width: 4.5em;
}
.account-env-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.account-item-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
}

.account-item-status.idle {
  background: #e8fff1;
  color: #0f9d58;
}

.account-item-status.busy {
  background: #fff7ed;
  color: #f97316;
}

.account-login-status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 4em;
  text-align: center;
  color: #6b7280;
}

.account-login-status.ok {
  background: #e8fff1;
  color: #0f9d58;
}

.account-login-status.expired {
  background: #fef2f2;
  color: #dc2626;
}

.account-item-actions {
  display: flex;
  gap: 6px;
}

.account-item-actions button {
  border: 1px solid #d5dcec;
  background: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
  transition: all 0.15s;
}

.account-item-actions button:hover {
  background: #f1f5ff;
  border-color: #3867f5;
  color: #3867f5;
}

.account-item-actions button.danger:hover {
  background: #fef2f2;
  border-color: #f44336;
  color: #f44336;
}

.account-empty {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

/* 历史列表弹窗 */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}
.history-item:hover {
  background: #f8faff;
}
.history-item:last-child {
  border-bottom: none;
}
.history-item-info {
  flex: 1;
  min-width: 0;
}
.history-item-question {
  font-size: 14px;
  font-weight: 500;
  color: #1f2a44;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 3px;
}
.history-item-arrow {
  color: #c5cad6;
  font-size: 18px;
  margin-left: 12px;
  flex-shrink: 0;
}
.history-empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 20px;
  font-size: 14px;
}

@media (max-width: 980px) {
  .table-header,
  .table-row {
    grid-template-columns: 110px 1.2fr 1fr 90px 60px 60px 60px 60px 80px;
    font-size: 12px;
  }
}

/* 手机端适配：避免页面显示不全 */
@media (max-width: 768px) {
  html {
    overflow-x: hidden;
  }
  body {
    overflow-x: hidden;
  }
  .page {
    margin: 16px auto 40px;
    padding: 0 12px;
    max-width: 100%;
  }
  .hero h1 {
    font-size: 24px;
  }
  .user-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 0 4px;
  }
  .user-bar .ghost,
  .user-bar .user-nickname,
  .user-bar .user-credits,
  .user-bar .user-coins,
  .user-bar .invite-code-wrap {
    margin-left: 0;
  }
  .result-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .result-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .filters {
    flex-wrap: wrap;
    gap: 8px;
  }
  .card {
    padding: 16px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-card {
    width: min(100%, calc(100vw - 24px));
    max-height: 85vh;
  }
  .modal {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 20px;
  }
  .platforms {
    grid-template-columns: 1fr;
  }
  .stat span {
    font-size: 18px;
  }
}

/* 优化建议 & 代理分销二维码 */
.qr-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-item img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.qr-item span {
  font-size: 14px;
  color: #6b7280;
}

/* 我的留言 */
.feedback-list {
  max-height: 400px;
  overflow-y: auto;
}
