/* 如辉AI量化系统 — 响应式样式 (PC+手机自适应) */
:root {
  /* 背景层 */
  --bg: #080b10;
  --bg-soft: #0d1117;
  --card: #11161d;
  --card-hover: #161d27;
  --card-2: #0c1118;
  --border: #1f2937;
  --border-strong: #2d3a4a;

  /* 文字 */
  --text: #e8edf4;
  --muted: #8b97a6;
  --faint: #5c6674;

  /* 品牌主色 (青绿渐变家族) */
  --green: #34d399;
  --green-deep: #10b981;
  --green-dim: #1b3a30;
  --grad-brand: linear-gradient(135deg, #10b981 0%, #34d399 50%, #22d3ee 100%);
  --glow-green: rgba(52, 211, 153, .22);

  /* 状态色 */
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --primary: #10b981;

  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  --shadow-brand: 0 4px 20px rgba(16,185,129,.25);

  /* 圆角系统 */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(16,185,129,.10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(34,211,238,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 11, 16, .72);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(31,41,55,.6);
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px rgba(0,0,0,.35);
  padding: 0 16px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-logo { font-size: 19px; font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; letter-spacing: .3px; }
.nav-logo img { height: 28px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.4); }
.nav-logo span { color: var(--green); }
.nav-links { display: flex; gap: 20px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-login {
  background: var(--grad-brand);
  background-size: 150% 150%;
  color: #fff; border: none;
  padding: 7px 18px; border-radius: 8px; font-size: 14px; cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-brand);
  transition: transform .15s, box-shadow .2s;
}
.nav-login:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(16,185,129,.35); }
/* 汉堡菜单按钮 (移动端) */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px 4px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); margin: 4px 0;
  border-radius: 1px; transition: .2s;
}

/* 容器 */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

/* 卡片 */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent 40%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { border-color: var(--border-strong); }
.card h2 { font-size: 18px; font-weight: 650; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad-brand); }
.card h3 { font-size: 14px; color: var(--muted); margin: 18px 0 10px; letter-spacing: .3px; }

/* 徽章 */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent;
}
.badge.green { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); color: #6ee7b7; }
.badge.red { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); color: #fca5a5; }
.badge.yellow { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35); color: #fcd34d; }
.badge.blue { background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.35); color: #93c5fd; }

/* 网格 */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.025); }

/* 进度条 */
.progress {
  height: 10px; border-radius: 999px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
  overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: var(--grad-brand);
  box-shadow: 0 0 12px var(--glow-green);
  position: relative;
  transition: width .8s cubic-bezier(.22,1,.36,1);
}
.progress-bar::after {
  content: ""; position: absolute; inset: 1px 4px auto;
  height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.5), transparent);
}

/* 涨跌颜色 */
.up { color: var(--red); }  /* A股红涨 */
.down { color: var(--green); }  /* A股绿跌 */

/* 定价卡 */
.pricing-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; text-align: center;
  position: relative;
}
.pricing-card.recommended { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.pricing-card .price { font-size: 32px; font-weight: 700; color: var(--text); }
.pricing-card .price small { font-size: 14px; color: var(--muted); }
.pricing-card ul { list-style: none; margin: 16px 0; text-align: left; }
.pricing-card ul li { padding: 6px 0; color: var(--muted); font-size: 14px; }
.pricing-card ul li::before { content: "✓ "; color: var(--green); }
.pricing-btn {
  display: block; background: var(--grad-brand); color: #fff;
  padding: 10px; border-radius: 8px; text-decoration: none; font-weight: 600;
  box-shadow: var(--shadow-brand);
  transition: transform .18s, box-shadow .22s;
}
.pricing-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(16,185,129,.35); }

