/* ========== 设计变量（改主题色在这里） ========== */
:root {
  --bg: #0f0f12;
  --bg-card: #1a1a21;
  --bg-input: #121218;
  --text: #f4f4f6;
  --text-muted: #9b9ba8;
  --accent: #e1306c;
  --accent-hover: #c13584;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #2a2a35;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 渐变背景装饰 */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(225, 48, 108, 0.18), transparent),
    var(--bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ========== 页头 ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.brand-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-link:hover {
  color: var(--text);
}

/* ========== 主内容 ========== */
.main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}

/* ========== 数据宣传条 ========== */
.stats-banner {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 200, 80, 0.35);
  background: linear-gradient(
    135deg,
    rgba(225, 48, 108, 0.22) 0%,
    rgba(129, 52, 175, 0.18) 50%,
    rgba(20, 20, 28, 0.95) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 215, 100, 0.08) inset,
    0 12px 40px rgba(225, 48, 108, 0.15);
  animation: stats-glow 3s ease-in-out infinite alternate;
}

@keyframes stats-glow {
  from {
    box-shadow:
      0 0 0 1px rgba(255, 215, 100, 0.08) inset,
      0 12px 40px rgba(225, 48, 108, 0.12);
  }
  to {
    box-shadow:
      0 0 0 1px rgba(255, 215, 100, 0.15) inset,
      0 12px 48px rgba(225, 48, 108, 0.22);
  }
}

.stats-banner__badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(90deg, #fcd34d, #f59e0b);
  border-radius: 999px;
}

