:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #fff;
  --ink: #172033;
  --muted: #6c7688;
  --line: #e4e8f0;
  --brand: #285fc7;
  --brand-dark: #174596;
  --success: #16834b;
  --danger: #b33a36;
  --warn: #a87513;
  --tail: #3569a9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 64px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.content { width: min(1320px, 92vw); margin: 30px auto 48px; flex: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 7px 20px rgba(20, 41, 80, .04); }
.panel + .panel { margin-top: 20px; }
h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 0 0 18px; font-size: 19px; }
.subtitle, .hint { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(140px, .7fr) minmax(160px, .8fr) minmax(190px, 1fr) minmax(260px, 2fr) auto; gap: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 7px; }
label { font-size: 13px; font-weight: 650; }
input[type="email"], input[type="password"], input[type="text"], input[type="file"], select, textarea { border: 1px solid #cfd6e3; border-radius: 8px; padding: 11px 12px; background: #fff; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(40,95,199,.14); border-color: var(--brand); }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; min-height: 44px; font-weight: 650; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--brand); border-color: #cbd7ef; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.notice { border-radius: 8px; padding: 11px 13px; margin-top: 14px; display: none; font-size: 14px; }
.notice.show { display: block; }
.notice.error { color: var(--danger); background: #fff2f1; border: 1px solid #f5c3c0; }
.notice.success { color: var(--success); background: #eefaf3; border: 1px solid #bde8ca; }
.flow-note { margin: 16px 0 0; border: 1px solid #cbd7ef; border-radius: 10px; background: #f8fbff; padding: 14px; color: #344054; }
.flow-note strong { display: block; color: var(--brand); margin-bottom: 8px; }
.flow-note ol { margin: 0; padding-left: 20px; line-height: 1.8; }
.flow-note li { white-space: normal; }
.auth-card { width: min(450px, 92vw); margin: 9vh auto; }
.auth-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 22px 0; }
.auth-tab { border: 0; background: transparent; color: var(--muted); padding: 0 0 11px; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.auth-help { margin: 0; padding: 11px 13px; border-radius: 8px; background: #f3f6fb; color: var(--muted); font-size: 14px; line-height: 1.6; }
#phone-form[hidden], #signup-form[hidden], #recovery-request-form[hidden], #recovery-password-form[hidden], .auth-tabs[hidden] { display: none !important; }
.auth-inline-link { justify-self: center; border: 0; background: transparent; color: var(--brand); padding: 2px 6px; text-decoration: underline; text-underline-offset: 3px; }
.stack { display: grid; gap: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; background: #fbfcfe; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; }
.badge.pending, .badge.running { color: var(--warn); background: #fff7e3; }
.badge.done { color: var(--success); background: #eaf8f0; }
.badge.failed { color: var(--danger); background: #fff0ef; }
.strategy { font-weight: 700; }
.strategy-profit { color: var(--success); }
.strategy-stop { color: var(--danger); }
.strategy-observe { color: var(--warn); }
.strategy-tail { color: var(--tail); }
footer { color: var(--muted); text-align: center; padding: 18px 20px 25px; font-size: 12px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.report-frame { width: 100%; min-height: 600px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 760px) {
  .topbar { padding: 0 4vw; }
  .content { width: 94vw; margin-top: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  h1 { font-size: 23px; }
  .top-actions span { display: none; }
}

/* Auth tabs and cross-page navigation for the account settings step. */
.top-actions a { color: inherit; white-space: nowrap; }
.top-actions a:hover { color: var(--brand); }
.top-actions .top-current { color: var(--ink); font-weight: 700; }
.auth-tabs { gap: 12px; }
.auth-tab { flex: 1; white-space: nowrap; }
@media (max-width: 420px) {
  .auth-tabs { gap: 8px; }
  .auth-tab { font-size: 13px; }
}

/* 关键词作战任务页：沿用用户洞察的字体、标题层级和宽松表单节奏。 */
.tool-page {
  --bg: #f4f5f6;
  --panel: #fff;
  --ink: #202124;
  --muted: #687078;
  --line: #d8dadd;
  color: var(--ink);
  background: var(--bg);
  font-family: SimSun, "Songti SC", "Noto Serif CJK SC", serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
.tool-page button,
.tool-page input,
.tool-page select,
.tool-page textarea { font: inherit; }
.tool-page .content { width: min(1440px, calc(100% - 64px)); margin: 30px auto 48px; }
.tool-page .panel {
  padding: 24px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px #2021240a;
}
.tool-page h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.35; }
.tool-page h2 { margin: 0; font-size: 22px; line-height: 1.4; }
.tool-page .subtitle { margin: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.tool-page .form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px 18px;
  align-items: end;
}
.tool-page .field { min-width: 0; gap: 10px; }
.tool-page .field label { color: #202124; font-size: 16px; font-weight: 700; line-height: 1.5; }
.tool-page .field:has(#operating-mode) { grid-area: 1 / 1 / 2 / 5; }
.tool-page .field:has(#asin) { grid-area: 1 / 5 / 2 / 9; }
.tool-page .field:has(#marketplace) { grid-area: 1 / 9 / 2 / 13; }
.tool-page .field:has(#product-stage) { grid-area: 2 / 1 / 3 / 5; }
.tool-page .field:has(#category) { grid-area: 2 / 5 / 3 / 9; }
.tool-page .field:has(#core-keyword) { grid-area: 2 / 9 / 3 / 13; }
.tool-page .field:has(#competitor-asins) { grid-area: 3 / 1 / 4 / 7; }
.tool-page .field:has(#explicit-irrelevant-terms) { grid-area: 3 / 7 / 4 / 13; }
.tool-page .field:has(#file) { grid-area: 4 / 1 / 5 / 9; }
.tool-page #submit { grid-area: 4 / 9 / 5 / 13; min-height: 48px; font-weight: 700; }
.tool-page input[type="email"],
.tool-page input[type="password"],
.tool-page input[type="text"],
.tool-page input[type="file"],
.tool-page select,
.tool-page textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  border-color: #bec2c6;
  border-radius: 8px;
  color: #202124;
  font-size: 16px;
}
.tool-page textarea { min-height: 104px; line-height: 1.6; resize: vertical; }
.tool-page input:focus,
.tool-page select:focus,
.tool-page textarea:focus { outline: 2px solid #7c8a98; outline-offset: 1px; border-color: #7c8a98; }
.tool-page .btn { min-height: 44px; font-size: 15px; }
.tool-page .btn-primary { background: #202124; color: #fff; }
.tool-page .btn-primary:hover { background: #383b40; }
.tool-page .btn-ghost { border-color: #d8dadd; color: #343a40; }
.tool-page .flow-note { margin-top: 24px; padding: 18px 20px; border-color: #d8e3e9; border-radius: 9px; background: #f7fafb; color: #59616a; font-size: 15px; line-height: 1.7; }
.tool-page .flow-note strong { color: #202124; font-size: 18px; }
.tool-page .panel + .panel { margin-top: 24px; }
.tool-page .table-wrap { border-color: var(--line); border-radius: 8px; }
.tool-page th { background: #eceeef; color: #41464b; font-size: 14px; font-weight: 700; text-align: center; }
.tool-page td { font-size: 14px; }
@media (max-width: 900px) {
  .tool-page .content { width: calc(100% - 40px); }
  .tool-page .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 14px; }
  .tool-page .form-grid > .field, .tool-page #submit { grid-row: auto; }
  .tool-page .field:has(#operating-mode), .tool-page .field:has(#asin),
  .tool-page .field:has(#marketplace), .tool-page .field:has(#product-stage),
  .tool-page .field:has(#category), .tool-page .field:has(#core-keyword) { grid-column: span 3; }
  .tool-page .field:has(#competitor-asins), .tool-page .field:has(#explicit-irrelevant-terms),
  .tool-page .field:has(#file), .tool-page #submit { grid-column: span 6; }
}
@media (max-width: 600px) {
  .tool-page .content { width: calc(100% - 32px); margin-top: 20px; }
  .tool-page .panel { padding: 16px; }
  .tool-page h1 { font-size: 28px; }
  .tool-page .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .tool-page .form-grid > .field, .tool-page #submit { grid-row: auto; }
  .tool-page .form-grid > .field, .tool-page #submit { grid-column: 1 / -1 !important; }
  .tool-page .topbar { height: auto; min-height: 60px; padding: 8px 16px; flex-wrap: wrap; gap: 10px; }
  .tool-page .top-actions { gap: 8px; }
}