/* 英雄区 */
.hero {
  text-align: center; padding: 60px 16px;
  background: linear-gradient(180deg, rgba(35,134,54,.08), transparent);
}
.hero h1 { font-size: 34px; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 16px; margin-bottom: 24px; }
.hero-cta {
  display: inline-block; background: var(--green); color: #fff;
  padding: 12px 32px; border-radius: 8px; text-decoration: none;
  font-size: 16px; font-weight: 600;
}
.hero-badge {
  display: inline-block; padding: 6px 16px;
  background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.35);
  border-radius: 20px; font-size: 14px; color: var(--green);
  margin-bottom: 16px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  margin-top: 36px;
}
.hero-stat {
  display: flex; flex-direction: column; align-items: center;
}
.hero-stat strong { font-size: 22px; color: var(--text); }
.hero-stat span { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 锁内容 */
.locked {
  opacity: .4; filter: blur(3px); pointer-events: none;
  user-select: none;
}
.lock-tip {
  text-align: center; padding: 30px; color: var(--muted);
}
.lock-tip a { color: var(--green); }

/* Toast 提示组件 */
.toast-wrap {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  align-items: center;
}
.toast {
  background: var(--card); border: 1px solid var(--border);
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  animation: toast-in .25s ease;
  max-width: 90vw;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.warning { border-color: var(--yellow); color: var(--yellow); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading 骨架 */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, #21262d 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px; min-height: 60px; margin-bottom: 12px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-text { text-align: center; color: var(--muted); padding: 40px 0; }

/* 用户后台布局 */
.dash-wrap {
  max-width: 1100px; margin: 0 auto; padding: 20px 16px;
  display: flex; gap: 20px; align-items: flex-start;
}
.sidebar {
  width: 220px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px;
  position: sticky; top: 76px;
  box-shadow: var(--shadow-md);
}
.side-user {
  display: flex; gap: 10px; align-items: center;
  padding: 4px 6px 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
  background: rgba(255,255,255,.02); border-radius: 12px; margin: -4px -4px 12px;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(52,211,153,.25), 0 4px 12px rgba(16,185,129,.3);
}
.side-user-info { font-size: 14px; line-height: 1.4; }
#side-username { font-size: 15px; letter-spacing: .2px; }
.side-menu { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-size: 14px;
  transition: all .18s ease; overflow: hidden;
}
.side-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
  transform: translateX(3px);
}
.side-item.active {
  color: var(--green);
  background: linear-gradient(90deg, rgba(16,185,129,.14), rgba(16,185,129,.03));
  font-weight: 600;
}
.side-item.active::before {
  content: ""; position: absolute; left: 0; top: 20%;
  width: 3px; height: 60%; border-radius: 2px;
  background: var(--grad-brand);
  box-shadow: 0 0 8px var(--glow-green);
}
.side-item .dot { position: absolute; right: 12px; }
.side-logout {
  width: 100%; margin-top: 12px; padding: 10px;
  background: transparent; color: var(--faint);
  border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.side-logout:hover { color: var(--red); background: rgba(248,113,113,.08); border-color: transparent; }
.dash-content { flex: 1; min-width: 0; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-left: 6px;
}
.sub-status {
  position: relative;
  padding: 24px; border-radius: var(--r-lg);
  border: 1px solid rgba(16,185,129,.25);
  background:
    radial-gradient(300px 160px at 85% -20%, rgba(34,211,238,.18), transparent 60%),
    linear-gradient(135deg, rgba(16,185,129,.16) 0%, rgba(16,185,129,.03) 50%, transparent 100%),
    var(--card-2);
  overflow: hidden;
}
.sub-status::after {
  content: ""; position: absolute; right: -40px; bottom: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,.25), transparent 70%);
  pointer-events: none;
}

/* 移动横向Tab */
.tabbar {
  display: none;
  overflow-x: auto; white-space: nowrap;
  background: rgba(8,11,16,.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 8px; margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  position: sticky; top: 56px; z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.tabbar-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 14px;
  color: var(--muted); text-decoration: none; font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tabbar-item.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* 响应式 */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-inner { position: relative; }
  .nav-links {
    display: none;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    gap: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,.4);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .hero h1 { font-size: 26px; }
  .card { padding: 16px; border-radius: var(--r-md); margin-bottom: 12px; }
  .container { padding: 16px 12px; }
  /* 用户后台移动端 */
  .sidebar { display: none; }
  .tabbar { display: block; }
  .dash-wrap { flex-direction: column; padding: 12px 8px; gap: 0; }
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .sub-status { padding: 20px 16px; }
  table { font-size: 13px; }
}

/* 输入控件统一美化 */
input, select, textarea {
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}

/* 交互动效 */
.btn, .pricing-btn, .nav-login, .prod-card {
  transition: transform .18s, box-shadow .22s, background .18s;
}
.btn:hover, .pricing-btn:hover { transform: translateY(-2px); }
.dash-content > * { animation: fade-up .3s ease; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
