/* ============================================================
   掌文 · 图片压缩 — shared design system
   Direction: Meituan-yellow action color on a neutral, business-clean
   canvas (Professional structure). Yellow fills actions & states;
   it never sets body text. Derived only — no raw hex below :root.
   ============================================================ */

/* 不要用外链 Web 字体：fonts.googleapis.com 在国内会超时并阻塞渲染（拖垮 LCP）。
   统一走下面的系统字体栈。 */

:root {
  /* surface & ink */
  --bg:      #f7f8fa;
  --surface: #ffffff;
  --surface-sunk: #f2f4f7;
  --fg:      #111827;
  --fg-2:    #344054;
  --muted:   #667085;
  --border:  #e4e7ec;
  --border-soft: #f2f4f7;

  /* action — 美团外卖黄 */
  --accent:      #ffd600;
  --accent-on:   #111827;      /* text/icon color on yellow */
  --accent-deep: #f5b800;      /* pressed / edge states */
  --accent-tint: #fff8d6;      /* wash behind highlighted rows */
  --accent-ink:  #7a5c00;      /* dark amber for small text accents */

  /* status */
  --success: #16a34a;
  --success-tint: #ecfdf3;
  --warn:    #d97706;
  --danger:  #dc2626;
  --danger-tint: #fef2f2;

  /* type */
  --font-display: "Poppins", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono:    "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --fs-h1: clamp(38px, 5.4vw, 64px);
  --fs-h2: clamp(28px, 3.6vw, 42px);
  --fs-h3: 21px;
  --fs-lead: 18px;
  --fs-body: 15.5px;
  --fs-meta: 13px;

  /* spacing — 8pt grid */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 88px;
  --container: 1160px;
  --gutter: 32px;

  --radius: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-pop:  0 12px 40px rgba(17, 24, 39, 0.14);

  --motion-fast: 150ms;
  --motion-base: 240ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
::selection { background: var(--accent); color: var(--accent-on); }

/* ---------- layout primitives ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* ---------- type ---------- */
.h1, h1 { font-size: var(--fs-h1); line-height: 1.16; letter-spacing: -0.01em; }
.h2, h2 { font-size: var(--fs-h2); line-height: 1.25; letter-spacing: -0.005em; }
.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.lead   { font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); max-width: 60ch; margin: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--gap-sm);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 6px; border-radius: 3px;
  background: var(--accent); flex: none;
}
.eyebrow.center { justify-content: center; }
.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- chrome ---------- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; gap: var(--gap-lg); padding-block: 13px; }
.topnav .logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.topnav .logo .logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-on);
  display: grid; place-items: center; flex: none;
}
.topnav .logo .logo-mark svg { width: 17px; height: 17px; }
.topnav nav { display: flex; gap: var(--gap-lg); margin-inline: auto; }
.topnav nav a { font-size: 14.5px; color: var(--muted); transition: color var(--motion-fast) var(--ease); }
.topnav nav a:hover, .topnav nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.topnav .nav-actions { display: flex; align-items: center; gap: var(--gap-sm); }
@media (max-width: 820px) {
  .topnav nav { display: none; }
  .topnav-inner { justify-content: space-between; }
}
.pagefoot { padding-block: var(--gap-xl); color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--border); background: var(--surface); }
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); }
.pagefoot nav { display: flex; gap: var(--gap-md); flex-wrap: wrap; }
.pagefoot nav a:hover { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease), transform 80ms var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 45%, transparent); }
.btn-primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent-deep); box-shadow: inset 0 -1px 0 var(--accent-deep); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-dark { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.btn-dark:hover { background: var(--fg-2); }
.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover { color: var(--accent-ink); }
.btn-arrow::after { content: "→"; transition: transform var(--motion-fast) var(--ease); }
.btn-arrow:hover::after { transform: translateX(3px); }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card-flat { background: transparent; border: 0; padding: 0; }
.card-raised { box-shadow: var(--shadow-card); }

/* ---------- feature cell ---------- */
.feature .feature-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--fg);
  margin-bottom: var(--gap-md);
}
.feature .feature-mark svg { width: 19px; height: 19px; }
.feature h3 { margin-bottom: 6px; }
.feature p  { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- stat ---------- */
.stat .stat-num {
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--fg);
  font-weight: 700;
}
.stat .stat-num em { font-style: normal; color: var(--accent-ink); }
.stat .stat-label { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; max-width: 26ch; }