.stats-banner__line {
  margin: 0.15rem 0;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.stats-banner__line strong {
  font-weight: 800;
  color: #fcd34d;
  font-size: 1.12em;
}

.stats-banner__line--highlight {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 700;
  background: linear-gradient(90deg, #fff 0%, #fcd34d 45%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-banner__line--highlight strong {
  -webkit-text-fill-color: #fde047;
  background: none;
}

.hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-sub {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* ========== 表单 ========== */
.form {
  margin-bottom: 0.75rem;
}

.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.form-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.form-actions .btn-primary {
  flex: 1;
  min-width: 0;
}

.btn-clear {
  background: linear-gradient(135deg, #4f5fd4 0%, #5b7fd6 100%);
  color: #eef2ff;
  border: 1px solid rgba(165, 180, 252, 0.55);
  min-width: 5.25rem;
  padding: 0.9rem 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(79, 95, 212, 0.35);
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
}

.btn-clear-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 700;
}

.btn-clear:hover:not(:disabled) {
  background: linear-gradient(135deg, #5c6ce0 0%, #6b8fe8 100%);
  border-color: #c7d2fe;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(91, 127, 214, 0.45);
}

.btn-clear:hover:not(:disabled) .btn-clear-icon {
  background: rgba(255, 255, 255, 0.32);
}

.btn-clear:active:not(:disabled) {
  transform: translateY(0);
  background: linear-gradient(135deg, #4553b8 0%, #4d6bb8 100%);
  box-shadow: inset 0 2px 5px rgba(49, 58, 140, 0.5);
}

.input {
  flex: 1;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}

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

.btn-primary {
  background: linear-gradient(135deg, #f58529, #dd2a7b);
  color: #fff;
  min-width: 140px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

.btn-loading {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.input-hint strong {
  color: var(--accent);
  font-weight: 600;
}

.quota {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.quota-urgent {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(221, 42, 123, 0.45);
  background: rgba(221, 42, 123, 0.08);
}

.quota-urgent-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.quota-urgent-desc {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-recharge-promo {
  margin-top: 1rem;
}

.recharge-promo-inner {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  text-align: center;
}

.recharge-promo-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.recharge-promo-desc {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-gift-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 133, 41, 0.45);
  background: rgba(245, 133, 41, 0.1);
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-gift-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #f58529, #dd2a7b);
}

.auth-gift-hint {
  margin: 0 0 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--accent);
  background: rgba(221, 42, 123, 0.08);
  border: 1px dashed rgba(221, 42, 123, 0.35);
}

/* ========== 进度条 ========== */
.progress-wrap {
  margin-top: 1.25rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f58529, #dd2a7b);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

/* ========== 结果 ========== */
.result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.result-preview {
  display: block;
}

.result-thumb {
  display: none !important;
}

.result-title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

.result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.download-action-btn {
  margin: 0;
}

.result-gallery-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.result-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-width: 100%;
}

.result-media-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.result-media-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated, #1a1a22);
}

.result-media-thumb img {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  object-fit: cover;
  display: block;
}

.result-media-index {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.result-media-download {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 64px);
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert.info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* ========== 步骤 ========== */
.steps-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.steps-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.steps-list li {
  margin-bottom: 0.35rem;
}

/* ========== 会员套餐 ========== */
.membership h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.plans {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.plan-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.plan-card button {
  margin-top: 0.75rem;
  width: 100%;
}

.recharge-maintenance {
  margin-bottom: 0.75rem;
  text-align: center;
  font-weight: 500;
}

.plan-card .btn-disabled,
.plan-card .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer p {
  margin: 0;
}

.support-contact {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
}

.support-contact::before {
  content: '💬 ';
}

/* 主卡片内客服提示（首屏可见，无需滚动） */
.support-contact--inline {
  margin-top: 1rem;
  margin-bottom: 0;
  padding: 0.7rem 1rem;
  text-align: center;
  background: rgba(225, 48, 108, 0.1);
  border: 1px solid rgba(225, 48, 108, 0.28);
  border-radius: 10px;
  line-height: 1.45;
}

.disclaimer-footer,
.disclaimer-box {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.disclaimer-check input {
  margin-top: 0.2rem;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.user-bar {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-bar a {
  color: var(--accent);
}

.plan-group-title {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-muted);
}

.plan-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.auth-tab.active {
  border-color: var(--accent);
  background: rgba(225, 48, 108, 0.15);
}

.auth-panel label {
  display: block;
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
  color: var(--text-muted);
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

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

.wechat-box {
  text-align: center;
  padding: 1rem 0;
}

.wechat-qr {
  min-height: 80px;
  margin: 1rem 0;
}

/* ========== 管理后台（共用部分） ========== */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
}

.admin-login {
  max-width: 360px;
  margin: 4rem auto;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-card .num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-card--fail .num {
  color: var(--danger);
}

.stat-card--money .num {
  color: #fcd34d;
  font-size: 1.35rem;
}

.money-cell {
  color: #fcd34d;
  font-weight: 600;
  white-space: nowrap;
}

.admin-card-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-url-td {
  min-width: 280px;
  max-width: 420px;
}

.admin-url-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-url-link {
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
  font-size: 0.8rem;
}

.admin-url-link:hover {
  color: var(--accent);
}

.btn-copy-url {
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
}

.btn-copy-url:hover {
  color: var(--text);
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--text-muted);
  font-weight: 500;
}

.tag-ok {
  color: var(--success);
}

.tag-fail {
  color: var(--danger);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.pager-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  min-width: 2.25rem;
}

.admin-grant-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-grant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.admin-grant-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
  flex: 1;
}

.admin-grant-field--wide {
  flex: 2;
  min-width: 200px;
}

.admin-grant-field span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-grant-preview {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-grant-actions {
  display: flex;
  gap: 0.75rem;
}

#grant-message {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.admin-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-card-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-user-filter-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-user-filter-link:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* 管理后台：手机端表格改为卡片列表 */
@media (max-width: 768px) {
  .admin-page {
    padding: 0.75rem;
  }

  .admin-page .header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-login {
    margin: 2rem auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.75rem 0.5rem;
  }

  .stat-card .num {
    font-size: 1.35rem;
  }

  .stat-card--money .num {
    font-size: 1.1rem;
  }

  .admin-page .card {
    padding: 1rem;
  }

  .admin-page .card h3 {
    font-size: 1rem;
  }

  #chart-7d {
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre;
  }

  /* 下载/访问记录：保持表格，横向滑动 */
  .admin-page .table-wrap--scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-page .admin-table--scroll {
    min-width: 36rem;
    font-size: 0.8rem;
  }

  .admin-page .admin-table--scroll th,
  .admin-page .admin-table--scroll td {
    padding: 0.5rem 0.45rem;
    white-space: nowrap;
  }

  .admin-page .admin-table--scroll .admin-url-td {
    white-space: normal;
    min-width: 10rem;
    max-width: 14rem;
  }

  .admin-page .admin-table--scroll td:first-child {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
