:root {
  color-scheme: dark;
  --white: #f7f8f3;
  --muted: rgba(247, 248, 243, 0.66);
  --faint: rgba(247, 248, 243, 0.42);
  --line: rgba(255, 255, 255, 0.17);
  --panel: rgba(13, 15, 13, 0.56);
  --panel-hover: rgba(20, 23, 19, 0.76);
  --available: #c7ee63;
  --developing: #ffb760;
  --planned: #aeb9c7;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background: #111410;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.lucide { width: 18px; height: 18px; stroke-width: 1.8; }

.page-background,
.page-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-background {
  z-index: -2;
  background-image: url("../img/background.jpg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.page-overlay {
  z-index: -1;
  background: rgba(8, 10, 9, 0.68);
  backdrop-filter: saturate(0.78);
}

.app-shell {
  width: min(1180px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
}

.home-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 0 24px;
}

.home-header {
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
}

.avatar {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.avatar-state {
  position: absolute;
  right: 3px;
  bottom: 8px;
  width: 14px;
  height: 14px;
  border: 3px solid #1a1c19;
  border-radius: 50%;
  background: var(--available);
}

.overline {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 5.4vw, 66px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
}

.status-section { min-width: 0; }

.status-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  margin-bottom: 10px;
  color: var(--muted);
}

.status-heading span:first-child {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-color) 13%, transparent);
}

.status-heading h2 {
  margin: 0;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.status-heading small {
  margin-left: auto;
  font-size: 10px;
}

.status-section[data-status="available"] { --status-color: var(--available); }
.status-section[data-status="developing"] { --status-color: var(--developing); }
.status-section[data-status="planned"] { --status-color: var(--planned); }

.program-list {
  display: grid;
  gap: 10px;
}

.program-card {
  width: 100%;
  min-height: 108px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.program-card:hover,
.program-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--status-color) 68%, white 12%);
  background: var(--panel-hover);
  outline: none;
}

.program-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--status-color) 45%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--status-color) 16%, rgba(0, 0, 0, 0.18));
  color: var(--status-color);
}

.program-icon .lucide { width: 23px; height: 23px; }
.program-copy { min-width: 0; }
.program-copy strong { display: block; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.program-copy span { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.program-card > .lucide { width: 17px; color: var(--faint); transition: transform 180ms ease, color 180ms ease; }
.program-card:hover > .lucide { transform: translateX(3px); color: var(--status-color); }

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
}

.home-footer span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.home-footer .lucide { width: 13px; height: 13px; }

.detail-view {
  min-height: 100vh;
  padding: 24px 0;
}

.detail-toolbar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-button,
.download-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.back-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.back-button:hover { color: var(--white); }

.download-button {
  min-width: 126px;
  padding: 0 18px;
  border: 1px solid var(--available);
  background: var(--available);
  color: #151911;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.download-button:not(.disabled):hover { transform: translateY(-1px); filter: brightness(1.06); }
.download-button.disabled { border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.12); color: rgba(255,255,255,.42); cursor: not-allowed; }

.detail-content {
  width: min(840px, 100%);
  margin: 9vh auto 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.detail-icon {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--detail-color) 50%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--detail-color) 17%, rgba(0,0,0,.28));
  color: var(--detail-color);
  backdrop-filter: blur(16px);
}

.detail-icon .lucide { width: 42px; height: 42px; }
.detail-status { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--detail-color); font-size: 11px; font-weight: 700; }
.detail-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.detail-hero h1 { font-family: inherit; font-size: clamp(34px, 5vw, 56px); font-weight: 600; }
.detail-hero p { max-width: 620px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.meta-item { min-width: 0; padding-right: 24px; }
.meta-item + .meta-item { padding-left: 24px; border-left: 1px solid var(--line); }
.meta-item span { display: block; margin-bottom: 7px; color: var(--faint); font-size: 9px; font-weight: 700; }
.meta-item strong { display: block; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.feature-block { padding-top: 29px; }
.feature-block h2 { margin: 0 0 16px; font-size: 13px; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 30px; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.feature-list .lucide { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 3px; color: var(--detail-color); }
.detail-copyright { position: absolute; bottom: 23px; left: 50%; margin: 0; color: var(--faint); font-size: 9px; transform: translateX(-50%); }

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  max-width: calc(100% - 48px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(15, 17, 15, .92);
  color: var(--muted);
  font-size: 12px;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

.reveal { animation: reveal 760ms cubic-bezier(.2,.75,.25,1) both; }
.series-grid { animation-delay: 100ms; }
.home-footer { animation-delay: 180ms; }
.detail-enter { animation: reveal 460ms cubic-bezier(.2,.75,.25,1) both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 840px) {
  .app-shell { width: min(100% - 32px, 640px); }
  .home-view { justify-content: flex-start; padding-top: 34px; }
  .avatar-wrap, .avatar { width: 90px; height: 90px; }
  .series-grid { grid-template-columns: 1fr; margin-top: 30px; }
  .program-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-content { margin-top: 7vh; }
  .detail-copyright { position: static; padding: 54px 0 20px; text-align: center; transform: none; }
}

@media (max-width: 560px) {
  .app-shell { width: calc(100% - 24px); }
  .home-view { padding-top: 24px; }
  .avatar-wrap { margin-bottom: 14px; }
  h1 { font-size: 38px; }
  .lead { font-size: 12px; }
  .series-grid { gap: 22px; margin-top: 27px; }
  .program-list { grid-template-columns: 1fr; }
  .program-card { min-height: 92px; }
  .home-footer { margin-top: 30px; }
  .home-footer span:last-child { display: none; }
  .back-button span { display: none; }
  .download-button { min-width: 116px; }
  .detail-content { margin-top: 6vh; }
  .detail-hero { grid-template-columns: 72px 1fr; gap: 18px; }
  .detail-icon { width: 72px; height: 72px; }
  .detail-icon .lucide { width: 31px; height: 31px; }
  .detail-hero h1 { font-size: 31px; }
  .detail-hero p { grid-column: 1 / -1; margin-top: 4px; }
  .detail-meta { grid-template-columns: 1fr; gap: 14px; }
  .meta-item { padding: 0; }
  .meta-item + .meta-item { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .feature-list { grid-template-columns: 1fr; }
}

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