/* The Floor (现场) — black on white, hairlines, one muted red. Phone first. */

:root {
  --ink: #111111;
  --paper: #ffffff;
  --mute: #6f6f6f;
  --line: #e4e4e4;
  --tint: #f5f5f4;
  --scrim: rgba(255, 255, 255, 0.72);
  --accent: #a23b2a;
  --gutter: 16px;
  --tabbar: 64px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
          "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
body.sheet-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }

/* ---------- Header, tabs, + Post ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.mark { font-weight: 500; }
.mark .zh { font-weight: 300; margin-left: 6px; }

/* Phone: tabs live in a bar fixed to the bottom. */
nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
nav:empty { display: none; }
nav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mute);
}
nav a { border-top: 2px solid transparent; }
nav a.on { color: var(--ink); border-top-color: var(--ink); }

.post-btn {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.post-btn:hover { background: var(--accent); }

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
}
.foot { padding: 20px var(--gutter); border-top: 1px solid var(--line); }

/* ---------- Type ---------- */

h1 {
  font-weight: 300;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
h2 {
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.label.accent, .label.example, .accent { color: var(--accent); }
.verified { color: var(--accent); }
.verified::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }

.sub { color: var(--mute); margin: 0; font-size: 16px; }
.lede { font-size: 19px; font-weight: 300; line-height: 1.45; max-width: 32em; margin: 0 0 28px; }
.hint { font-size: 14px; color: var(--mute); margin: 8px 0 0; }
.meta { color: var(--mute); margin: 6px 0 0; }
.meta a, .names a, .hint a { color: var(--ink); border-bottom: 1px solid var(--line); }
.body-text { white-space: pre-wrap; margin: 20px 0 0; }
.done { font-size: 17px; margin: 0; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.back { display: inline-block; color: var(--mute); margin-bottom: 20px; padding: 8px 0; }

/* ---------- Buttons + inputs ---------- */

button, .btn {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 48px;
  padding: 0 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button.primary, .btn.primary { background: var(--ink); color: var(--paper); }
button.primary:hover, .btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
button:disabled, button:disabled:hover { background: var(--paper); color: var(--mute); border-color: var(--line); cursor: default; }
.wide { width: 100%; min-height: 56px; font-size: 17px; }
button.quiet { border: 0; padding: 0; min-height: 44px; color: var(--mute); background: none; }
button.quiet:hover { color: var(--accent); }

input, textarea, select {
  font: inherit;
  font-size: 17px;  /* 16px+ stops phones zooming in */
  color: var(--ink);
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  min-height: 48px;
  appearance: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--ink); }
input[type=date] { min-width: 0; }

.form { max-width: 560px; }
.stack { display: grid; gap: 20px; }
.field { display: grid; gap: 2px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row-form > input, .row-form > .field { flex: 1 1 140px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.code-input { font-size: 28px; font-weight: 300; letter-spacing: 0.12em; text-transform: uppercase; }

.more summary { cursor: pointer; color: var(--mute); padding: 12px 0; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+ "; }
.more[open] summary::before { content: "– "; }

.file-pick {
  display: grid;
  gap: 4px;
  place-items: center;
  text-align: center;
  padding: 36px 16px;
  border: 1px dashed var(--mute);
  cursor: pointer;
  font-size: 17px;
}
.file-pick:hover { border-color: var(--ink); }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- Chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 20px calc(-1 * var(--gutter)) 8px;
  padding: 0 var(--gutter) 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 4px 0 0; padding: 0; }
.chip {
  flex: none;
  font-size: 15px;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Cards (one line + price/points) ---------- */

.cards { border-bottom: 1px solid var(--line); }
.card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.card:hover .card-text { color: var(--accent); }
.card-text { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-num { flex: none; font-size: 17px; font-variant-numeric: tabular-nums; }
.card .label { flex: none; }

.person { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.person-main { flex: 1; min-width: 0; }
.person .card-text { display: block; }
.contact { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--accent); display: grid; gap: 2px; font-size: 16px; }

.empty { padding: 48px 0; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty p { margin: 0 0 20px; font-size: 17px; }

/* ---------- Work tiles ---------- */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
.tile { display: block; }
.tile:hover .card-text { color: var(--accent); }
.tile-media { position: relative; }
.tile-line { display: flex; gap: 8px; align-items: baseline; padding-top: 10px; }
.tile-line .card-text, .tile-line .card-num { font-size: 15px; }
.tile-line .card-num { color: var(--mute); }
.rank { position: absolute; left: 0; top: 0; background: var(--paper); padding: 2px 10px; font-size: 20px; font-weight: 300; }
.corner { position: absolute; right: 0; top: 0; background: var(--paper); padding: 2px 8px; }

.media { aspect-ratio: 1; background: var(--tint); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.placeholder { background: var(--paper); border: 1px solid var(--line); }
.media.audio { aspect-ratio: auto; padding: 32px 16px; background: var(--paper); border: 1px solid var(--line); }
.media.audio audio { width: 100%; }

.show { margin: 24px 0 8px; }
.show h2 { margin-top: 0; }
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 12px;
  overflow-x: auto;
  margin: 16px calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter) 8px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip .tile { scroll-snap-align: start; }

/* ---------- Pages ---------- */

.page-head { margin-bottom: 8px; }
.page-head .btn { margin-top: 16px; }
.section h2 { margin-top: 40px; }
.links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.links a { border-bottom: 1px solid var(--line); }
.names { font-size: 17px; margin: 0; }
.points-line { margin: 24px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.points-line .hint { display: block; margin-top: 4px; }
.stat { display: flex; gap: 16px; align-items: center; margin: 0; }
.big { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.footer-links { display: flex; gap: 24px; align-items: center; margin-top: 56px; }
.report { margin-top: 40px; }

.hero { padding-top: 6vh; max-width: 560px; }
.hero h1 { font-size: clamp(56px, 16vw, 120px); margin-bottom: 24px; }
.hero h1 .zh { display: block; }

/* ---------- Sheet: full screen on phones ---------- */

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }
.sheet-panel {
  position: absolute;
  inset: 0;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
}
.sheet-close { display: inline-flex; align-items: center; min-height: 52px; font-size: 16px; }
.sheet-close:hover { color: var(--accent); }
.sheet-body { padding: 20px var(--gutter) 0; }
/* Keep the main button in view: cap the picture, and keep file-less pieces short. */
.sheet-body > .media { margin: 0 calc(-1 * var(--gutter)) 20px; aspect-ratio: 4 / 3; max-height: 42vh; }
.sheet-body > .media.placeholder { aspect-ratio: 3 / 1; }
.sheet-body > .media.audio { aspect-ratio: auto; }
.sheet-title { font-size: clamp(30px, 7vw, 40px); }
.price { font-size: 32px; font-weight: 300; margin: 4px 0 0; letter-spacing: -0.01em; }
.main-action { margin-top: 28px; display: grid; gap: 4px; }

.choices { display: grid; gap: 12px; margin-top: 24px; }
.choice { display: grid; gap: 4px; padding: 24px 20px; border: 1px solid var(--line); }
.choice:hover { border-color: var(--ink); }
.choice-title { font-size: 22px; font-weight: 300; }

/* ---------- Preview mode (localhost only) ---------- */

.preview-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--accent);
}
.preview-who { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.filter { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--mute); padding: 4px 0; }
.filter.on { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* ---------- Flash ---------- */

#flash {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  padding: 14px var(--gutter);
  font-size: 15px;
  transform: translateY(calc(100% + var(--tabbar) + 40px));
  transition: transform 0.2s ease;
}
#flash.on { transform: translateY(0); }

/* ---------- Desktop ---------- */

@media (min-width: 760px) {
  :root { --gutter: 40px; }
  body { padding-bottom: 0; }

  .top { padding-top: 18px; padding-bottom: 18px; }
  nav {
    position: static;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    gap: 36px;
    margin-left: auto;
  }
  nav a { flex: none; min-height: 40px; }
  nav a { border-top: 0; border-bottom: 1px solid transparent; }
  nav a.on { border-bottom-color: var(--ink); }

  main { padding-top: 56px; padding-bottom: 120px; }
  h2 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 24px; }
  .strip { grid-auto-columns: 200px; }
  .chips { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
  .choices { grid-template-columns: 1fr 1fr; }
  #flash { bottom: 0; }

  /* Side panel on the right; the page stays visible behind a light scrim. */
  .sheet-panel {
    left: auto;
    width: min(520px, 100%);
    border-left: 1px solid var(--ink);
  }
  .sheet-body { padding-top: 28px; }
}

@media (max-width: 759px) {
  /* + Post floats above the tab bar so it's always one thumb away. */
  .post-btn {
    position: fixed;
    right: var(--gutter);
    bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
    z-index: 11;
    min-height: 52px;
    padding: 0 22px;
    font-size: 15px;
  }
  main { padding-bottom: 120px; }
  .foot { padding-bottom: 88px; }  /* clear the floating + Post */
}
