:root {
  --ink: #18201d;
  --muted: #6f7874;
  --paper: #f4f5f1;
  --card: rgba(255, 255, 255, 0.86);
  --line: #dfe5df;
  --accent: #c9f36b;
  --accent-dark: #415a16;
  --danger: #b54d4d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(100% - 32px, 1100px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(201, 243, 107, .22);
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.view {
  display: none;
  flex: 1;
}

.view.active {
  display: flex;
}

.auth-view {
  justify-content: center;
  align-items: center;
  padding: 32px 0 80px;
}

.auth-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(36px, 9vw, 120px);
}

.intro h1 {
  max-width: 540px;
  margin: 12px 0 20px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: .98;
  letter-spacing: -.06em;
}

.intro h1 a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.intro h1 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

.creator-avatar {
  width: 1em;
  height: 1em;
  margin-right: .12em;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -.12em;
}

.intro p {
  max-width: 410px;
  color: var(--muted);
  line-height: 1.8;
}

.auth-card,
.admin-panel {
  background: var(--card);
  border: 1px solid rgba(223, 229, 223, .9);
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(53, 65, 58, .08);
  backdrop-filter: blur(18px);
}

.auth-card {
  padding: clamp(24px, 5vw, 40px);
}

.auth-card h2 {
  margin: 10px 0 7px;
  font-size: 28px;
  letter-spacing: -.04em;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.form {
  margin-top: 24px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field[hidden] {
  display: none;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(201, 243, 107, .3);
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  background: var(--paper);
  color: var(--ink);
}

.primary,
.ghost,
.danger {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 700;
  transition: transform .2s, opacity .2s;
}

.primary {
  width: 100%;
  background: var(--ink);
  color: #fff;
}

.primary:hover,
.ghost:hover,
.danger:hover {
  transform: translateY(-1px);
}

.ghost {
  background: transparent;
  color: var(--ink);
}

.danger {
  background: #fff0f0;
  color: var(--danger);
  padding: 8px 12px;
  font-size: 12px;
}

.switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.switch button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: rgba(201, 243, 107, .35);
  color: var(--accent-dark);
  font-weight: 800;
}

.message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
}

.player-view {
  flex-direction: column;
  justify-content: flex-start;
}

.player-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.player-heading h1 {
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing: -.05em;
}

.player-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  flex: 1;
}

.video-sidebar {
  background: var(--card);
  border: 1px solid rgba(223, 229, 223, .9);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
  overflow: hidden;
}

.sidebar-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 15px;
  letter-spacing: -.02em;
}

.video-count {
  color: var(--muted);
  font-size: 12px;
}

.video-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.video-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: background .15s, color .15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.video-item:hover {
  background: rgba(201, 243, 107, .18);
}

.video-item.active {
  background: rgba(201, 243, 107, .35);
  color: var(--accent-dark);
  font-weight: 700;
}

.video-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color .15s;
}

.video-item-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-item:hover .video-item-icon {
  color: var(--ink);
}

.video-item.active .video-item-icon {
  color: var(--accent-dark);
}

.video-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-folder {
  font-weight: 600;
}

.tree-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform .2s ease, color .15s;
}

.tree-arrow svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.tree-arrow.collapsed svg {
  transform: rotate(-90deg);
}

.video-item:hover .tree-arrow {
  color: var(--ink);
}

.tree-children {
  overflow: hidden;
}

.tree-children.collapsed {
  display: none;
}

.tree-video {
  font-weight: 500;
}

.player-main {
  display: flex;
  flex-direction: column;
}

.player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .22);
}

.player-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #aeb8b2;
  text-align: center;
  font-size: 13px;
}

#artplayer {
  width: 100%;
  height: 100%;
}

.admin-view {
  display: none;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 40px;
}

.admin-view.active {
  display: flex;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.admin-header h1 {
  margin-top: 8px;
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: -.06em;
}

.admin-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.admin-panel {
  padding: 22px;
}

.admin-panel h2 {
  margin-bottom: 16px;
  font-size: 18px;
  letter-spacing: -.03em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 500;
}

.empty {
  padding: 30px 10px;
  color: var(--muted);
  text-align: center;
}

.admin-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 540px);
    padding-top: 18px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .auth-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 26px 4px 0;
  }

  .intro h1 {
    font-size: clamp(42px, 15vw, 70px);
  }

  .auth-view {
    align-items: start;
    padding-top: 8px;
  }

  .auth-card {
    padding: 24px;
  }

  .admin-header {
    align-items: start;
    flex-direction: column;
  }

  .admin-header .ghost {
    padding-left: 0;
  }

  .player-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .video-sidebar {
    max-height: 200px;
  }

  .player-wrapper {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: no-preference) {

  .auth-card,
  .intro,
  .admin-panel,
  .video-sidebar {
    animation: appear .5s ease both;
  }

  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(12px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}