:root {
  --bg: #f6f1e8;
  --ink: #1a1714;
  --muted: #6f675e;
  --line: #e4ddd2;
  --panel: #fffcf7;
  --seal: #b42318;
  --teal: #1f4e45;
  --ok-bg: #e8f2ef;
  --warn-bg: #f8ebe8;
  --radius: 10px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Fraunces", "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.55 var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--seal); }

.shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3.5rem;
}
.shell.wide { width: min(1440px, calc(100% - 2rem)); }
.shell.narrow { width: min(720px, calc(100% - 2rem)); padding-top: 2rem; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0 1.2rem;
}
.logo {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.logo b { color: var(--seal); font-weight: 650; }
.nav { display: flex; gap: 1rem; font-size: 0.95rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.on { color: var(--ink); }

.hero { padding: 1.5rem 0 0.5rem; }
.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.lead {
  margin: 0.7rem 0 1.4rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40em;
}

.search {
  display: flex;
  gap: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search:focus-within {
  border-color: #c9b9a4;
  box-shadow: 0 8px 28px rgba(26, 23, 20, 0.06);
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0.85rem 0.9rem;
  font: inherit;
  min-width: 0;
}
.hint { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.86rem; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn.primary:hover { background: #961c13; color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--teal); padding-left: 0; padding-right: 0; }
.btn.danger { border-color: var(--seal); color: var(--seal); background: transparent; }
.btn.sm { padding: 0.55rem 0.85rem; font-size: 0.92rem; }
.btn.is-hidden { display: none !important; }

.cta-row { display: flex; gap: 0.65rem; margin: 1rem 0 0; flex-wrap: wrap; }
.cta-row .btn { flex: 1; min-width: 140px; text-align: center; }

.section { margin-top: 2.2rem; }
.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.list strong { font-weight: 600; }
.muted { color: var(--muted); }
.err { color: var(--seal); }
.ok { color: var(--teal); }

.results { margin-top: 1.25rem; }
.result {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  animation: in 0.28s ease both;
}
@keyframes in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.result .tag {
  display: inline-block;
  color: var(--seal);
  border: 1.5px solid var(--seal);
  font-family: var(--display);
  font-size: 0.78rem;
  padding: 0.1rem 0.4rem;
  margin-bottom: 0.35rem;
}
.result h3 { margin: 0.2rem 0 0.35rem; font-size: 1.15rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.tags span {
  font-size: 0.8rem;
  background: #efe9df;
  color: var(--ink);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  margin: 0.2rem 0 0.4rem;
}
.page-desc { margin: 0 0 1.25rem; color: var(--muted); }

.form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.25rem;
}
.block { margin: 0 0 1.35rem; }
.block:last-child { margin-bottom: 0; }
.block-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.field { margin: 0 0 0.75rem; }
.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  transition: border-color 0.15s ease;
}
.field textarea {
  resize: vertical;
  min-height: 6.5rem;
  min-width: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0;
  border-color: #b9a890;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
}
.chip.on {
  border-color: var(--ink);
  color: var(--ink);
  background: #efe9df;
}

.status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 8px;
  background: var(--warn-bg);
  margin-top: 0.5rem;
}
.status.ok { background: var(--ok-bg); }
.status .txt strong { display: block; margin-bottom: 0.15rem; }
.status .txt span { color: var(--muted); font-size: 0.86rem; }

.file-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 7.5rem;
  border: 1.5px dashed #cfc5b6;
  border-radius: 10px;
  padding: 1.1rem 1rem;
  text-align: center;
  color: var(--muted);
  background: #faf8f4;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-box:hover,
.file-box:focus-within {
  border-color: #9a8f7e;
  background: #fff;
}
.file-box__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}
.file-box__ui {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  z-index: 1;
}
.file-box__ui strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
}
.file-box__hint {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}
.preview { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.submit-bar { margin-top: 1rem; }
.msg { margin: 0.75rem 0 0; font-size: 0.95rem; min-height: 1.4em; }

.footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin: 1rem 0;
}
.panel h2 { font-size: 1.05rem; margin: 1rem 0 0.35rem; }
.panel h2:first-child { margin-top: 0; }
.panel p { margin: 0 0 0.4rem; color: var(--muted); }
.bind-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow: visible;
}
.bind-box > * { position: static; margin: 0; }
.bind-box .hint { margin: 0; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.row { display: flex; align-items: center; }
.gap { gap: 0.75rem; }
.wrap { flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 1.25rem; }
.tabs a {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}
.tabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.story {
  white-space: pre-wrap;
  background: #f3eee6;
  padding: 0.8rem;
  border-radius: 8px;
  border-left: 3px solid var(--seal);
}
.thumbs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0; }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.admin-actions { margin-top: 0.9rem; }
.case-head { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.pill.lock { border-color: var(--teal); color: var(--teal); }
.case { margin-bottom: 1rem; }
.watch-votes { margin-top: 0.4rem; }
.watch-bar {
  height: 8px;
  border-radius: 999px;
  background: #ebe4d8;
  overflow: hidden;
  margin: 0.55rem 0 0.7rem;
}
.watch-bar i {
  display: block;
  height: 100%;
  background: var(--seal);
  border-radius: 999px;
}
.watch-detail { margin-bottom: 1.5rem; }
.watch-stages {
  list-style: none;
  margin: 0.6rem 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}
.watch-stage {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  position: relative;
}
.watch-stage .dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 auto 0.35rem;
  background: #d8d0c4;
}
.watch-stage.done .dot { background: var(--teal); }
.watch-stage.active .dot {
  background: var(--seal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--seal) 25%, transparent);
  animation: watch-breathe 1.6s ease-in-out infinite;
}
.watch-stage.active .lab { color: var(--ink); font-weight: 600; }
.watch-stage.done .lab { color: var(--ink); }
.watch-seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.seat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
}
.seat b { font-size: 0.9rem; color: var(--ink); }
.seat.waiting { animation: watch-breathe 2s ease-in-out infinite; }
.seat.mystery {
  border-color: #b7a48a;
  background: linear-gradient(160deg, #f7f1e6, #efe6d7);
}
.seat.convict { border-color: #c45c4a; background: #fceceb; }
.seat.acquit { border-color: var(--teal); background: #e8f4f1; }
.seat.novote { opacity: 0.65; }
.watch-waiting {
  border: 1px dashed #cfc5b6;
  border-radius: 10px;
  padding: 0.9rem;
  margin: 0.6rem 0;
  background: #faf8f4;
}
.watch-pulse {
  height: 6px;
  border-radius: 999px;
  margin-top: 0.7rem;
  background: linear-gradient(90deg, #ebe4d8, var(--seal), #ebe4d8);
  background-size: 200% 100%;
  animation: watch-slide 1.8s linear infinite;
}
.watch-live { color: var(--ink); }
.pill.live {
  border-color: var(--seal);
  color: var(--seal);
  animation: watch-breathe 1.4s ease-in-out infinite;
}
.watch-timeline {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.watch-timeline li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #f6f2ea;
}
.tl-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tl-time { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
@keyframes watch-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}
@keyframes watch-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@media (max-width: 640px) {
  .watch-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-stage:nth-child(n+4) { margin-top: 0.35rem; }
}
.brand { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 0; }
.brand span { color: var(--seal); font-size: 0.45em; margin-left: 0.35rem; }
.tagline { color: var(--muted); margin: 0.5rem 0 1rem; }
.lock-bar { display: none; }
.site-nav { display: flex; gap: 1rem; margin-bottom: 1rem; }
.site-nav a { color: var(--muted); }

.empty {
  padding: 1.2rem 0;
  color: var(--muted);
  text-align: center;
}

/* 登录 / 注册：铺满页面，不缩成中间小卡片 */
body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(180, 35, 24, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(31, 78, 69, 0.06), transparent 45%),
    var(--bg);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  max-width: 36rem;
}
.auth-tabs .btn {
  width: 100%;
}
.auth-panel {
  max-width: 36rem;
}
.auth-foot {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .search { flex-direction: column; }
  .search .btn { width: 100%; }
  .status { flex-direction: column; }
  .nav { flex-wrap: wrap; gap: 0.65rem; }
}
