/* vquota.com 客户前台统一样式：白底、深色表头、红色价格 */
:root {
  --bg-page: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --border-strong: #d1d5db;

  /* 既有价格页核心视觉规范 */
  --table-head-bg: #1f2937;
  --table-head-text: #ffffff;
  --price-red: #dc2626;
  --price-red-dark: #b91c1c;
  --price-red-bg: #fef2f2;

  /* 语义色 */
  --primary: #1f2937;
  --primary-hover: #111827;
  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;
  --warn-amber: #b45309;
  --warn-amber-bg: #fffbeb;
  --warn-amber-border: #f59e0b;
  --success-green: #15803d;
  --success-green-bg: #f0fdf4;
  --danger-border: #fca5a5;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 顶部导航栏 */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background-color: var(--table-head-bg);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 1px solid var(--border-strong);
  padding-left: 10px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  background-color: var(--bg-page);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--table-head-bg);
  color: #ffffff;
}

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

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #9ca3af;
}

.health-dot.ok {
  background-color: #16a34a;
}

.health-dot.err {
  background-color: var(--price-red);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

/* 主容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-desc {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* 卡片 */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

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

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.btn-danger {
  background-color: var(--price-red);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--price-red-dark);
}

.btn-outline {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: #9ca3af;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 13px;
}

/* 红色价格与关键数字 */
.price-text {
  color: var(--price-red);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-lg {
  font-size: 28px;
  line-height: 1.2;
}

.price-md {
  font-size: 16px;
}

/* 表格：白底、深色表头、红色价格 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  font-size: 14px;
}

table.data-table thead th {
  background-color: var(--table-head-bg);
  color: var(--table-head-text);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 1px solid #111827;
}

table.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}

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

table.data-table tbody tr:hover {
  background-color: #f9fafb;
}

/* 标签与状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-line {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.badge-pending {
  background-color: var(--warn-amber-bg);
  color: var(--warn-amber);
  border: 1px solid #fcd34d;
}

.badge-running {
  background-color: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid #bfdbfe;
}

.badge-done {
  background-color: var(--success-green-bg);
  color: var(--success-green);
  border: 1px solid #bbf7d0;
}

.badge-failed {
  background-color: var(--price-red-bg);
  color: var(--price-red);
  border: 1px solid var(--danger-border);
}

/* 提示框 */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  font-size: 13.5px;
}

.alert-danger {
  background-color: var(--price-red-bg);
  border-color: var(--danger-border);
  color: #991b1b;
}

.alert-warning {
  background-color: var(--warn-amber-bg);
  border-color: var(--warn-amber-border);
  color: #92400e;
}

.alert-info {
  background-color: var(--accent-blue-bg);
  border-color: #bfdbfe;
  color: #1e40af;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 统计概览网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 13.5px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background-color: #ffffff;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--table-head-bg);
  box-shadow: 0 0 0 2px rgba(31, 41, 55, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 96px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-row .form-control {
  flex: 1;
}

/* 选项卡 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
}

.tab-btn {
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--price-red);
}

.sub-tabs {
  display: inline-flex;
  background: var(--bg-page);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.sub-tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.sub-tab-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* 登录页居中容器 */
.auth-wrapper {
  max-width: 440px;
  margin: 36px auto 0;
}

/* 上传区域 */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.upload-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg-subtle);
}

.upload-box.disabled {
  opacity: 0.55;
  background: #f3f4f6;
}

.upload-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13.5px;
}

.limit-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12.5px;
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.file-remove {
  background: none;
  border: none;
  color: var(--price-red);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}

/* 批量队列 */
.queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  margin-bottom: 10px;
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.queue-prompt {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-primary);
  word-break: break-word;
}

/* 充值步骤 */
.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.step-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--bg-subtle);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--table-head-bg);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.wechat-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 2px solid var(--table-head-bg);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
}

.wechat-id {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 空状态 / 错误态 */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  background: var(--table-head-bg);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--table-head-bg);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  animation: fadeIn 0.2s ease;
}

.toast.error {
  background: var(--price-red);
}

.toast.success {
  background: var(--success-green);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
  padding: 18px 20px;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .brand-sub {
    display: none;
  }
  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* 追加第二轮样式：教程页（tutorials.html）与示例展示区（showcase.html） */

/* 教程页布局 */
.tutorial-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tutorial-toc {
  position: sticky;
  top: 76px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tutorial-toc-head {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 14px;
}

.tutorial-toc-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-toc-link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.tutorial-toc-link:hover,
.tutorial-toc-link.active {
  background: var(--bg-page);
  color: var(--text-primary);
  font-weight: 600;
}

.tutorial-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  scroll-margin-top: 76px;
}

.tutorial-article-head {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tutorial-article-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.tutorial-article-tag {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 2px 10px;
  border-radius: 999px;
}

.tutorial-article-body {
  padding: 20px;
}

.tutorial-article-body h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--text-primary);
  border-left: 3px solid var(--price-red);
  padding-left: 10px;
}

.tutorial-article-body h3:first-child {
  margin-top: 0;
}

.tutorial-article-body p {
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.tutorial-article-body ol,
.tutorial-article-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--text-secondary);
}

.tutorial-article-body li {
  margin-bottom: 6px;
}

.tutorial-cta {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--price-red-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #991b1b;
  font-weight: 600;
  font-size: 13.5px;
}

/* 示例展示区（showcase.html / 复用模块） */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.showcase-card-head {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.showcase-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.showcase-video-wrap {
  position: relative;
  background: #111827;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

.showcase-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 13px;
  gap: 6px;
}

.showcase-video-placeholder code {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #ffffff;
}

.showcase-meta {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.showcase-tier-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

body.embed-mode {
  background: transparent;
}

body.embed-mode .site-header,
body.embed-mode .site-footer {
  display: none;
}

body.embed-mode .container {
  padding: 0;
  max-width: 100%;
}

@media (max-width: 860px) {
  .tutorial-layout {
    grid-template-columns: 1fr;
  }
  .tutorial-toc {
    position: static;
  }
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

/* 第五轮追加样式：首页服务全景 5 环节链路 */
.service-chain {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.chain-node {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chain-node-muted {
  background: var(--bg-subtle);
}

.chain-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chain-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--table-head-bg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.chain-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.chain-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.chain-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  user-select: none;
}

.chain-pending-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 960px) {
  .service-chain {
    flex-direction: column;
  }
  .chain-arrow {
    transform: rotate(90deg);
    height: 18px;
  }
}
