/* 小月 Project Hub — moon/princess theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #0d0820;
  --bg-card: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f3e8ff;
  --text-muted: rgba(243, 232, 255, 0.72);
  --moon: #e8d5ff;
  --accent: #c9a0ff;
  --pink: #ffb6e6;
  --done: #7dffb2;
  --progress: #ffd966;
  --todo: rgba(255, 255, 255, 0.35);
  --radius: 16px;
  --font: "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 160, 255, 0.25), transparent),
    radial-gradient(circle at 85% 20%, rgba(255, 182, 230, 0.12), transparent),
    var(--bg-deep);
  line-height: 1.55;
  padding: 1.25rem;
  padding-bottom: 3rem;
}

.container { max-width: 720px; margin: 0 auto; }

/* Header */
.hero {
  text-align: center;
  padding: 1.5rem 0 2rem;
  position: relative;
}

.moon-deco {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--moon) 40%, #9b7bcc 100%);
  box-shadow: 0 0 40px rgba(201, 160, 255, 0.5), 0 0 80px rgba(201, 160, 255, 0.2);
  animation: moon-glow 4s ease-in-out infinite;
}

@keyframes moon-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(201, 160, 255, 0.5); transform: scale(1); }
  50% { box-shadow: 0 0 56px rgba(201, 160, 255, 0.7); transform: scale(1.03); }
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.35rem;
}

.hero .tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 28em;
  margin: 0 auto;
}

.hero .for-rayna {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: rgba(201, 160, 255, 0.15);
  border: 1px solid rgba(201, 160, 255, 0.35);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--moon);
}

/* Character preview */
.char-preview {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.char-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(201, 160, 255, 0.4);
  flex-shrink: 0;
}

.char-preview .info h2 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.char-preview .info p { font-size: 0.9rem; color: var(--text-muted); }

/* Co-write CTA */
a.cowrite-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(201, 160, 255, 0.22), rgba(255, 182, 230, 0.12));
  border: 2px solid rgba(201, 160, 255, 0.45);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
a.cowrite-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 160, 255, 0.65);
  box-shadow: 0 8px 24px rgba(201, 160, 255, 0.15);
}
.cowrite-cta-icon { font-size: 2rem; line-height: 1; }
a.cowrite-cta strong { display: block; font-size: 1.05rem; margin-bottom: 0.15rem; }
a.cowrite-cta small { font-size: 0.82rem; color: var(--text-muted); }

/* Project management dashboard */
.pm-dashboard {
  background: var(--bg-card);
  border: 1px solid rgba(201, 160, 255, 0.28);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1.75rem;
}

.pm-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pm-header h2 {
  font-size: 1.15rem;
  margin: 0;
}

.pm-updated {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.pm-progress { margin-bottom: 1rem; }

.pm-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.pm-progress-label strong,
#pm-percent {
  color: var(--moon);
  font-weight: 600;
}

.progress-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--done));
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 0;
}

.pm-quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (min-width: 520px) {
  .pm-quick-links { grid-template-columns: repeat(4, 1fr); }
}

a.pm-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

a.pm-quick-link:hover {
  background: rgba(201, 160, 255, 0.18);
  border-color: rgba(201, 160, 255, 0.45);
}

a.pm-quick-link .pm-quick-icon { font-size: 1.35rem; line-height: 1; }

.phase-task-progress {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.5rem 2.75rem;
}

.phase-task-progress-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.phase-task-progress-fill {
  height: 100%;
  background: var(--progress);
  border-radius: 999px;
}

.rs-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0 2.75rem;
  align-items: center;
}

.rs-tasks-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

a.rs-task-pill,
span.rs-task-pill {
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(201, 160, 255, 0.12);
  border: 1px solid rgba(201, 160, 255, 0.3);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

a.rs-task-pill:hover {
  background: rgba(201, 160, 255, 0.22);
  border-color: rgba(201, 160, 255, 0.5);
}

/* Progress summary */
.summary-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 0;
}

.summary-pill {
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.summary-pill.done { border-color: var(--done); color: var(--done); }
.summary-pill.in_progress { border-color: var(--progress); color: var(--progress); }
.summary-pill.not_started { border-color: var(--todo); color: var(--text-muted); }

/* Phases */
section.phases h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.phase-card.done { border-left: 4px solid var(--done); }
.phase-card.in_progress { border-left: 4px solid var(--progress); }
.phase-card.not_started { border-left: 4px solid var(--todo); opacity: 0.88; }

.phase-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.phase-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201, 160, 255, 0.2);
  font-weight: 700;
  font-size: 0.95rem;
}

