:root {
  --bg: #0c0c0b;
  --surface: #151513;
  --raised: #1d1c1a;
  --line: #ffffff14;
  --text: #eeeae3;
  --muted: #8e897f;
  --faint: #5e5a53;
  --gold: #e3b97a;
  --red: #e5584d;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans:
    -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.7 var(--sans);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand {
  font-family: var(--serif);
  font-weight: 400;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 9px 20px;
}
button:hover {
  border-color: var(--muted);
  background: var(--raised);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select {
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  min-width: 0;
}
input::placeholder {
  color: var(--faint);
}
.primary {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.primary:hover {
  background: #d7d1c7;
}
.muted,
small {
  color: var(--muted);
}
.danger,
.error {
  color: var(--red);
}
.success {
  color: #3f8f5a;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 15px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 24px;
}
.wrap {
  max-width: 1440px;
  margin: auto;
  padding: 0 64px;
}
.hero {
  height: 760px;
  min-height: 660px;
  position: relative;
  background:
    linear-gradient(0deg, var(--bg), transparent 50%),
    linear-gradient(90deg, #0004, #0002),
    url("/static/img/hero.jpg") center/cover;
}
.nav {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav nav {
  display: flex;
  align-items: center;
  gap: 40px;
  color: #b0aaa1;
  font-size: 13px;
}
.hero-copy {
  padding-top: 140px;
  max-width: 610px;
}
.live-dot:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}
.hero h1 {
  font-size: 94px;
  line-height: 1.1;
  letter-spacing: -4px;
  margin: 36px 0 26px;
}
.hero-copy p {
  font-size: 16px;
  color: #aaa49b;
  line-height: 1.9;
}
.actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 34px;
}
.now-card {
  position: absolute;
  bottom: 80px;
  right: max(64px, calc((100% - 1312px) / 2));
  width: 340px;
  background: #151513a8;
  backdrop-filter: blur(12px);
  border: 1px solid #ffffff1a;
  border-radius: 20px;
  padding: 24px;
  text-align: left;
}
.now-card h3 {
  font-size: 26px;
  margin: 8px 0;
}
.now-card .eyebrow {
  display: flex;
  justify-content: space-between;
  letter-spacing: 2px;
}
.progress {
  height: 2px;
  background: var(--line);
  margin: 8px 0;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
}
.channels {
  padding-top: 85px;
  padding-bottom: 100px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.section-head h2,
.how h2 {
  font-size: 40px;
  line-height: 1.3;
}
.section-head h2 small {
  font: 14px var(--sans);
  margin-left: 12px;
}
.search {
  width: 380px;
  border-radius: 30px;
  padding-left: 22px;
}
.tabs {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  margin: 36px 0;
}
.tabs button {
  border: 0;
  border-radius: 0;
  padding: 8px 0 15px;
  color: var(--muted);
}
.tabs button.active {
  color: var(--text);
  border-bottom: 2px solid var(--text);
}
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 36px 20px;
}
.channel {
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: none !important;
  min-width: 0;
}
.tile {
  height: 126px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}
.tile img {
  width: 100%;
  height: 100%;
  padding: 24px;
  object-fit: contain;
}
.player-channel {
  display: flex;
  align-items: center;
  gap: 12px;
}
#player-logo {
  width: 88px;
  height: 48px;
  object-fit: contain;
  padding: 4px;
}
.tile strong {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.tile small {
  font-size: 11px;
}
.channel:hover .tile {
  border-color: #e3b97a66;
  background: var(--raised);
}
.channel:hover .tile:after {
  content: "▶";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #1d1c1a;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--text);
}
.channel p {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel .program {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.channel .progress {
  margin-top: 5px;
}
.center {
  text-align: center;
  margin-top: 48px;
}
.empty {
  padding: 48px 0;
  color: var(--muted);
  grid-column: 1/-1;
}
.how {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 80px;
  padding-top: 95px;
  padding-bottom: 120px;
}
.how p {
  color: var(--muted);
  margin-top: 22px;
}
.steps article {
  display: flex;
  border-top: 1px solid var(--line);
  padding: 30px 0;
  gap: 32px;
}
.steps article:last-child {
  border-bottom: 1px solid var(--line);
}
.steps b {
  font: 30px var(--serif);
  color: var(--gold);
}
.steps h3 {
  font: 18px var(--sans);
}
.steps p {
  margin-top: 10px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 35px 0;
  color: var(--muted);
  font-size: 12px;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
}
.status-dot:before {
  content: "●";
  color: #62b17b;
  margin-right: 8px;
}
.stale:before {
  color: var(--red);
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid #ffffff20;
  border-radius: 24px;
  padding: 0;
  width: 840px;
  max-width: calc(100% - 32px);
  max-height: 92vh;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(10px);
}
.close {
  position: absolute;
  right: 18px;
  top: 18px;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #222b;
  font-size: 23px;
  z-index: 2;
}
.player-video {
  position: relative;
  background: #000;
  aspect-ratio: 16/9;
}
.player-video video {
  width: 100%;
  height: 100%;
  display: block;
}
.player-live {
  position: absolute;
  left: 22px;
  top: 16px;
  font-size: 10px;
  letter-spacing: 2px;
  background: #0007;
  padding: 3px 10px;
  border-radius: 12px;
  pointer-events: none;
}
.player-info {
  padding: 28px 32px;
}
.player-info h2 {
  font-size: 30px;
  margin: 8px 0;
}
.player-info .details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.player-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
  color: var(--muted);
}
#contact-dialog {
  width: 380px;
  text-align: center;
  padding: 32px;
}
#contact-dialog h2 {
  font-size: 28px;
  margin-bottom: 4px;
}
#contact-qr {
  width: 216px;
  height: 216px;
  object-fit: contain;
  background: #f6f4f0;
  padding: 14px;
  border-radius: 18px;
  margin: 24px auto;
  display: block;
}
.contact-row {
  margin-top: 20px;
  text-align: left;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.contact-row small {
  display: block;
}
.contact-row button {
  padding: 4px 12px;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 22px;
  border-radius: 30px;
  z-index: 10;
  box-shadow: 0 4px 30px #0003;
}
[hidden] {
  display: none !important;
}
/* 后台沿用浅色设计 token，与公开站点共用基础控件。 */
body.admin {
  --bg: #f6f4f0;
  --surface: #fff;
  --raised: #eeece8;
  --text: #1a1917;
  --muted: #7a766f;
  --faint: #a8a39b;
  --line: #e8e4dd;
  --red: #c2453b;
}
.admin .primary {
  background: #1a1917;
  color: white;
}
.admin .primary:hover {
  background: #34312b;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  background:
    linear-gradient(0deg, #0009, transparent 50%),
    url("/static/img/login.jpg") center/cover;
  position: relative;
}
.login-caption {
  position: absolute;
  bottom: 54px;
  left: 56px;
  color: #eeeae3;
}
.login-caption p {
  color: #b2ada4;
  margin-top: 8px;
}
.login-form {
  align-self: center;
  justify-self: center;
  width: 360px;
  max-width: 85%;
  padding: 40px 0;
}
.login h1 {
  font-size: 34px;
}
.login-form > p {
  color: var(--muted);
  margin: 4px 0 28px;
}
.admin label {
  display: block;
  margin-bottom: 20px;
}
.admin label input,
.admin label select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.login-form .primary {
  width: 100%;
  border-radius: 10px;
  margin-top: 20px;
  padding: 12px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 50px;
}
.password-field button {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 5px 10px;
  border: 0;
}
.admin-shell {
  min-height: 100vh;
  padding-left: 200px;
}
.sidebar {
  width: 200px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar .brand {
  font-size: 22px;
  margin: 0 0 24px;
}
.sidebar .brand small {
  font: 12px var(--sans);
  margin-left: 0;
}
.sidebar button {
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
}
.sidebar button.active {
  color: var(--text);
  background: #eae8e4;
}
.sync-card {
  margin-top: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}
.sync-card small {
  font-size: 11px;
}
.admin-main {
  padding: 36px 40px;
}
.admin-main h1 {
  font-size: 32px;
}
.admin-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.admin-title p {
  margin-top: 2px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.toolbar input {
  width: 320px;
}
.filters {
  display: flex;
  background: #eeece8;
  padding: 3px;
  border-radius: 12px;
}
.filters button {
  border: 0;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 9px;
  color: var(--muted);
}
.filters button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 4px #0001;
}
.table-scroll {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #faf9f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  font-size: 13px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.code {
  font: 11px monospace;
  color: var(--muted);
}
td .row-action {
  border: 0;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 7px;
}
td .copy {
  background: #f6f6f6;
  color: var(--text);
  padding: 6px 10px;
  margin-right: 4px;
}
td small {
  display: block;
  font-size: 11px;
}
.warning {
  color: #b9731c;
}
.settings-card {
  max-width: 820px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin: 26px 0;
}
.card-title {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.card-body {
  padding: 24px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}
.qr-preview {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f7;
  padding: 10px;
}
.qr-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.qr-controls button {
  font-size: 12px;
  border-radius: 8px;
  padding: 6px 12px;
}
.card-footer {
  background: #faf9f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.card-footer .primary {
  border-radius: 10px;
}
.admin dialog {
  background: #fff;
  border: 0;
  border-radius: 18px;
  width: 440px;
  padding: 28px;
}
.admin dialog::backdrop {
  background: #0006;
  backdrop-filter: none;
}
.admin dialog h2 {
  font-size: 24px;
  margin-bottom: 22px;
}
.admin dialog .close {
  color: var(--muted);
  background: none;
  right: 18px;
  top: 18px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}
.modal-actions button {
  border-radius: 10px;
  padding: 8px 16px;
}
.periods {
  display: flex;
  gap: 7px;
  margin-top: 6px;
}
.periods button {
  padding: 6px 10px;
  flex: 1;
  border-radius: 9px;
  font-size: 12px;
}
.periods .active {
  background: #1a1917;
  color: #fff;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.stat {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.stat b {
  font-size: 32px;
  display: block;
  font-weight: 400;
}
.admin .error {
  font-size: 12px;
  min-height: 20px;
}
.file-label {
  cursor: pointer;
}
.file-label input {
  margin-top: 12px;
}
.migration p {
  color: var(--muted);
  margin-bottom: 18px;
}
@media (min-width: 1600px) {
  .hero {
    height: 850px;
  }
}
@media (max-width: 1100px) {
  .wrap {
    padding: 0 36px;
  }
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .hero h1 {
    font-size: 80px;
  }
  .now-card {
    right: 36px;
    width: 300px;
  }
  .how {
    gap: 40px;
  }
  .admin-main {
    padding: 28px 24px;
  }
  .toolbar {
    align-items: start;
    flex-direction: column;
  }
  .hero-copy {
    max-width: 480px;
  }
}
@media (max-width: 640px) {
  .wrap {
    padding: 0 22px;
  }
  .nav {
    height: 76px;
  }
  .nav nav {
    gap: 20px;
  }
  .nav nav a:nth-child(2),
  .nav nav a:nth-child(3) {
    display: none;
  }
  .nav button {
    padding: 6px 14px;
  }
  .hero {
    height: 790px;
    min-height: 0;
    background-position: 58% center;
  }
  .hero-copy {
    padding-top: 82px;
  }
  .hero h1 {
    font-size: 64px;
    letter-spacing: -2px;
    margin: 26px 0;
  }
  .hero-copy p {
    font-size: 14px;
  }
  .now-card {
    left: 22px;
    right: 22px;
    bottom: 40px;
    width: auto;
    padding: 20px;
  }
  .channels {
    padding-top: 60px;
    padding-bottom: 40px;
  }
  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
  }
  .section-head h2,
  .how h2 {
    font-size: 34px;
  }
  .search {
    width: 100%;
  }
  .tabs {
    margin: 22px 0;
    gap: 25px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .tile {
    height: 105px;
  }
  .tile strong {
    font-size: 20px;
  }
  .how {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .steps article {
    padding: 24px 0;
  }
  .actions {
    gap: 20px;
  }
  footer .wrap {
    gap: 16px;
    flex-direction: column;
  }
  .player-info {
    padding: 20px;
  }
  .player-info .details {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }
  .player-info h2 {
    font-size: 25px;
  }
  .player-video .close {
    top: 8px;
    right: 8px;
  }
  .login {
    display: block;
  }
  .login-art {
    height: 220px;
    background-position: center 45%;
  }
  .login-caption {
    bottom: 22px;
    left: 24px;
  }
  .login-form {
    margin: auto;
    padding: 40px 0;
  }
  .admin-shell {
    padding: 0;
  }
  .sidebar {
    width: auto;
    position: relative;
    padding: 15px 18px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .sidebar .brand {
    margin: 0 12px 0 0;
  }
  .sidebar button {
    padding: 6px 9px;
    font-size: 12px;
  }
  .sync-card {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
  }
  .sync-card small {
    margin-left: 10px;
  }
  .admin-main {
    padding: 24px 18px;
  }
  .admin-title h1 {
    font-size: 28px;
  }
  .admin-title .primary {
    font-size: 12px;
    padding: 8px 14px;
  }
  .toolbar {
    gap: 12px;
    margin-bottom: 18px;
  }
  .toolbar input,
  .filters {
    width: 100%;
  }
  .filters button {
    flex: 1;
    padding: 6px 5px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-card {
    margin-top: 18px;
  }
  .card-body {
    padding: 20px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 16px;
  }
  .stat b {
    font-size: 26px;
  }
  .admin dialog {
    padding: 24px;
  }
  .periods {
    gap: 4px;
  }
  .periods button {
    padding: 6px;
  }
  .card-footer {
    padding: 16px 20px;
  }
}

.qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.qr-empty span {
  font-size: 48px;
  line-height: 1.3;
}
/* 宋体里的拉丁字母偏小，TV 改用无衬线小号金色，形成有意的大小对比 */
.brand-tv {
  font: 600 0.5em/1 var(--sans);
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-left: -4px; /* 抵消 .brand 的 8px 间距，让 TV 贴近「夜灯」 */
  align-self: flex-end;
  padding-bottom: 0.32em;
}
