:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #647168;
  --line: #dfe6df;
  --paper: #ffffff;
  --wash: #f4f7f3;
  --green: #176b45;
  --green-dark: #0d4f32;
  --green-soft: #e9f5ee;
  --amber: #a55b08;
  --amber-soft: #fff4df;
  --red: #a43c35;
  --red-soft: #fcebea;
  --blue: #2866a6;
  --blue-soft: #edf4fb;
  --shadow: 0 18px 50px rgba(26, 45, 33, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--wash); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--wash); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(23, 33, 27, .08);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: white; display: grid; place-items: center; font-size: 13px; letter-spacing: -.05em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 560; letter-spacing: .08em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-pill { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }

.page { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0 72px; flex: 1; }
.page-narrow { width: min(760px, calc(100% - 36px)); }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(31px, 5vw, 52px); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 23px; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 16px; }
.lede { max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card-pad { padding: clamp(20px, 4vw, 34px); }
.stack { display: grid; gap: 20px; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.hero-login { display: grid; grid-template-columns: 1.08fr .92fr; min-height: calc(100vh - 70px); }
.hero-copy { padding: clamp(40px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; background: #17211b; color: white; }
.hero-copy::after { content: ""; position: absolute; width: 420px; height: 420px; right: -170px; bottom: -170px; border-radius: 50%; border: 70px solid rgba(145, 210, 170, .12); }
.hero-copy .eyebrow { color: #8ed5aa; }
.hero-copy p { max-width: 580px; color: #cbd8cf; line-height: 1.75; font-size: 16px; }
.flow { display: flex; align-items: center; gap: 10px; margin-top: 34px; flex-wrap: wrap; color: #dce6df; font-size: 13px; }
.flow span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.06); }
.flow i { color: #8ed5aa; font-style: normal; }
.auth-panel { display: grid; place-items: center; padding: 34px; background: var(--wash); }
.auth-card { width: min(430px, 100%); padding: 34px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 26px; border-radius: 12px; background: var(--wash); }
.tab { border: 0; padding: 10px; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { background: white; color: var(--ink); box-shadow: 0 3px 10px rgba(20,40,27,.08); font-weight: 700; }

.field { display: grid; gap: 8px; }
.field label, .field legend { font-size: 13px; font-weight: 690; }
.field input, .field select { width: 100%; min-height: 46px; border: 1px solid #cfd8d1; border-radius: 11px; padding: 10px 13px; color: var(--ink); background: white; outline: none; }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 69, .12); }
.asin-list-field { align-content: start; }
.asin-list { display: grid; gap: 9px; }
.asin-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.asin-role { display: inline-grid; place-items: center; min-height: 42px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 760; }
.asin-row[data-role="competitor"] .asin-role { background: var(--blue-soft); color: var(--blue); }
.compact-button { width: max-content; min-height: 38px; padding: 8px 12px; }
.remove-asin { min-width: 42px; min-height: 42px; padding: 8px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-stack { display: grid; gap: 17px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; color: #465249; font-size: 13px; line-height: 1.55; }
.check-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--green); }

.button { min-height: 44px; border: 1px solid transparent; border-radius: 11px; padding: 10px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; font-weight: 720; transition: transform .15s ease, background .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border-color: var(--line); color: var(--ink); background: white; }
.button-ghost { min-height: 36px; padding: 7px 11px; color: var(--muted); background: transparent; border-color: transparent; }
.button-full { width: 100%; }

.notice { display: none; border-radius: 11px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.notice.show { display: block; }
.notice.info { background: var(--blue-soft); color: #184b7f; }
.notice.success { background: var(--green-soft); color: var(--green-dark); }
.notice.error { background: var(--red-soft); color: var(--red); }

.submit-card { margin-top: 30px; }
.budget-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 15px; border-radius: 12px; background: var(--wash); }
.budget-box div { min-width: 0; }
.budget-box small { display: block; color: var(--muted); font-size: 11px; }
.budget-box strong { display: block; margin-top: 4px; font-size: 15px; }

.task-section { margin-top: 42px; }
.task-list { overflow: hidden; }
.task-row { display: grid; grid-template-columns: 1.25fr 1fr .85fr 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.header { padding-top: 12px; padding-bottom: 12px; color: var(--muted); background: #fafcf9; font-size: 12px; font-weight: 700; }
.task-value small { display: none; }
.task-value strong { font-size: 14px; }
.task-value span { color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; width: fit-content; padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 730; }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-working { background: var(--blue-soft); color: var(--blue); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-failed { background: var(--red-soft); color: var(--red); }
.failure { grid-column: 1 / -1; padding: 10px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.empty { padding: 42px 22px; text-align: center; color: var(--muted); }

.report-shell { width: min(1560px, calc(100% - 24px)); padding-top: 24px; }
.report-frame-wrap { overflow: hidden; min-height: 74vh; }
.report-frame { display: block; width: 100%; min-height: 78vh; border: 0; background: white; }
.report-state { min-height: 54vh; display: grid; place-items: center; text-align: center; padding: 30px; }
.report-state-inner { max-width: 520px; }
.loader { width: 28px; height: 28px; margin: 0 auto 18px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { padding: 22px; text-align: center; color: var(--muted); font-size: 12px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 860px) {
  .hero-login { grid-template-columns: 1fr; }
  .hero-copy { min-height: 40vh; padding: 48px 26px; }
  .auth-panel { padding: 28px 18px 48px; }
  .grid-two { grid-template-columns: 1fr; }
  .asin-row { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .task-row.header { display: none; }
  .task-row { grid-template-columns: 1fr 1fr; gap: 13px 18px; }
  .task-value small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
  .task-row .task-action { grid-column: 1 / -1; }
  .task-row .task-action .button { width: 100%; }
}

@media (max-width: 560px) {
  .topbar { height: 62px; padding: 0 15px; }
  .brand small, .user-pill { display: none; }
  .page { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .auth-card { padding: 24px 19px; }
  .budget-box { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .task-row { grid-template-columns: 1fr; }
  .task-row .task-action { grid-column: auto; }
}