/* ---------- pill / tag ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.pill[hidden] { display: none; }
.pill-quiet { background: var(--surface-sunk); color: var(--muted); }
.tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}
.tag-ok { color: var(--success); border-color: color-mix(in oklch, var(--success) 35%, var(--border)); background: var(--success-tint); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: color-mix(in oklch, var(--muted) 70%, transparent); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 38%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklch, var(--danger) 16%, transparent); }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 0; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--muted); }
.checkbox-row input { margin-top: 3px; accent-color: var(--accent-deep); width: 15px; height: 15px; flex: none; }
.checkbox-row a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- table ---------- */
.ds-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ds-table th, .ds-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.ds-table th { color: var(--muted); font-weight: 600; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.ds-table td.num-col, .ds-table th.num-col { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: center; }
.ds-table tbody tr:hover { background: var(--surface); }
.ds-table .col-highlight { background: var(--accent-tint); }

/* ---------- image placeholder ---------- */
.ph-img {
  background: var(--surface-sunk);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ph-img.square   { aspect-ratio: 1 / 1; }
.ph-img.portrait { aspect-ratio: 3 / 4; }
.ph-img.wide     { aspect-ratio: 16 / 9; }

/* ---------- divider ---------- */
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.rule-strong { border: 0; border-top: 1.5px solid var(--fg); margin: 0; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(56px, 9vw, 108px); }
.hero-center { text-align: center; max-width: 34ch; margin-inline: auto; }
.hero-center .eyebrow { justify-content: center; }
.hero-center .lead, .hero-center .hero-cta-wrap { margin-inline: auto; }
.hero h1 { margin-bottom: var(--gap-md); }
.hero .lead { margin-bottom: var(--gap-lg); }
.hero-cta { display: inline-flex; gap: var(--gap-sm); flex-wrap: wrap; }
.hero-center .hero-cta { justify-content: center; }
.hero-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--gap-2xl); align-items: center; }
@media (max-width: 920px) { .hero-split { grid-template-columns: 1fr; gap: var(--gap-xl); } }

/* ---------- log row ---------- */
.log-row { display: grid; grid-template-columns: 110px 1fr 96px; gap: var(--gap-lg); padding: 22px 0; border-top: 1px solid var(--border); align-items: baseline; }
.log-row h3 { font-size: 18px; }
.log-row .pull { text-align: right; }
@media (max-width: 720px) { .log-row { grid-template-columns: 1fr; gap: 6px; } .log-row .pull { text-align: left; } }

/* ============================================================
   TOOL PAGE — dropzone / settings / batch list / compare
   ============================================================ */

.tool-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap-lg); align-items: start; }
@media (max-width: 980px) { .tool-shell { grid-template-columns: 1fr; } }

/* dropzone */
.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(36px, 6vw, 64px) var(--gap-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.dropzone:hover { border-color: var(--accent-deep); }
.dropzone:focus-visible { outline: none; border-color: var(--accent-deep); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 35%, transparent); }
.dropzone.is-dragover {
  border-color: var(--accent-deep);
  background: var(--accent-tint);
  transform: scale(1.005);
}
.dropzone .dz-icon {
  width: 58px; height: 58px; margin: 0 auto 18px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-on);
  display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 var(--accent-deep);
  transition: transform var(--motion-base) var(--ease);
}
.dropzone.is-dragover .dz-icon { transform: translateY(-4px); }
.dropzone .dz-icon svg { width: 26px; height: 26px; }
.dropzone h2 { font-size: clamp(20px, 2.4vw, 26px); margin-bottom: 8px; }
.dropzone p { margin: 0; color: var(--muted); font-size: 14.5px; }
.dropzone .dz-formats { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* settings panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-body { padding: 18px; display: flex; flex-direction: column; gap: var(--gap-md); }
.panel-foot { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-sunk); }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
}
.seg button {
  border: 0; background: transparent; border-radius: 7px;
  padding: 7px 6px; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--fg);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
}
.seg button:hover:not([aria-pressed="true"]) { color: var(--fg-2); }

.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent-deep); height: 4px; }
.slider-val {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  min-width: 44px; text-align: center;
  background: var(--accent); color: var(--accent-on);
  border-radius: 7px; padding: 3px 6px;
}