.phase-title { font-size: 1.05rem; font-weight: 600; }
.phase-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; }

.status-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.status-badge.done { background: rgba(125, 255, 178, 0.15); color: var(--done); }
.status-badge.in_progress { background: rgba(255, 217, 102, 0.15); color: var(--progress); }
.status-badge.not_started { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.task-list {
  list-style: none;
  margin: 0.5rem 0 0 2.75rem;
}

.task-list li {
  font-size: 0.88rem;
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.task-list li.done { color: var(--text); }
.task-list li.done::before { content: "✓"; color: var(--done); font-weight: bold; }
.task-list li:not(.done)::before { content: "○"; color: var(--todo); }

/* Links */
section.links { margin-top: 2rem; }
section.links h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }

.link-grid {
  display: grid;
  gap: 0.65rem;
}

a.link-card {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

a.link-card:hover {
  background: rgba(107, 70, 193, 0.25);
  border-color: rgba(201, 160, 255, 0.4);
}

a.link-card strong { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }
a.link-card span { font-size: 0.82rem; color: var(--text-muted); }

.doc-ref {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.doc-ref code {
  font-family: ui-monospace, monospace;
  color: var(--accent);
}

footer {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .char-preview { flex-direction: column; text-align: center; }
  .phase-header { flex-wrap: wrap; }
  .status-badge { margin-left: 2.75rem; }
  .rs-tasks { margin-left: 0; }
  .phase-task-progress { margin-left: 0; }
  .task-list { margin-left: 0; }
}

/* Sub-pages: storyboard, characters, scenes */
.hub-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.hub-subnav a {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}
.hub-subnav a:hover,
.hub-subnav a[aria-current="page"] {
  background: rgba(201, 160, 255, 0.15);
  border-color: rgba(201, 160, 255, 0.45);
  color: var(--moon);
}

.page-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.asset-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.asset-badge.done { background: rgba(125, 255, 178, 0.15); color: var(--done); }
.asset-badge.missing { background: rgba(255, 217, 102, 0.12); color: var(--progress); }

.card-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 560px) {
  .card-grid.two-col { grid-template-columns: 1fr 1fr; }
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.hub-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.hub-card .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.hub-card dl {
  font-size: 0.88rem;
  display: grid;
  gap: 0.35rem;
}
.hub-card dt {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.hub-card dd { margin: 0; }
.hub-card img.char-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(201, 160, 255, 0.35);
  float: right;
  margin-left: 0.75rem;
}
.hub-card .prompt-block {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  font-size: 0.78rem;
  word-break: break-word;
}
.hub-card .prompt-block code {
  font-family: ui-monospace, monospace;
  color: var(--accent);
  white-space: pre-wrap;
}

.shot-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.shot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.shot-table th,
.shot-table td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  text-align: left;
}
.shot-table th {
  background: rgba(201, 160, 255, 0.12);
  color: var(--moon);
}
.shot-table tr.highlight td {
  background: rgba(255, 217, 102, 0.08);
  border-color: rgba(255, 217, 102, 0.25);
}

.shot-concept-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(201, 160, 255, 0.35);
  display: block;
  background: rgba(0, 0, 0, 0.25);
}

.section-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.35rem 0 0.85rem;
}

.concept-gallery { margin-bottom: 1.75rem; }

.concept-act-block { margin-bottom: 1.25rem; }

.concept-act-title {
  font-size: 0.95rem;
  color: var(--moon);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.concept-act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.concept-card:hover {
  border-color: rgba(201, 160, 255, 0.45);
  transform: translateY(-2px);
}

.concept-card.highlight {
  border-color: rgba(255, 217, 102, 0.45);
  box-shadow: 0 0 12px rgba(255, 217, 102, 0.12);
}

.concept-card a { display: block; line-height: 0; }

.concept-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.3);
}

.concept-card figcaption {
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.concept-card figcaption strong {
  color: var(--accent);
  margin-right: 0.25rem;
}

.md-content h1 { font-size: 1.35rem; margin: 1.25rem 0 0.75rem; }
.md-content h2 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.md-content h3 { font-size: 1rem; margin: 1rem 0 0.5rem; color: var(--moon); }
.md-content p, .md-content li { font-size: 0.9rem; color: var(--text-muted); margin: 0.35rem 0; }
.md-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin: 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.md-table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.md-table th, .md-table td {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
}
.md-table th { background: rgba(201, 160, 255, 0.1); }
.md-content pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.78rem;
  margin: 0.5rem 0;
}
.md-loading, .md-error {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}
