:root {
  --ink: #f7f9fc;
  --muted: #96a3b8;
  --panel: #111b2c;
  --panel-soft: #162237;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ffb21a;
  --accent-strong: #ffc74f;
  --accent-ink: #241704;
  --danger: #ff6b6b;
  --success: #52d6a0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(50, 98, 151, 0.2), transparent 36rem),
    radial-gradient(circle at 95% 10%, rgba(255, 178, 26, 0.08), transparent 28rem),
    #08101d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 29, 0.88);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark, .login-symbol {
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 900;
  transform: skew(-8deg);
  box-shadow: 8px 8px 24px rgba(255, 178, 26, 0.12);
}
.brand-mark { width: 34px; height: 40px; border-radius: 7px 3px 7px 3px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 0.95rem; letter-spacing: 0.01em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 0.69rem; letter-spacing: 0.16em; }
.header-controls { display: flex; align-items: center; gap: 9px; }
.header-controls form { margin: 0; }
.language-toggle {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 38px;
  border: 1px solid rgba(255, 178, 26, 0.34);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--accent);
  background: rgba(255, 178, 26, 0.07);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  transition: background 150ms ease, border-color 150ms ease;
}
.language-toggle:hover { border-color: var(--accent); background: rgba(255, 178, 26, 0.14); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.045em; }
h2 { letter-spacing: -0.025em; }
.muted { color: var(--muted); }
.eyebrow {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.primary-button, .ghost-button, .nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.primary-button {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 800;
}
.primary-button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.primary-button:disabled, .nav-button:disabled { cursor: not-allowed; opacity: 0.35; transform: none; }
.ghost-button, .nav-button {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.ghost-button:hover, .nav-button:hover { border-color: rgba(255, 178, 26, 0.42); background: rgba(255, 178, 26, 0.08); }
.compact { min-height: 38px; padding: 0 14px; font-size: 0.82rem; }
.inline-button { margin-top: 12px; }

.library-shell { width: min(1160px, calc(100% - 36px)); margin: 0 auto; padding: clamp(42px, 7vw, 84px) 0 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 36px; }
.page-heading .muted { margin-bottom: 0; }
.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: max-content;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
}
.stat-pill strong { color: var(--accent); font-size: 1.45rem; }
.stat-pill span { color: var(--muted); font-size: 0.8rem; }

.recording-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.recording-card {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 32px;
  align-items: center;
  min-height: 166px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(22, 34, 55, 0.96), rgba(13, 23, 39, 0.94));
  box-shadow: 0 10px 35px rgba(0,0,0,0.13);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.recording-card:hover { transform: translateY(-3px); border-color: rgba(255, 178, 26, 0.42); box-shadow: var(--shadow); }
.card-visual {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  background:
    linear-gradient(145deg, rgba(255,178,26,0.16), rgba(27,52,82,0.3)),
    repeating-linear-gradient(125deg, transparent 0 20px, rgba(255,255,255,0.025) 20px 21px);
}
.play-disc {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding-left: 3px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(8,16,29,0.72);
  font-size: 0.9rem;
}
.duration { position: absolute; right: 9px; bottom: 9px; padding: 4px 7px; border-radius: 6px; background: rgba(0,0,0,0.65); font-size: 0.7rem; }
.card-body { min-width: 0; padding: 22px; }
.card-body h2 { overflow: hidden; margin-bottom: 19px; font-size: 1.18rem; text-overflow: ellipsis; white-space: nowrap; }
.recorded-at { margin-bottom: 8px; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.card-meta { display: flex; gap: 18px; color: var(--muted); font-size: 0.78rem; }
.card-meta b { color: var(--ink); font-size: 0.92rem; }
.card-arrow { color: var(--accent); font-size: 1.4rem; transition: transform 180ms ease; }
.recording-card:hover .card-arrow { transform: translateX(4px); }

.empty-state, .empty-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 390px;
  padding: 40px;
  border: 1px dashed rgba(255,255,255,0.13);
  border-radius: 20px;
  text-align: center;
  background: rgba(255,255,255,0.018);
}
.empty-state p { color: var(--muted); }
.empty-icon { margin-bottom: 20px; color: var(--accent); font-size: 3rem; }
.empty-page { width: min(720px, calc(100% - 36px)); margin: 64px auto; }

.login-shell { display: grid; place-items: center; min-height: calc(100vh - 72px); padding: 30px 18px; }
.login-card {
  width: min(440px, 100%);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(22,34,55,0.98), rgba(12,21,36,0.98));
  box-shadow: var(--shadow);
}
.login-symbol { width: 54px; height: 62px; margin-bottom: 28px; border-radius: 11px 5px 11px 5px; font-size: 1.45rem; }
.login-card h1 { font-size: 2rem; }
.login-card .muted { line-height: 1.7; }
.login-form { display: grid; gap: 11px; margin-top: 28px; }
.login-form label, .comment-label { color: #cbd3e0; font-size: 0.8rem; font-weight: 700; }
.login-form input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: rgba(5, 11, 20, 0.62);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.login-form input { height: 48px; padding: 0 14px; }
.login-form input:focus, textarea:focus { border-color: rgba(255,178,26,0.72); box-shadow: 0 0 0 3px rgba(255,178,26,0.1); }
.login-form .primary-button { margin-top: 8px; }
.error-banner { margin: 18px 0; padding: 11px 13px; border: 1px solid rgba(255,107,107,0.32); border-radius: 9px; color: #ffc3c3; background: rgba(255,107,107,0.09); font-size: 0.84rem; }

.review-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0 64px;
  gap: 24px;
}
.video-column { min-width: 0; }
.video-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.video-heading > div { min-width: 0; }
.video-heading h1 { overflow: hidden; max-width: 800px; margin: 0; font-size: clamp(1.7rem, 3.5vw, 2.7rem); text-overflow: ellipsis; white-space: nowrap; }
.touch-counter { flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.78rem; }
.video-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 17px;
  background: #020407;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}
.video-stage video { display: block; width: 100%; height: 100%; background: #000; object-fit: contain; }
.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  opacity: 0;
  background: rgba(8,16,29,0.82);
  font-size: 1.8rem;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}
.swipe-hint.show { animation: swipe-flash 420ms ease; }
@keyframes swipe-flash { 35% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.transport-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17,27,44,0.76);
}
.touch-nav, .play-options, .segmented { display: flex; align-items: center; gap: 8px; }
.nav-button { min-width: 104px; }
.replay-button { min-width: 126px; }
.play-options { color: var(--muted); font-size: 0.74rem; }
.segmented { padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,0.16); }
.segmented button {
  height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
}
.segmented button.active { color: var(--accent-ink); background: var(--accent); font-weight: 800; }
.switch-label { display: flex; align-items: center; gap: 7px; cursor: pointer; color: #c6cfdd; white-space: nowrap; }
.switch-label input { position: absolute; opacity: 0; }
.switch { position: relative; width: 34px; height: 19px; border-radius: 99px; background: #334056; transition: background 150ms ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; transition: transform 150ms ease; }
.switch-label input:checked + .switch { background: var(--accent); }
.switch-label input:checked + .switch::after { transform: translateX(15px); }

.timeline-section { margin-top: 27px; }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title-row h2 { margin: 0; font-size: 1rem; }
.section-title-row small { color: var(--muted); }
.touch-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 13px;
  scroll-snap-type: x proximity;
  scrollbar-color: #36435a transparent;
}
.touch-card {
  flex: 0 0 154px;
  min-height: 100px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  scroll-snap-align: center;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.touch-card:hover { transform: translateY(-2px); border-color: rgba(255,178,26,0.35); }
.touch-card.active { border-color: var(--accent); background: rgba(255,178,26,0.1); box-shadow: inset 0 0 0 1px rgba(255,178,26,0.12); }
.touch-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.touch-number { color: var(--accent); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; }
.touch-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.69rem; }
.touch-card-timing { display: flex; align-items: center; gap: 5px; }
.touch-comment-badge { width: 0; overflow: hidden; color: var(--success); font-size: 0.58rem; white-space: nowrap; transition: width 150ms ease; }
.touch-comment-badge.visible { width: auto; }
.touch-label { display: block; overflow: hidden; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.touch-score { display: block; margin-top: 7px; color: var(--muted); font-size: 0.72rem; }
.touch-empty { width: 100%; padding: 28px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }

.comment-panel {
  position: sticky;
  top: 94px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(17, 27, 44, 0.93);
  box-shadow: 0 15px 45px rgba(0,0,0,0.18);
}
.comment-heading { display: flex; align-items: center; justify-content: space-between; }
.comment-heading h2 { margin: 0; font-size: 1.35rem; }
.time-chip { padding: 6px 9px; border-radius: 7px; color: var(--accent); background: rgba(255,178,26,0.1); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0 18px; }
.quick-tags button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  cursor: pointer;
  color: #c4cedd;
  background: rgba(255,255,255,0.025);
  font-size: 0.72rem;
}
.quick-tags button:hover, .quick-tags button.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.comment-label { display: block; margin-bottom: 8px; }
textarea { display: block; resize: vertical; min-height: 104px; padding: 12px; line-height: 1.55; }
.comment-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.comment-actions small { color: var(--muted); font-size: 0.66rem; }
kbd { padding: 2px 4px; border: 1px solid var(--line); border-bottom-color: rgba(255,255,255,0.2); border-radius: 4px; color: #cbd4e2; background: rgba(0,0,0,0.2); font-family: inherit; }
.status-message { min-height: 21px; margin-top: 7px; color: var(--success); font-size: 0.75rem; }
.status-message.error { color: var(--danger); }
.comments-title { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.comments-title h3 { margin: 0; font-size: 0.9rem; }
.comments-title span { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,0.05); font-size: 0.7rem; }
.comment-list { display: grid; gap: 9px; margin-top: 12px; }
.comment-item {
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  background: rgba(7,14,25,0.5);
  text-align: left;
}
.comment-item:hover { border-color: rgba(255,178,26,0.3); }
.comment-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--muted); font-size: 0.67rem; }
.comment-tag { padding: 2px 6px; border-radius: 99px; color: var(--accent); background: rgba(255,178,26,0.1); }
.comment-body { margin: 0; color: #d9e0ea; font-size: 0.8rem; line-height: 1.55; white-space: pre-wrap; }
.no-comments { padding: 22px 8px; color: var(--muted); font-size: 0.78rem; text-align: center; }

@media (max-width: 1120px) {
  .review-shell { grid-template-columns: 1fr; }
  .comment-panel { position: static; max-height: none; }
  .transport-panel { flex-wrap: wrap; }
  .play-options { width: 100%; justify-content: flex-end; }
}

@media (max-width: 820px) {
  .recording-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
}

@media (max-width: 620px) {
  .site-header { height: 62px; padding: 0 16px; }
  .brand-mark { width: 30px; height: 35px; }
  .brand b { font-size: 0.82rem; }
  .brand small { font-size: 0.59rem; }
  .header-controls { gap: 6px; }
  .language-toggle { min-width: 39px; min-height: 36px; padding: 0 8px; }
  .library-shell, .review-shell { width: min(100% - 24px, 1160px); }
  .library-shell { padding-top: 34px; }
  .page-heading { display: block; }
  .stat-pill { display: inline-flex; margin-top: 20px; }
  .recording-card { grid-template-columns: 100px minmax(0, 1fr) 24px; min-height: 132px; }
  .card-body { padding: 16px; }
  .card-body h2 { margin-bottom: 14px; font-size: 1rem; }
  .card-meta { flex-direction: column; gap: 4px; }
  .review-shell { padding-top: 22px; }
  .video-heading { flex-direction: column; align-items: flex-start; gap: 9px; }
  .video-heading h1 { font-size: 1.55rem; }
  .touch-counter { max-width: 100%; padding: 6px 9px; font-size: 0.67rem; }
  .video-stage { width: calc(100% + 24px); margin-left: -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .transport-panel { margin-right: -3px; margin-left: -3px; padding: 9px; }
  .touch-nav { width: 100%; display: grid; grid-template-columns: 1fr 1.2fr 1fr; }
  .nav-button, .replay-button { min-width: 0; padding: 0 8px; font-size: 0.75rem; }
  .play-options { justify-content: space-between; gap: 5px; }
  .play-options > span { display: none; }
  .segmented { gap: 2px; }
  .segmented button { padding: 0 7px; }
  .comment-panel { padding: 18px; }
  .comment-actions { align-items: flex-end; }
  .comment-actions small { max-width: 135px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