/* batch list */
.batch-list { display: flex; flex-direction: column; }
.batch-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: var(--gap-md);
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  transition: background var(--motion-fast) var(--ease);
}
.batch-row:first-child { border-top: 0; }
.batch-row:hover { background: var(--surface-sunk); }
.batch-row.is-active { background: var(--accent-tint); }
.batch-thumb {
  width: 56px; height: 56px; border-radius: 9px;
  object-fit: cover; border: 1px solid var(--border);
  background: var(--surface-sunk);
}
.batch-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.batch-sub .saved { color: var(--success); font-weight: 600; }
.batch-sub .saving { color: var(--accent-ink); font-weight: 600; }
.batch-size { text-align: right; font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.batch-size .from { color: var(--muted); text-decoration: line-through; font-size: 12px; display: block; }
.batch-size .to { font-weight: 700; font-size: 15px; }
.batch-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--muted);
  transition: border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.icon-btn:hover { border-color: var(--fg); color: var(--fg); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.accent { background: var(--accent); border-color: var(--accent-deep); color: var(--accent-on); }
.icon-btn.accent:hover { background: var(--accent-deep); color: var(--accent-on); }
@media (max-width: 720px) {
  .batch-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .batch-thumb { width: 44px; height: 44px; }
  .batch-size { display: none; }
}

/* progress */
.progress-track { height: 6px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width var(--motion-base) var(--ease); }

/* before / after compare */
.compare {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-sunk);
  aspect-ratio: 16 / 10;
  user-select: none;
  touch-action: none;
}
.compare img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background:
    repeating-conic-gradient(var(--surface-sunk) 0% 25%, var(--surface) 0% 50%) 50% / 22px 22px;
}
.compare .after-img {
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}
.compare .handle {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  cursor: ew-resize; z-index: 3;
}
.compare .handle::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent) center / 18px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7l-5 5 5 5M16 7l5 5-5 5'/%3E%3C/svg%3E");
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25);
  border: 2px solid var(--surface);
}
.compare .cmp-label {
  position: absolute; top: 12px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 6px;
  background: color-mix(in oklch, var(--fg) 78%, transparent); color: var(--surface);
}
.compare .cmp-label.left { left: 12px; }
.compare .cmp-label.right { right: 12px; background: var(--accent); color: var(--accent-on); font-weight: 700; }

/* empty state */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--border); }
.empty-state p { margin: 0; font-size: 14px; }

/* banner / notice */
.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--accent-tint);
  border: 1px solid color-mix(in oklch, var(--accent-deep) 45%, var(--border));
  font-size: 14px;
}
.notice svg { width: 17px; height: 17px; flex: none; color: var(--accent-ink); }
.notice a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* summary strip under tool */
.kpi-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.kpi-strip .kpi { background: var(--surface); padding: 16px 18px; }
.kpi .kpi-num { font-family: var(--font-mono); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .kpi-num.accent { color: var(--accent-ink); }
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 720px) { .kpi-strip { grid-template-columns: 1fr; } }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--fg); color: var(--surface);
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-pop);
  animation: toast-in 220ms var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   AUTH PAGES — split brand panel
   ============================================================ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 920px) { .auth-shell { grid-template-columns: 1fr; } .auth-brand { display: none; } }
.auth-brand {
  background: var(--fg);
  color: var(--surface);
  padding: clamp(32px, 5vw, 64px);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute; right: -90px; bottom: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.92;
}
.auth-brand::before {
  content: "";
  position: absolute; right: 60px; bottom: 130px;
  width: 130px; height: 130px; border-radius: 28px;
  border: 2px solid color-mix(in oklch, var(--accent) 55%, transparent);
  transform: rotate(18deg);
}
.auth-brand .logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; position: relative; z-index: 1; }
.auth-brand .logo .logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-on); display: grid; place-items: center; }
.auth-brand .logo .logo-mark svg { width: 17px; height: 17px; }
.auth-brand .brand-copy { margin-top: auto; position: relative; z-index: 1; padding-bottom: 40px; }
.auth-brand .brand-copy h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; max-width: 14ch; margin-bottom: 14px; }
.auth-brand .brand-copy p { color: color-mix(in oklch, var(--surface) 72%, transparent); font-size: 15px; max-width: 34ch; margin: 0; }
.auth-brand .brand-stats { display: flex; gap: 34px; margin-top: 30px; position: relative; z-index: 1; }
.auth-brand .brand-stats .num { font-size: 26px; font-weight: 700; color: var(--accent); }
.auth-brand .brand-stats .lbl { font-size: 12.5px; color: color-mix(in oklch, var(--surface) 62%, transparent); margin-top: 2px; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 64px) var(--gutter); background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .auth-head { margin-bottom: 26px; }
.auth-card .auth-head h1 { font-size: 30px; margin-bottom: 8px; }
.auth-card .auth-head p { color: var(--muted); margin: 0; font-size: 14.5px; }
.auth-card form { display: flex; flex-direction: column; gap: var(--gap-md); }
.auth-card .form-row { display: flex; gap: 10px; }
.auth-card .form-row .input { flex: 1; min-width: 0; }
.auth-card .form-row .btn { flex: none; white-space: nowrap; }
.auth-submit { width: 100%; padding-block: 13px; font-size: 15.5px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 4px; }
.auth-alt a { color: var(--fg); font-weight: 700; }
.auth-alt a:hover { color: var(--accent-ink); }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; margin-block: 6px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.auth-back:hover { color: var(--fg); }

