:root {
  --bg: #fff6ea;
  --bg-2: #ffe9c7;
  --sky: #d7eefe;
  --ink: #3b342c;
  --muted: #7a7168;
  --card: rgba(255, 252, 247, 0.88);
  --line: rgba(90, 70, 40, 0.1);
  --sun: #f4b63c;
  --sun-deep: #e39420;
  --leaf: #3d9a6a;
  --warn: #e37a3c;
  --danger: #d4534a;
  --shadow: 0 18px 50px rgba(180, 120, 40, 0.12);
  --radius: 22px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fff2c8 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, var(--sky) 0%, transparent 50%),
    linear-gradient(180deg, #fffaf1 0%, var(--bg) 40%, #ffe8c4 100%);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

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

.toolbar .search-box {
  margin-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.sun {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7d6, var(--sun) 45%, var(--sun-deep));
  box-shadow: 0 0 0 6px rgba(244, 182, 60, 0.18);
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a,
.ghost,
.btn,
.chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav a.active,
.btn {
  background: var(--ink);
  color: #fffaf1;
  width: auto;
  height: auto;
}

.btn.gold {
  background: linear-gradient(180deg, var(--sun), var(--sun-deep));
  color: #3b2a10;
  font-weight: 700;
}

.btn.leaf {
  background: var(--leaf);
  color: white;
}

.btn.warn {
  background: var(--warn);
  color: white;
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.hero,
.card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 36px 32px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(255, 232, 180, 0.55) 55%, rgba(210, 236, 255, 0.4)),
    var(--card);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 750;
}

.hero p,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.stat,
.door,
.room,
.form {
  padding: 20px;
}

a.stat {
  display: block;
  color: inherit;
  cursor: pointer;
  transition: transform 0.16s ease;
}

a.stat:hover {
  transform: translateY(-3px);
}

a.stat .go {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.back {
  display: inline-flex;
  margin-bottom: 12px;
}

.stat b,
.door h3,
.room h3 {
  display: block;
  font-size: 28px;
  margin: 6px 0 0;
}

.door {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease;
}

.door:hover {
  transform: translateY(-3px);
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff3d4;
  color: #8a5a12;
}

.tag.ok {
  background: #e5f7ec;
  color: #1f7a4d;
}

.tag.warn {
  background: #ffe7d6;
  color: #b04a16;
}

.tag.void {
  background: #eef4ff;
  color: #3a5d9b;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: min(100%, 220px);
  margin: 0;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.req {
  color: #c45c12;
  font-weight: 700;
  margin-left: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.progress {
  height: 8px;
  border-radius: 99px;
  background: #f1e6d4;
  overflow: hidden;
  margin-top: 12px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffd36a, #f4b63c);
}

.welcome-card {
  padding: 28px 24px;
  text-align: center;
}

.welcome-card h1 {
  font-size: clamp(24px, 5vw, 34px);
}

.welcome-card .pwd {
  font-size: 28px;
  letter-spacing: 0.12em;
  margin: 12px 0;
  font-weight: 750;
}

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(50, 36, 16, 0.32);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 16px 40px;
  -webkit-overflow-scrolling: touch;
  animation: modal-fade 0.2s ease;
}

.modal {
  width: min(520px, 100%);
  padding: 22px 22px 18px;
  margin: auto;
  max-width: 100%;
  animation: modal-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal .actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 0 4px;
  margin-top: 8px;
  z-index: 2;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-box {
  width: min(420px, 100%);
  margin: 40px auto;
  padding: 28px;
}

.hint {
  font-size: 13px;
  background: #fff6dc;
  border-radius: 14px;
  padding: 10px 12px;
}

.duration-picker {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 4px;
  margin-bottom: 14px;
  background: #fffdf8;
}

.choice {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.choice input {
  width: auto;
}

.poster-modal {
  width: min(440px, 100%);
  text-align: center;
}

.poster-preview {
  width: min(360px, 100%);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(160, 110, 40, 0.22);
  display: block;
  margin: 8px auto 14px;
}

@media (max-width: 800px) {
  .app-shell {
    width: min(1080px, calc(100% - 20px));
    padding: 14px 0 48px;
  }
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .nav {
    justify-content: flex-end;
  }
  .nav a {
    padding: 6px 10px;
    font-size: 13px;
  }
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  .row .btn,
  .row .ghost {
    width: 100%;
    text-align: center;
  }
  .row .actions {
    width: 100%;
  }
  .row .actions .btn,
  .row .actions .ghost {
    flex: 1;
    width: auto;
    text-align: center;
  }
  .hero {
    padding: 24px 18px;
  }
  .hero h1,
  .room h3,
  .door h3,
  .stat b {
    font-size: clamp(22px, 7vw, 32px);
  }
}

.media-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.media-chip {
  width: 96px;
}

.media-chip img,
.media-chip video {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #eee;
}

.media-chip button {
  width: 100%;
  margin-top: 4px;
  padding: 4px;
  font-size: 12px;
}

.media-chip .file-name,
.media-chip .file-chip {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  word-break: break-all;
  margin-top: 4px;
}

.media-chip .file-chip,
.media-chip.is-file .file-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 6px;
  background: #f4eee6;
  border-radius: 6px;
  text-decoration: none;
}
