/* ==========================================================
   价格汇 PriceHub v3 - 全局样式
   ========================================================== */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --navy: #1a1f36;
  --navy-2: #252c4a;
  --primary: #ff4d4f;
  --primary-dark: #e03a3c;
  --accent: #ff8a3d;
  --success: #16a34a;
  --warning: #b45309;
  --text: #1f2329;
  --text-2: #555c6e;
  --text-3: #8a90a3;
  --border: #e6e8ef;
  --radius: 16px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }

/* 焦点可访问性 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { width: 1120px; max-width: 100%; margin: 0 auto; padding: 0 20px; }

/* ===== SVG 图标基类 ===== */
.icon {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; vertical-align: -0.125em;
}
.icon.filled { fill: currentColor; stroke: none; }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 顶部导航 ===== */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(16, 24, 40, .25);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 4px 12px rgba(255, 77, 79, .4);
}
.logo-icon .icon { width: 20px; height: 20px; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: baseline; gap: 8px; }
.logo-text em { font-style: normal; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .55); letter-spacing: 1px; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: rgba(255, 255, 255, .72); font-size: 13.5px; padding: 7px 13px; border-radius: 8px;
  transition: all .18s; display: inline-flex; align-items: center; gap: 6px;
}
.nav a .icon { width: 15px; height: 15px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .14); font-weight: 600; }

