:root {
  color-scheme: light;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --paper: #f3efe8;
  --card: #fff;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --shadow: 0 16px 40px rgba(68, 48, 28, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 320px at 50% -40px, #fff 0%, transparent 70%),
    var(--paper);
}
header, main, footer { width: min(820px, calc(100% - 32px)); margin: 0 auto; }
header { padding: 28px 0 4px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; color: inherit; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 0.85rem;
}
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav a[aria-current="page"], .nav a:hover { background: #fff; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -0.03em; margin: 14px 0 8px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 40rem; margin: 0; }
.note { color: var(--muted); }
.howto { margin: 22px 0 0; }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 14px 16px;
  color: var(--muted);
  font-size: 0.92rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 22px; height: 22px; margin-bottom: 8px;
  border-radius: 99px;
  background: #fff7ed; color: var(--accent-dark);
  font-size: 0.78rem; font-weight: 700;
}
form, .panel, #preview, .rules {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
#drop {
  border: 1.5px dashed #d6d3d1;
  border-radius: 16px;
  padding: 32px 16px 22px;
  text-align: center;
  background: #fafaf9;
}
#drop.over, #drop.has-file { border-color: var(--accent); background: #fff7ed; }
.drop-title { margin: 0; font-weight: 650; }
.file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #d6d3d1;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
.file-btn input {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-name { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; }
#drop.has-file .file-name { color: var(--ink); font-weight: 650; }
.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px 6px 12px;
}
.file-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list button {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
}
.file-list button:hover { background: #f5f5f4; color: var(--ink); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; }
label.field { display: grid; gap: 6px; font-size: 0.84rem; color: var(--muted); }
select, button, .btn { font: inherit; min-height: 44px; }
select {
  min-width: 132px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
button, .btn {
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary { background: #292524; }
button.secondary:hover { background: #1c1917; }
button:focus-visible, .btn:focus-visible, select:focus-visible, .nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bar {
  height: 8px;
  background: #f5f0e8;
  border-radius: 99px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ea580c, var(--accent));
  transition: width 0.15s ease;
}
.step { margin: 0 0 14px; }
.step p { margin: 0 0 6px; font-size: 0.92rem; }
#error {
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 10px 12px;
}
#error[hidden] { display: none; }
#sheets { display: grid; gap: 16px; }
figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.06);
}
figure img { display: block; width: 100%; height: auto; }
figcaption { padding: 8px 12px; color: var(--muted); font-size: 0.88rem; }
iframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rules { box-shadow: none; background: transparent; }
.rules h3 { font-size: 1rem; margin: 18px 0 4px; }
.rules p { margin: 0 0 8px; }
.rules a, footer a { color: var(--accent-dark); }
footer { padding: 4px 0 40px; color: var(--muted); font-size: 0.88rem; }
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .actions, .actions button, .actions .btn { width: 100%; }
}
