/* GEO 优化系统 · 公共与前台样式（本地化，零外部依赖） */
:root {
  --bg: #070c18;
  --bg-soft: #0a1122;
  --surface: #0f1a33;
  --surface-2: #14203d;
  --border: #20304f;
  --text: #eaf0ff;
  --muted: #8b9bc0;
  --primary: #6c5cf6;
  --primary-2: #9b7cff;
  --accent: #24d6a8;
  --danger: #f2607a;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font-family: var(--font); }
h1, h2, h3, h4, p { margin: 0; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.icon { flex: none; vertical-align: -2px; }
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .18s ease; white-space: nowrap; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-primary { background: linear-gradient(100deg, var(--primary), #7d6bff); color: #fff; box-shadow: 0 6px 20px rgba(108,92,246,.28); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { border-color: rgba(255,255,255,.18); color: var(--text); background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.07); }
.btn-light { background: #f2f4f9; color: #38425a; border-color: #e4e8f1; }
.btn-light:hover { background: #e8ecf6; }
.btn-danger { background: #fdecef; color: #c5384f; border-color: #f8d3da; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.badge-gray { background: #eef1f6; color: #6b7589; }
.badge-green { background: #e4f8ef; color: #12805c; }
.badge-blue { background: #e8efff; color: #3457c9; }
.badge-amber { background: #fff3df; color: #a96b08; }
.badge-red { background: #fce9ec; color: #c23a51; }
.badge-purple { background: #eee9ff; color: #6742d6; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: #e9f9f2; color: #137656; border-color: #c8efdd; }
.alert-warning { background: #fff6e6; color: #9a680b; border-color: #ffe4b0; }
.alert-error, .alert-danger { background: #fdecef; color: #b63048; border-color: #f7ccd3; }
.alert-info { background: #eaf1ff; color: #2f55b8; border-color: #cfdeff; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row > label { font-size: 13px; font-weight: 600; color: #49536b; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email], .form-row input[type=number], .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dfe4ee; border-radius: 9px; background: #fff; color: #25304a; font-size: 14px; outline: none; transition: .16s;
}
.form-row textarea { resize: vertical; line-height: 1.7; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,246,.13); }
.form-tip { color: #8a94a8; font-size: 12px; }
.form-static { font-size: 14px; color: #2b3448; }
.form-actions { display: flex; gap: 10px; padding-top: 6px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #49536b; font-weight: 500 !important; }
.inline-form { display: inline; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-weight: 600; color: #7a859b; background: #f8fafd; padding: 11px 14px; border-bottom: 1px solid #e9edf4; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f0f2f7; color: #35405a; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table .table-empty { text-align: center; color: #9aa4b7; padding: 42px 0; }
.data-table .align-right { text-align: right; }
.data-table .align-center { text-align: center; }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager-item { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #e3e8f1; color: #5b657c; font-size: 13px; background: #fff; }
.pager-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-info { color: #929cad; font-size: 12px; margin-left: 8px; }
.empty-state { text-align: center; padding: 48px 20px; color: #98a3b6; }
.empty-state .icon { color: #c8d0df; }
.empty-state p { margin: 10px 0 16px; font-size: 14px; }

.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar input[type=text] { padding: 9px 12px; border: 1px solid #dfe4ee; border-radius: 9px; font-size: 14px; min-width: 220px; outline: none; }
.search-bar select { padding: 9px 10px; border: 1px solid #dfe4ee; border-radius: 9px; font-size: 13px; background: #fff; color: #3a445b; }

/* ---------- 前台顶栏 ---------- */
.front-body { background: var(--bg); color: var(--text); min-height: 100vh; }
.front-main { min-height: 60vh; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(7,12,24,.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.07); }
.nav-inner { height: 64px; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; letter-spacing: .3px; color: #fff; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ff5a6e, #e5364f); color: #fff; box-shadow: 0 3px 12px rgba(229,54,79,.35); }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { font-size: 13px; color: #9aa8c7; transition: .16s; }
.site-nav a:hover, .site-nav a.active { color: #fff; }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 0; color: #dce5f8; cursor: pointer; }

/* ---------- 前台 Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 68px 0 88px; text-align: center; background:
  radial-gradient(700px 340px at 50% 8%, rgba(108,92,246,.16), transparent 70%),
  linear-gradient(180deg, #080e1e 0%, #070c18 100%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(600px 300px at 50% 20%, #000, transparent 75%); }
.hero-inner { position: relative; }
.platform-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.platform-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; color: #aab7d6; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); }
.platform-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--chip, #6c5cf6); display: inline-block; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: -1px; line-height: 1.25; }
.hero h1 .grad { background: linear-gradient(92deg, #a68bff, #d98cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-desc { max-width: 660px; margin: 18px auto 32px; color: var(--muted); font-size: 14px; line-height: 1.9; }

.detect-card { max-width: 620px; margin: 0 auto; text-align: left; background: linear-gradient(160deg, rgba(21,33,64,.95), rgba(13,22,44,.96)); border: 1px solid var(--border); border-radius: 18px; padding: 26px 28px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.38); }
.detect-card h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: #e8efff; }
.detect-card h2 .icon { color: var(--primary-2); }
.detect-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detect-field label { display: block; text-align: center; font-size: 12px; font-weight: 600; color: #c5d0e9; margin-bottom: 8px; }
.detect-field input, .detect-field select { width: 100%; background: #0c1529; border: 1px solid #243357; border-radius: 9px; padding: 11px 13px; color: #e6edff; font-size: 13px; outline: none; }
.detect-field input::placeholder { color: #5b6b90; }
.detect-field input:focus, .detect-field select:focus { border-color: var(--primary); }
.detect-platforms { margin-top: 18px; }
.detect-platforms > label { display: block; text-align: center; font-size: 12px; font-weight: 600; color: #c5d0e9; margin-bottom: 10px; }
.platform-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.platform-btn { position: relative; padding: 9px 4px; border-radius: 8px; border: 1px solid #2a3a60; background: #101d38; color: #9daccb; font-size: 12px; cursor: pointer; transition: .16s; text-align: center; }
.platform-btn:hover { border-color: #5568c9; color: #dce5ff; }
.platform-btn.selected { border-color: var(--primary); background: rgba(108,92,246,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(139,124,255,.35); }
.platform-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.detect-submit { width: 100%; margin-top: 20px; }
.detect-metrics { text-align: center; color: #7384a8; font-size: 11.5px; margin-top: 14px; letter-spacing: .2px; }
.detect-note { text-align: center; margin-top: 12px; font-size: 12px; color: #8b9bc0; min-height: 18px; }

/* ---------- 检测结果 ---------- */
.result-panel { max-width: 1000px; margin: 34px auto 0; text-align: left; }
.result-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.result-title h2 { font-size: 18px; font-weight: 700; }
.result-title .sub { font-size: 12.5px; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric-card { background: rgba(18,29,56,.9); border: 1px solid var(--border); border-radius: 13px; padding: 16px; }
.metric-card .label { font-size: 12px; color: #8b9bc0; }
.metric-card .value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.metric-card .value small { font-size: 13px; color: #9aa8c7; font-weight: 500; }
.platform-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.platform-result { background: rgba(18,29,56,.9); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px; }
.platform-result .pr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.platform-result .pr-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.platform-result .pr-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip, #6c5cf6); }
.platform-result .pr-line { font-size: 12.5px; color: #a9b6d4; line-height: 1.9; }
.platform-result .pr-snippet { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: #0b1428; border: 1px solid #1c2b4b; font-size: 12px; color: #8b9bc0; line-height: 1.8; }
.demo-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #ffcc7a; background: rgba(255,190,80,.1); border: 1px solid rgba(255,190,80,.25); border-radius: 8px; padding: 6px 10px; }

/* ---------- 前台内容区 ---------- */
.section { padding: 72px 0; }
.section-light { background: #f6f8fc; color: #1e293b; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head .eyebrow { font-size: 13px; color: var(--primary-2); font-weight: 700; letter-spacing: 1px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); margin-top: 10px; font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 14px; line-height: 1.8; }
.section-light .section-head p { color: #6b7589; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-card .ficon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(108,92,246,.16); color: var(--primary-2); margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 9px; }
.feature-card p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.section-light .feature-card { background: #fff; border-color: #e8ecf4; box-shadow: 0 8px 24px rgba(30,50,90,.04); }
.section-light .feature-card p { color: #6b7589; }
.step-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step-item { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step-item .num { color: var(--primary-2); font-weight: 800; font-size: 20px; }
.step-item h3 { font-size: 15px; margin: 10px 0 8px; }
.step-item p { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.prose { max-width: 820px; margin: 0 auto; font-size: 14.5px; line-height: 2; color: #c3cde4; }
.prose h3 { font-size: 18px; color: #fff; margin: 28px 0 10px; }
.prose p { margin-bottom: 12px; }
.prose ul { padding-left: 20px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card .auth-sub { color: var(--muted); font-size: 13px; margin: 8px 0 24px; }
.auth-card .form-row > label { color: #c5d0e9; }
.auth-card .form-row input { background: #0c1529; border-color: #243357; color: #e6edff; }
.auth-card .form-row input::placeholder { color: #5b6b90; }
.auth-card .btn-primary { width: 100%; margin-top: 8px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-links a { color: var(--primary-2); }

/* ---------- 用户中心 ---------- */
.user-wrap { background: #f4f6fa; color: #25304a; min-height: calc(100vh - 64px); padding: 32px 0 64px; }
.user-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.user-side { background: #fff; border: 1px solid #e8ecf4; border-radius: var(--radius); padding: 12px; box-shadow: 0 6px 20px rgba(30,50,90,.04); }
.user-side-title { font-size: 12px; color: #9aa4b7; font-weight: 700; padding: 8px 10px 12px; letter-spacing: .5px; }
.user-side-link { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 9px; font-size: 13.5px; color: #58627a; margin-bottom: 2px; }
.user-side-link:hover { background: #f5f7fc; color: #35405a; }
.user-side-link.active { background: #eeecff; color: #5840d6; font-weight: 700; }
.user-main { background: #fff; border: 1px solid #e8ecf4; border-radius: var(--radius); padding: 24px; min-height: 460px; box-shadow: 0 6px 20px rgba(30,50,90,.04); }
.user-main h1 { font-size: 20px; font-weight: 800; color: #1e293b; }
.user-main .lead { color: #8a94a8; font-size: 13px; margin: 6px 0 22px; }
.user-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.user-stat { border: 1px solid #e9edf4; border-radius: 12px; padding: 16px; background: #fbfcff; }
.user-stat .l { font-size: 12px; color: #8a94a8; }
.user-stat .v { font-size: 22px; font-weight: 800; margin-top: 6px; color: #25304a; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid rgba(255,255,255,.07); background: #060b16; padding: 42px 0 30px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 18px; }
.footer-brand { margin-bottom: 12px; }
.site-footer p { color: #7d8bab; font-size: 13px; line-height: 1.8; max-width: 520px; }
.footer-links { display: flex; gap: 20px; font-size: 13px; color: #9aa8c7; }
.footer-links a:hover { color: #fff; }
.footer-meta { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.06); padding-top: 18px; color: #5e6c8d; font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .feature-grid, .step-list { grid-template-columns: repeat(2, 1fr); }
  .metric-grid, .user-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .platform-results { grid-template-columns: 1fr; }
  .user-layout { grid-template-columns: 1fr; }
  .user-side { display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .user-side-title { display: none; }
  .user-side-link { white-space: nowrap; margin: 0; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 28px); }
  .nav-inner { height: 58px; gap: 10px; }
  .site-nav { display: none; position: absolute; top: 58px; left: 0; right: 0; background: #0b1224; border-bottom: 1px solid var(--border); padding: 14px 20px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-nav.open { display: flex; }
  .nav-actions { display: none; }
  .nav-actions.open { display: flex; position: absolute; top: 226px; right: 20px; }
  .nav-toggle { display: block; }
  .hero { padding: 44px 0 60px; }
  .hero-desc { font-size: 13px; }
  .detect-card { padding: 20px 16px; }
  .detect-two { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 52px 0; }
  .feature-grid, .step-list { grid-template-columns: 1fr; }
  .metric-grid, .user-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
  .user-main { padding: 16px; }
  .data-table td, .data-table th { padding: 10px; }
}