.user-box { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.who { color: rgba(255, 255, 255, .85); font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn-ghost { color: rgba(255, 255, 255, .85); border-color: rgba(255, 255, 255, .25); background: transparent; }
.topbar .btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); box-shadow: none; transform: none; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; padding: 9px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; font-weight: 500; background: #fff; color: var(--text);
  transition: all .16s; white-space: nowrap;
}
.btn .icon { width: 15px; height: 15px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #ff6b3d); color: #fff; box-shadow: 0 4px 14px rgba(255, 77, 79, .35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(255, 77, 79, .45); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 11px; }
.btn-block { width: 100%; }

/* ===== 主体 ===== */
.main { padding: 36px 20px 80px; min-height: calc(100vh - 60px - 92px); }
.page { animation: pageIn .35s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 20px; }
.page-head h2 { margin: 0 0 4px; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.page-head h2 .icon { width: 22px; height: 22px; color: var(--primary); }
.page-sub { margin: 0; color: var(--text-2); font-size: 14px; max-width: 720px; }
.page-actions { margin-top: 14px; }

.loading-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; text-align: center; color: var(--text-3); font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.loading-card .icon { width: 18px; height: 18px; }

/* ===== 认证页（分栏布局） ===== */
.auth-layout {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 900px; margin: 24px auto 0;
  background: var(--surface); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.auth-brand {
  background: linear-gradient(150deg, var(--navy) 0%, #2b3564 60%, #3d3a75 100%);
  color: #fff; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255, 77, 79, .35), transparent 65%);
}
.auth-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(255, 77, 79, .45);
}
.auth-logo .icon { width: 30px; height: 30px; }
.auth-brand h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: .5px; }
.auth-brand h1 em { font-style: normal; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .6); margin-left: 6px; letter-spacing: 1px; }
.auth-brand-sub { margin: 0 0 22px; color: rgba(255, 255, 255, .75); font-size: 14px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.auth-points li .icon { width: 17px; height: 17px; color: #ff8a6b; margin-top: 2px; }
.auth-form-wrap { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form-wrap h2 { margin: 0 0 4px; font-size: 22px; }
.auth-sub { margin: 0 0 18px; color: var(--text-3); font-size: 13.5px; }
.card-form { display: flex; flex-direction: column; gap: 14px; }
.card-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.card-form input {
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s, box-shadow .15s; font-weight: 400;
}
.card-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 77, 79, .08); }
.form-hint { margin: 0; font-size: 13px; text-align: center; color: var(--text-3); }

/* ===== Hero ===== */
.hero { text-align: center; margin: 30px auto 28px; max-width: 760px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 20px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2);
  font-size: 12.5px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.hero-badge .icon { width: 14px; height: 14px; color: var(--accent); }
.hero h1 { font-size: 40px; margin: 0 0 12px; letter-spacing: -1px; line-height: 1.25; }
.hero .grad { background: linear-gradient(120deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .subtitle { color: var(--text-2); font-size: 15.5px; margin: 0 auto; max-width: 600px; }

/* ===== 游客提示条 ===== */
.guest-notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fffbeb; border: 1px solid #fde68a; color: var(--warning);
  border-radius: 12px; padding: 11px 18px; margin-bottom: 14px; font-size: 13.5px;
}
.guest-notice .icon { width: 17px; height: 17px; flex-shrink: 0; }
.guest-notice .btn { margin-left: auto; }

/* ===== 搜索卡片 ===== */
.search-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 22px; border: 1px solid var(--border);
}
.input-wrap { display: flex; gap: 12px; align-items: stretch; }
.textarea-box { flex: 1; position: relative; }
.textarea-box .input-icon {
  position: absolute; left: 14px; top: 16px; color: var(--text-3); pointer-events: none;
}
.textarea-box .input-icon .icon { width: 17px; height: 17px; }
.search-card textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 42px 14px 40px;
  font-size: 14.5px; font-family: inherit; resize: vertical; outline: none; line-height: 1.5;
  transition: border .18s, box-shadow .18s; background: var(--surface-2); min-height: 58px;
}
.search-card textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 77, 79, .1); background: #fff; }
.clear-btn {
  position: absolute; right: 10px; top: 16px; border: none; background: var(--surface-2);
  color: var(--text-3); border-radius: 50%; width: 26px; height: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.clear-btn:hover { background: #eceef4; color: var(--text); }
.clear-btn .icon { width: 14px; height: 14px; }
.input-wrap .btn { align-self: center; flex-shrink: 0; }

.search-meta { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.meta-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; padding: 5px 12px; border-radius: 16px;
  background: var(--surface-2); color: var(--text-2); cursor: pointer; user-select: none;
  border: 1px solid var(--border); transition: all .15s;
}
.chip:hover { border-color: var(--text-3); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--text-3); }

.examples { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.examples-label { font-size: 12.5px; color: var(--text-3); }
.example-chip {
  font-size: 12px; padding: 4px 11px; border-radius: 14px; border: 1px dashed var(--border);
  background: #fff; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.example-chip:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }

/* ===== 进度面板 ===== */
.progress-area { margin-top: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.progress-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.progress-head h2 .icon { width: 18px; height: 18px; color: var(--primary); }
.progress-count { font-size: 13px; color: var(--text-3); }
.progress-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s ease; }
.progress-list { display: flex; flex-direction: column; gap: 8px; }
.progress-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3);
  padding: 8px 10px; border-radius: 9px; background: var(--surface-2); transition: all .3s;
}
.progress-item .p-icon {
  width: 24px; height: 24px; border-radius: 7px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.progress-item .p-icon .icon { width: 13px; height: 13px; }
.progress-item.running { color: var(--text-2); background: #fff; border: 1px solid var(--border); }
.progress-item.running .p-icon { animation: pulseSoft 1.2s infinite; }
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.progress-item.done { color: var(--text-2); background: #f0fdf4; border: 1px solid #bbf7d0; }
.progress-item.error { color: var(--text-2); background: #fef2f2; border: 1px solid #fecaca; }
.progress-item { flex-wrap: wrap; }
.progress-item .p-name { font-weight: 500; }
.progress-item .p-count { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.progress-item .p-status { margin-left: 8px; font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 3px; }
.progress-item .p-status .icon { width: 12px; height: 12px; }
.progress-item .p-detail {
  flex-basis: 100%; font-size: 11.5px; color: var(--text-3);
  line-height: 1.4; padding-left: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.progress-item .p-detail:empty { display: none; }
.progress-item.done .p-status { color: var(--success); }
.progress-item.error .p-status { color: var(--primary-dark); }

/* ===== 比价流水线（四步阶段） ===== */
.prog-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .25s, border-color .25s;
}
.prog-name { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; font-size: 13.5px; font-weight: 600; }
.prog-name .p-badge { width: 22px; height: 22px; border-radius: 6px; }
.prog-name .p-badge .icon { width: 12px; height: 12px; }
.prog-steps { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.pstep {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12px; color: var(--text-3); padding: 2px 9px;
  border-radius: 12px; background: #fff; border: 1px solid var(--border);
  transition: all .2s;
}
.pstep .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.pstep.active { color: var(--primary-dark); border-color: rgba(255, 77, 79, .4); background: #fff5f4; }
.pstep.active .dot { background: var(--primary); animation: pstepPulse 1s ease-in-out infinite; }
.pstep.done { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.pstep.done .dot { background: var(--success); }
@keyframes pstepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, .35); }
  50% { box-shadow: 0 0 0 4px rgba(255, 77, 79, 0); }
}
.prog-timer { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-status {
  font-size: 12px; color: var(--text-2); max-width: 220px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.prog-row.done { background: #f0fdf4; border-color: #bbf7d0; }
.prog-row.fail { background: #fef2f2; border-color: #fecaca; }
.prog-row.done .prog-timer { color: var(--success); }
.prog-row.fail .prog-timer { color: var(--primary-dark); }
.prog-summary { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 2px 0; }
.prog-summary .icon { width: 16px; height: 16px; color: var(--success); }

/* ===== 结果 ===== */
#resultArea { margin-top: 28px; }
.result-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.result-header h2 { margin: 0; font-size: 21px; }
.result-actions { margin-left: auto; }
.source-info { width: 100%; margin-top: 6px; font-size: 13px; color: var(--text-3); }
.src-tag {
  display: inline-block; padding: 3px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; margin: 3px 6px 0 0; color: var(--text-2);
}

/* 最低价横幅 */
.best-deal {
  display: flex; align-items: center; gap: 24px; margin: 18px 0 24px;
  padding: 22px 26px; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #fff5f4, #fff 60%, #fff8f3);
  border: 1.5px solid rgba(255, 77, 79, .35); box-shadow: 0 8px 28px rgba(255, 77, 79, .12);
}
.best-deal::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.best-left { flex: 1; min-width: 0; }
.best-tag { font-size: 12.5px; font-weight: 700; color: var(--primary); letter-spacing: .5px; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.best-tag .icon { width: 15px; height: 15px; }
.best-price { font-size: 44px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.best-price .unit { font-size: 22px; margin-right: 2px; }
.best-title {
  margin-top: 6px; font-size: 14px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.best-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.best-platform { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 6px; color: #fff; }
.best-account { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.best-account .icon { width: 13px; height: 13px; }
.best-save { font-size: 13px; color: var(--accent); font-weight: 600; }
.best-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.best-actions .btn { min-width: 120px; }

/* 平台结果网格 */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.platform-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; position: relative; overflow: hidden; transition: all .18s;
  display: flex; flex-direction: column; animation: cardIn .4s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.platform-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--pc, var(--border));
}
.platform-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: transparent; }
.platform-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.platform-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.p-badge {
  width: 26px; height: 26px; border-radius: 8px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.p-badge .icon { width: 14px; height: 14px; }
.rank-badge {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd666, #fa8c16); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(250, 140, 22, .4);
}
.platform-status { font-size: 11px; padding: 2px 9px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.platform-status.ok { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.platform-status.error,
.platform-status.login_wall,
.platform-status.blocked { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.platform-status.no_data,
.platform-status.timeout,
.platform-status.page_changed { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.platform-status.no_result,
.platform-status.no_match { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.platform-count { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.platform-price-row { display: flex; align-items: center; gap: 8px; }
.platform-price { font-size: 25px; font-weight: 800; color: var(--primary-dark); }
.platform-price.null { color: var(--text-3); font-size: 14px; font-weight: 500; }
.sim-badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 9px;
  font-size: 11px; font-weight: 600; background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
}
.offer-account { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); margin: 4px 0 10px; }
.offer-account .icon { width: 13px; height: 13px; }
.platform-title {
  font-size: 13px; color: var(--text-2); margin: 5px 0 10px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.platform-note { font-size: 12px; color: var(--text-3); margin-bottom: 10px; background: var(--surface-2); padding: 7px 10px; border-radius: 7px; }
.platform-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.platform-actions .btn-sm { flex: 1; }
.more-toggle { font-size: 12px; color: var(--primary); cursor: pointer; background: none; border: none; padding: 2px 4px; display: inline-flex; align-items: center; gap: 3px; }
.more-toggle .icon { width: 12px; height: 12px; }
.more-list { margin-top: 8px; }
.more-item {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 0;
  border-top: 1px dashed var(--border); font-size: 12.5px;
}
.more-item .m-title,
.more-item .m-account { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-item .m-price { color: var(--primary-dark); font-weight: 700; flex-shrink: 0; }
.more-item .icon { width: 12px; height: 12px; color: var(--text-3); flex-shrink: 0; }
a.more-item { color: inherit; text-decoration: none; }
a.more-item:hover { color: var(--primary); text-decoration: none; }

/* ===== 特性区 ===== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 48px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all .18s; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--primary);
}
.feature-icon .icon { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* ===== 降价提醒 ===== */
.watch-list { display: grid; gap: 12px; }
.watch-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 16px; transition: all .18s;
}
.watch-item:hover { box-shadow: var(--shadow); }
.watch-item.hit { border-color: var(--success); background: #f0fdf4; }
.watch-info { flex: 1; min-width: 0; }
.watch-info h3 { margin: 0 0 4px; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-info .w-url { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-prices { display: flex; gap: 18px; flex-shrink: 0; font-size: 13px; }
.watch-prices .wp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.watch-prices .wp .lbl { font-size: 11.5px; color: var(--text-3); }
.watch-prices .wp .val { font-weight: 700; font-size: 16px; }
.watch-prices .wp .val.hit { color: var(--success); }
.watch-item .w-actions { display: flex; gap: 8px; flex-shrink: 0; }
.watch-empty, .history-empty { text-align: center; padding: 60px 0; color: var(--text-3); }
.watch-empty .empty-icon, .history-empty .empty-icon { font-size: 42px; margin-bottom: 10px; }

/* ===== 历史 ===== */
.history-list { display: grid; gap: 10px; }
.history-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 14px 18px; display: flex; align-items: center; gap: 14px; transition: all .15s;
}
.history-item:hover { box-shadow: var(--shadow); border-color: transparent; }
.history-item .h-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary);
}
.history-item .h-icon .icon { width: 17px; height: 17px; }
.history-main { flex: 1; min-width: 0; }
.history-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.history-title:hover { color: var(--primary); }
.history-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.hist-del {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.hist-del .icon { width: 14px; height: 14px; }
.hist-del:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

/* ===== 账号管理 ===== */
.cookie-guide { margin-bottom: 16px; }
.cookie-guide details { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 12px 18px; }
.cookie-guide summary { cursor: pointer; font-size: 13.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; list-style: none; }
.cookie-guide summary::-webkit-details-marker { display: none; }
.cookie-guide summary .icon { width: 15px; height: 15px; color: var(--primary); }
.cookie-guide ol { margin: 10px 0 4px; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.cookie-guide li { margin: 4px 0; }
.cookie-guide code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; border: 1px solid var(--border); }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .18s; }
.account-card:hover { box-shadow: var(--shadow); }
.account-card .ac-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.account-card .ac-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.account-card .ac-head .ac-key { font-size: 11px; color: var(--text-3); font-weight: 400; }
.account-status { font-size: 12px; margin-bottom: 12px; }
.account-status.saved { color: var(--success); }
.account-status.empty { color: var(--text-3); }
.account-card textarea {
  width: 100%; min-height: 96px; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical; outline: none; transition: border .15s;
}
.account-card textarea:focus { border-color: var(--primary); }
.account-card input[type="text"] { width: 100%; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; margin-top: 8px; outline: none; font-family: inherit; }
.account-card input[type="text"]:focus { border-color: var(--primary); }
.account-card .card-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.account-card .ac-total { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ===== 账号列表行 ===== */
.acct-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.acct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; flex-wrap: wrap;
}
.acct-row.editing { background: #fff; }
.acct-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.acct-label {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text-3); white-space: nowrap;
}
.acct-badge.active { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.acct-badge.invalid { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.acct-badge.unknown { background: var(--surface-2); color: var(--text-3); }
.acct-default {
  font-size: 11px; padding: 1px 7px; border-radius: 9px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent)); white-space: nowrap;
}
.acct-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acct-actions .btn { padding: 3px 9px; font-size: 12px; }
.acct-actions .btn .icon { width: 13px; height: 13px; }
.acct-empty {
  font-size: 12.5px; color: var(--text-3); padding: 12px; text-align: center;
  border: 1px dashed var(--border); border-radius: 10px;
}
.acct-edit { display: flex; gap: 8px; align-items: center; width: 100%; }
.acct-edit input {
  flex: 1; min-width: 0; padding: 6px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; outline: none;
}
.acct-edit input:focus { border-color: var(--primary); }

/* ===== 扫码登录弹窗 ===== */
.modal.login-modal { width: 820px; padding: 20px 22px 18px; max-height: 94vh; overflow-y: auto; }

/* 配置工具栏 */
.login-config { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.login-label-field {
  flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; color: var(--text-2); font-weight: 500;
}
.login-config input {
  padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
}
.login-config input:focus { border-color: var(--primary); }
.login-toolbar { display: flex; gap: 8px; }

.login-screen-wrap {
  position: relative; background: #f2f4f8; border: 1px solid var(--border); border-radius: 12px;
  min-height: 320px; max-height: 56vh; overflow: hidden; display: flex;
  align-items: center; justify-content: center;
}
.login-screen-wrap img {
  display: block; width: auto; max-width: 100%; max-height: 56vh;
  object-fit: contain; object-position: top center;
}
.login-screen-wrap img:not([src]) { display: none; }
/* 图片就绪后容器收缩到画面尺寸，保证透明点击层与截图完全重合 */
.login-screen-wrap.ready { min-height: 0; width: fit-content; max-width: 100%; margin: 0 auto; }
.login-screen-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; color: var(--text-3); font-size: 13.5px;
}
.login-screen-loading .icon { width: 22px; height: 22px; color: var(--primary); }

/* 透明点击层：覆盖在截图上，点击映射到原始视口坐标 */
.login-click-layer { position: absolute; inset: 0; cursor: crosshair; z-index: 2; background: transparent; }

.login-tip { margin: 12px 0 4px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }

/* 键盘操作区 */
.login-keybar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.login-keybar input {
  flex: 1; min-width: 160px; padding: 8px 11px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; outline: none;
}
.login-keybar input:focus { border-color: var(--primary); }
.login-keybar .btn { padding: 5px 12px; font-size: 12.5px; }

/* 平台卡片内的登录按钮区 */
.ac-primary { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ac-primary .btn { flex: 1; }
.ac-manual { border-top: 1px dashed var(--border); padding-top: 10px; }
.ac-manual summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-3); list-style: none;
  display: flex; align-items: center; gap: 5px;
}
.ac-manual summary::-webkit-details-marker { display: none; }
.ac-manual summary:hover { color: var(--primary); }
.ac-manual summary .icon { width: 13px; height: 13px; }
.ac-manual[open] summary { margin-bottom: 8px; }

/* 未登录平台 chip */
.chip.locked { opacity: .55; border-style: dashed; }
.chip .chip-lock { width: 10px; height: 10px; margin-left: 3px; vertical-align: -1px; }
/* 暂不支持比价的平台 chip */
.chip.disabled {
  opacity: .5; border-style: dashed; background: var(--surface-2);
  color: var(--text-3); cursor: not-allowed; filter: grayscale(1);
}
.chip.disabled:hover { border-color: var(--border); }
.chip .chip-suffix { margin-left: 4px; font-size: 11px; color: var(--text-3); }

/* ===== 浏览器内核提示 ===== */
.browser-status {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--warning);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.browser-status.downloading { border-left-color: var(--primary); }
.browser-status .bs-icon {
  width: 40px; height: 40px; border-radius: 11px; background: #fff7e6; color: var(--warning);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.browser-status.downloading .bs-icon { background: #fff1f0; color: var(--primary); }
.browser-status .bs-icon .icon { width: 20px; height: 20px; }
.browser-status .bs-body { flex: 1; min-width: 0; }
.browser-status h3 { margin: 0 0 4px; font-size: 14.5px; }
.browser-status p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.browser-status .bs-error { color: #b91c1c; margin-top: 6px; }
.browser-status .bs-progress {
  height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 10px;
}
.browser-status .bs-progress div {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .4s ease;
}
.browser-status > .btn { flex-shrink: 0; }

@media (max-width: 720px) {
  .browser-status { flex-direction: column; }
  .browser-status > .btn { width: 100%; }
}

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: var(--text-3); box-shadow: var(--shadow-sm);
}
.empty-icon .icon { width: 32px; height: 32px; }
.empty-state h3 { margin: 0 0 6px; color: var(--text-2); font-size: 16px; }
.empty-state p { margin: 0 auto; font-size: 13.5px; max-width: 520px; line-height: 1.8; }

/* ===== 弹层通用 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .5); backdrop-filter: blur(3px);
  z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: maskIn .2s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 440px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.modal-head h3 .icon { width: 18px; height: 18px; color: var(--primary); }
.modal-close { border: none; background: var(--surface-2); color: var(--text-3); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.modal-close:hover { background: #eceef4; color: var(--text); }
.modal-close .icon { width: 15px; height: 15px; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.modal input { padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; outline: none; font-family: inherit; font-weight: 400; }
.modal input:focus { border-color: var(--primary); }
.modal input[readonly] { background: var(--surface-2); color: var(--text-3); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* 确认框 */
.confirm-modal { width: 380px; text-align: center; padding: 28px 24px; }
.confirm-icon {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 14px;
  background: #fef2f2; color: #dc2626; display: flex; align-items: center; justify-content: center;
}
.confirm-icon .icon { width: 24px; height: 24px; }
.confirm-modal h3 { margin: 0 0 6px; font-size: 17px; }
.confirm-modal p { margin: 0 0 18px; font-size: 13.5px; color: var(--text-2); }
.confirm-modal .modal-actions { justify-content: center; }

/* ===== Toast ===== */
.toast-box {
  position: fixed; top: 72px; right: 20px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px; max-width: 340px;
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; pointer-events: auto;
}
.toast .icon { width: 17px; height: 17px; flex-shrink: 0; }
.toast.error { background: #b91c1c; }
.toast.success { background: #15803d; }
.toast.info { background: var(--navy); }
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 900px) {
  .topbar-inner { gap: 16px; }
  .nav a { padding: 7px 10px; }
  .hero h1 { font-size: 32px; }
  .auth-layout { grid-template-columns: 1fr; max-width: 520px; }
  .auth-brand { padding: 30px 32px; }
  .auth-brand::after { right: -100px; top: -100px; }
  .auth-form-wrap { padding: 30px 32px; }
}

@media (max-width: 720px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav a { flex-shrink: 0; }
  .user-box { margin-left: auto; }
  .main { padding: 24px 14px 60px; }
  .hero { margin-top: 16px; }
  .hero h1 { font-size: 27px; }
  .hero .subtitle { font-size: 14px; }
  .search-card { padding: 16px; border-radius: 14px; }
  .input-wrap { flex-direction: column; gap: 10px; }
  .input-wrap .btn { width: 100%; }
  .meta-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; width: 100%; }
  .chip { flex-shrink: 0; }
  .progress-list { grid-template-columns: repeat(2, 1fr); }
  .prog-row { gap: 8px; padding: 10px; }
  .prog-name { min-width: 0; }
  .prog-steps { flex-basis: 100%; order: 3; flex-wrap: wrap; }
  .prog-timer { margin-left: auto; }
  .prog-status { flex-basis: 100%; order: 4; max-width: 100%; }
  .best-deal { flex-direction: column; align-items: stretch; gap: 14px; padding: 20px 18px; }
  .best-price { font-size: 36px; }
  .best-actions { flex-direction: row; flex-wrap: wrap; }
  .best-actions .btn { flex: 1; min-width: 0; }
  .result-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .watch-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .watch-prices { width: 100%; justify-content: flex-start; }
  .watch-item .w-actions { width: 100%; }
  .watch-item .w-actions .btn { flex: 1; }
  .history-item { flex-wrap: wrap; }
  .toast-box { right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .footer-inner { justify-content: center; text-align: center; }
  .auth-brand { padding: 24px; }
  .auth-form-wrap { padding: 24px; }
}

@media (max-width: 420px) {
  .features { grid-template-columns: 1fr; }
  .progress-list { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}

/* 账号行 / 登录弹窗小屏适配 */
@media (max-width: 720px) {
  .acct-row { flex-direction: column; align-items: stretch; }
  .acct-main { width: 100%; }
  .acct-actions { width: 100%; }
  .acct-actions .btn { flex: 1; min-width: 0; }
  .modal.login-modal { width: 100%; padding: 16px; }
  .login-config { flex-direction: column; align-items: stretch; }
  .login-toolbar .btn { flex: 1; }
  .login-keybar .btn { flex: 1; }
}

/* 动效偏好：减少动态 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
