:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --panel: #ffffff;
  --panel-soft: #ebe7dc;
  --ink: #252522;
  --muted: #69665d;
  --line: #ded8cc;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --warm: #b85c38;
  --shadow: 0 18px 50px rgba(31, 27, 20, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.authGate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #e9eee8;
}

.authCard {
  display: grid;
  width: min(420px, 100%);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 24px;
}

.authCard h1 {
  font-size: 28px;
}

.authCard label,
.authCounter {
  color: var(--muted);
  font-size: 13px;
}

.authCard input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.authCard button,
.logoutButton {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.authCard button {
  height: 42px;
}

.authCard button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.authMessage,
.authCounter {
  min-height: 18px;
  margin: 0;
}

.authMessage {
  color: #a33b24;
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

textarea {
  font: inherit;
}

.appShell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #eee9df;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brandMark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  gap: 8px;
}

.filters button,
.sortControl select,
.stars button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.filters button {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.filters button.active {
  border-color: var(--accent);
  background: #d9eee9;
  color: var(--accent-strong);
  font-weight: 700;
}

.summaryPanel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  padding: 16px;
}

.summaryPanel span {
  color: var(--muted);
  font-size: 13px;
}

.summaryPanel strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.logoutButton {
  width: 100%;
  height: 38px;
  margin-top: 16px;
}

.content {
  padding: 28px;
}

.topBar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.2;
}

.sortControl {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.sortControl select {
  min-width: 150px;
  height: 38px;
  border-radius: 8px;
  padding: 0 10px;
}

.status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 16px;
}

.planPanel {
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.planHeader,
.planItemTop,
.planSummary,
.planBadges,
.planEvidence {
  display: flex;
  align-items: center;
}

.planHeader {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.planHeader h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.planHeader button {
  min-width: 72px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.planSummary {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.planSummary span,
.planBadges span,
.planEvidence span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.planSummary span {
  padding: 4px 8px;
}

.planList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.planItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.planItemTop {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.planItem h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
}

.planItemTop p,
.planReason,
.planEmpty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.planBadges {
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.planBadges span,
.planEvidence span {
  padding: 3px 7px;
}

.planBadges .priority高 {
  border-color: #d99721;
  background: #fff4d8;
  color: #a26000;
}

.planBadges .priority中 {
  border-color: #6aa69c;
  background: #e3f3ef;
  color: #0b4f4a;
}

.planActions {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding-left: 18px;
}

.planActions li {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.planEvidence {
  flex-wrap: wrap;
  gap: 6px;
}

.hidden {
  display: none;
}

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

.videoCard {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.videoCard video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #161614;
}

.videoBody {
  padding: 16px;
}

.videoMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.videoMeta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.videoBody h2 {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.3;
}

.videoBody p {
  min-height: 42px;
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.ratingPanel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.scoreLine strong,
.scoreLine span {
  display: block;
}

.scoreLine strong {
  font-size: 24px;
}

.scoreLine span {
  color: var(--muted);
  font-size: 12px;
}

.stars {
  display: flex;
  gap: 4px;
}

.stars button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #8d8678;
  cursor: pointer;
}

.stars button.selected,
.stars button:hover {
  border-color: #d99721;
  background: #fff4d8;
  color: #a26000;
}

.commentsPanel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.commentsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.commentsHeader h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.commentsHeader span,
.commentMeta time,
.commentEmpty {
  color: var(--muted);
  font-size: 12px;
}

.commentsList {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.commentItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 10px;
}

.commentMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.commentMeta strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commentItem p,
.commentEmpty {
  margin: 0;
  min-height: 0;
  white-space: pre-wrap;
}

.commentItem p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.commentForm {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.commentForm input,
.commentForm textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.commentForm input {
  height: 36px;
  padding: 0 10px;
}

.commentForm textarea {
  min-height: 78px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.45;
}

.commentForm button {
  justify-self: end;
  min-width: 76px;
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.commentForm button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 1120px) {
  .videoGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planList {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .appShell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters button {
    text-align: center;
  }

  .content {
    padding: 18px;
  }

  .topBar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 26px;
  }

  .videoGrid {
    grid-template-columns: 1fr;
  }
}
