/* ============================================================
   APK Armor — Apple 风格设计系统
   设计语言：深色 Hero / 玻璃拟态 / 大留白 / SF Pro / 渐变标题
   ============================================================ */

:root {
  /* 品牌色 */
  --brand: #0FDC78;
  --brand-dark: #00B85C;
  --brand-light: #E5FFF2;
  --brand-glow: rgba(15, 220, 120, 0.4);

  /* 中性色 - 深色主题 */
  --bg: #000000;
  --bg-elevated: #0a0a0c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  /* 文字 */
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;

  /* 圆角 */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* 字体 */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;

  /* 过渡 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.35s;

  /* 阴影 */
  --shadow-glow: 0 0 60px -10px var(--brand-glow);
  --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* 浅色主题（仅控制台详情用） */
.theme-light {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-hover: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ============ 导航栏（玻璃拟态） ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--border);
}
.theme-light .nav {
  background: rgba(255, 255, 255, 0.72);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 48px;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.nav-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
}
.nav-links {
  display: flex;
  gap: var(--space-6);
  font-size: 13px;
  color: var(--text-secondary);
}
.nav-links a {
  transition: color var(--duration) var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: #002812;
  box-shadow: 0 4px 20px -2px var(--brand-glow);
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px -2px var(--brand-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-hover); }
.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}
.btn-text {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: opacity var(--duration);
}
.btn-text:hover { opacity: 0.7; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px var(--space-5) var(--space-9);
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 60%);
  opacity: 0.5;
  filter: blur(80px);
}
.hero-eyebrow {
  font-size: 17px;
  font-weight: 500;
  color: var(--brand);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--brand) 0%, #5FE59B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: clamp(19px, 2.5vw, 28px);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.4;
  margin-bottom: var(--space-7);
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}
.hero-actions {
  display: flex;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-note {
  margin-top: var(--space-6);
  font-size: 13px;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
}

/* ============ 章节通用 ============ */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-9) var(--space-5);
}
.section-head {
  text-align: center;
  margin-bottom: var(--space-8);
}
.section-eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.section-desc {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============ 特性网格 ============ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration) var(--ease);
}
.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 24px;
}
.feature-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.feature-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 大特性展示 */
.feature-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  margin-bottom: var(--space-9);
}
.feature-showcase.reverse { direction: rtl; }
.feature-showcase.reverse > * { direction: ltr; }
.showcase-text h3 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.showcase-text p {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.showcase-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ============ 定价 ============ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: 1000px;
  margin: 0 auto;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: all var(--duration) var(--ease);
}
.price-card.featured {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
  transform: scale(1.03);
}
.price-card:hover {
  border-color: var(--border-strong);
}
.price-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.price-amount {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-1);
}
.price-amount .currency {
  font-size: 28px;
  font-weight: 600;
  vertical-align: top;
  margin-top: 8px;
  display: inline-block;
}
.price-amount .period {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-secondary);
  vertical-align: baseline;
}
.price-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-5);
  min-height: 40px;
}
.price-features {
  list-style: none;
  margin-bottom: var(--space-6);
  flex: 1;
}
.price-features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.price-features li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
}
.featured-badge {
  display: inline-block;
  background: var(--brand);
  color: #002812;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  width: fit-content;
}

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ============ 表单 ============ */
.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
  background: var(--bg);
}
.form-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
}
.form-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}
.form-logo .mark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.form-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
  text-align: center;
}
.form-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-6);
}
.field {
  margin-bottom: var(--space-4);
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--duration), box-shadow var(--duration);
  outline: none;
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 220, 120, 0.15);
}
.input::placeholder { color: var(--text-tertiary); }
.form-error {
  color: #ff453a;
  font-size: 13px;
  margin-top: var(--space-2);
  text-align: center;
}
.form-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--text-secondary);
}
.form-footer a { color: var(--brand); }

/* ============ 控制台布局 ============ */
.console {
  min-height: 100vh;
  background: var(--bg);
}
.console-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px var(--space-5) var(--space-9);
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}
.dashboard-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--text-secondary);
}
.user-chip .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #002812;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

/* 额度卡片 */
.quota-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.quota-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.quota-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.quota-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.quota-value .unit {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 4px;
}

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  background: var(--surface);
  margin-bottom: var(--space-6);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand);
  background: rgba(15, 220, 120, 0.04);
}
.upload-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}
.upload-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.upload-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 任务列表 */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.task-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: border-color var(--duration);
}
.task-row:hover { border-color: var(--border-strong); }
.task-info { flex: 1; min-width: 0; }
.task-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.task-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.task-status {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.task-status.done { background: rgba(15, 220, 120, 0.12); color: var(--brand); }
.task-status.failed { background: rgba(255, 69, 58, 0.12); color: #ff453a; }
.task-status.processing { background: rgba(255, 159, 10, 0.12); color: #ff9f0a; }
.task-progress {
  width: 160px;
  height: 4px;
  background: var(--surface-hover);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #5FE59B);
  transition: width 0.3s var(--ease);
}
/* 加固中：不确定进度，滑块左右往复 */
.task-progress.indeterminate .task-progress-bar {
  width: 42%;
  animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(270%); }
}

/* 状态前的小图标：加固中转圈 / 完成对勾 / 失败叉 */
.status-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 159, 10, 0.25);
  border-top-color: #ff9f0a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon { margin-right: 6px; font-weight: 700; }
.task-status.done .status-icon { color: var(--brand); }
.task-status.failed .status-icon { color: #ff453a; }
.task-status.uploading { background: rgba(10, 132, 255, 0.12); color: #0a84ff; }
.task-status.uploading .status-spinner {
  border-color: rgba(10, 132, 255, 0.25);
  border-top-color: #0a84ff;
}

/* ============ 模态框 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  animation: fadeIn 0.25s var(--ease);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s var(--ease);
}
.modal h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.modal .modal-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-5);
}
.modal-qr {
  width: 220px;
  height: 220px;
  margin: 0 auto var(--space-5);
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-qr canvas, .modal-qr img { width: 100%; height: 100%; }
.modal-price {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand);
  margin-bottom: var(--space-4);
}
.modal-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: var(--space-3);
}
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  z-index: 2000;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s var(--ease);
}
.toast.error { border-color: #ff453a; color: #ff453a; }
.toast.success { border-color: var(--brand); color: var(--brand); }

/* ============ 动画 ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .feature-showcase {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .feature-showcase.reverse { direction: ltr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .quota-row { grid-template-columns: 1fr; }
  .task-row { flex-wrap: wrap; }
  .task-name { max-width: 100%; }
  .section { padding: var(--space-7) var(--space-5); }
  .hero { padding: 100px var(--space-5) var(--space-7); }
}