/* ============================================================
   PRICING / CHECKOUT
   ============================================================ */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-md); align-items: stretch; }
@media (max-width: 920px) { .plan-grid { grid-template-columns: 1fr; } }
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex; flex-direction: column;
  position: relative;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.plan:hover { border-color: var(--muted); transform: translateY(-2px); }
.plan.is-selected { border-color: var(--accent-deep); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 35%, transparent), var(--shadow-card); }
.plan .plan-badge { position: absolute; top: -11px; left: 24px; }
.plan h3 { font-size: 17px; }
.plan .plan-desc { color: var(--muted); font-size: 13.5px; margin: 6px 0 18px; min-height: 40px; }
.plan .price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan .price .amount { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; }
.plan .price .unit { color: var(--muted); font-size: 14px; }
.plan .price-note { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 14.5px; }
.plan ul li { display: flex; gap: 10px; align-items: flex-start; color: var(--fg-2); }
.plan ul li svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--accent-ink); }
.plan ul li.off { color: var(--muted); }
.plan ul li.off svg { color: var(--border); }
.plan .btn { width: 100%; margin-top: auto; }

/* checkout */
.pay-options { display: flex; flex-direction: column; gap: 10px; }
.pay-option {
  display: flex; align-items: center; gap: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.pay-option:hover { border-color: var(--muted); }
.pay-option.is-selected { border-color: var(--accent-deep); background: var(--accent-tint); }
.pay-option input { accent-color: var(--accent-deep); }
.pay-option .pay-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.pay-option .pay-icon svg { width: 19px; height: 19px; }
.pay-option .pay-name { font-weight: 600; font-size: 14.5px; }
.pay-option .pay-note { font-size: 12px; color: var(--muted); }
.pay-option .radio-dot { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex: none; transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease); }
.pay-option.is-selected .radio-dot { border-color: var(--accent-deep); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent-deep); }

.order-summary { position: sticky; top: 84px; }
.order-line { display: flex; justify-content: space-between; font-size: 14.5px; padding-block: 7px; }
.order-line .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 8px; border-top: 1.5px solid var(--fg); }
.order-total .total-label { font-weight: 700; }
.order-total .total-val { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.order-total .total-val .yen { font-size: 18px; margin-right: 2px; }

/* QR pay modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: color-mix(in oklch, var(--fg) 55%, transparent);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in 180ms var(--ease);
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  width: 100%; max-width: 380px;
  padding: 30px 28px;
  text-align: center;
  animation: modal-in 220ms var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 19px; margin-bottom: 6px; }
.modal p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.qr-frame {
  width: 190px; height: 190px; margin: 0 auto 16px;
  border: 2px solid var(--fg); border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface);
  position: relative;
}
.qr-frame svg { width: 160px; height: 160px; }
.qr-frame .scanline {
  position: absolute; left: 8px; right: 8px; height: 3px;
  background: var(--accent-deep); border-radius: 2px;
  animation: scan 2.2s var(--ease) infinite;
}
@keyframes scan { 0%, 100% { top: 12px; } 50% { top: calc(100% - 15px); } }
.modal .close-row { display: flex; gap: 10px; margin-top: 4px; }
.modal .close-row .btn { flex: 1; }

/* success check */
.success-mark {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--success-tint);
  display: grid; place-items: center; color: var(--success);
}
.success-mark svg { width: 30px; height: 30px; }

/* ---------- landing extras ---------- */
.hero-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hero-visual .hv-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.hero-visual .hv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.hero-visual .hv-url {
  margin-left: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  background: var(--surface-sunk); padding: 4px 12px; border-radius: 999px;
}
.hero-visual .hv-body { padding: 20px; }

.compare-mini {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.compare-mini .cm-side { text-align: center; }
.compare-mini .cm-num { font-family: var(--font-mono); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-mini .cm-num.before { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.compare-mini .cm-num.after { color: var(--fg); }
.compare-mini .cm-num.after b { color: var(--accent-ink); }
.compare-mini .cm-cap { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.compare-mini .cm-arrow { color: var(--accent-ink); font-size: 20px; }

.quota-meter { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.quota-meter .progress-track { width: 110px; }

/* reveal on scroll — one decisive flourish */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
