/* ==========================================================
   creabl.cn — 设计基调：开发者终端风格，克制、单色调 + 一个强调色
   字体：系统原生字体栈（正文用 UI 字体，代码/强调用等宽字体）
   ========================================================== */

:root {
  --rose:       #E8938F;
  --rose-dim:   #E8938F22;
  --rose-deep:  #D47873;

  --bg:         #F7F5F2;
  --bg-elevated:#FFFFFF;
  --text:       #1A1A2E;
  --text-muted: #8B8580;
  --border:     #EAE4E0;
  --line:       #E0D8D2;
  --code-bg:    #0f1117;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow:     0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-rose:0 2px 12px rgba(232,147,143,0.25);

  --transition-fast:  150ms ease;
  --transition-base:  250ms ease;
  --transition-slow:  400ms ease;

  --font-ui:  -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  --bg:         #121212;
  --bg-elevated:#1E1E1E;
  --text:       #EAEAEA;
  --text-muted: #9E9E9E;
  --border:     #333333;
  --line:       #2A2A2A;
  --code-bg:    #0a0a0a;
  --shadow:     0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-rose:0 2px 12px rgba(232,147,143,0.2);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  transition: background var(--transition-base), color var(--transition-base);
  animation: fadeIn var(--transition-slow) ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.container.narrow { max-width: 720px; }

.muted { color: var(--text-muted); }

/* ---------- Nav ---------- */
.nav {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}
.brand::after { content: "_"; color: var(--rose); animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 18px; margin-right: auto; }
.nav-links a { font-size: 14px; color: var(--text-muted); transition: color var(--transition-fast); }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--rose); font-weight: 500; }

.theme-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 15px;
  transition: border-color var(--transition-fast);
}
.theme-btn:hover { border-color: var(--rose); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 20px 40px;
}
.hero h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 12px; }
.hero-sub { color: var(--text-muted); font-size: 16px; max-width: 560px; margin: 0 0 16px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hero-tags .tag { font-size: 13px; padding: 4px 12px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Capabilities ---------- */
.section-title { font-size: 20px; margin: 0 0 16px; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; margin-bottom: 16px; }
.cap-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.cap-card:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cap-card h3 { margin: 0 0 8px; font-size: 16px; }
.cap-card p { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.cap-evidence { font-size: 12px; color: var(--rose); font-family: var(--font-mono); }

/* ---------- Buttons / tags / badges ---------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--rose);
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, background var(--transition-fast), border-color var(--transition-fast);
}
.btn:hover { transform: translateY(-1px); opacity: .92; background: var(--rose-deep); border-color: var(--rose-deep); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.tag:hover { background: var(--rose-dim); border-color: var(--rose); color: var(--rose); }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 8px;
}
.badge-active { background: var(--rose-dim); color: var(--rose); }
.badge-planning { background: var(--rose-dim); color: var(--rose); }

/* ---------- Sections / grid ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 40px 0 16px;
}
.section-head h2 { margin: 0; font-size: 20px; }
.link-more { font-size: 13px; color: var(--rose); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card img { width: 100%; aspect-ratio: 5/3; object-fit: cover; display: block; background: var(--border); }
.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 16px; }
.card-body p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- Doc list ---------- */
.doc-list { display: flex; flex-direction: column; gap: 2px; }
.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.doc-item:hover { background: var(--bg-elevated); border-color: var(--border); }
.doc-title { font-size: 14px; }
.doc-meta { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  margin: 12px 0 20px;
}
.search-input:focus { outline: none; border-color: var(--rose); }

/* ---------- Detail pages / prose ---------- */
.detail-cover { width: 100%; border-radius: var(--radius); margin-bottom: 20px; background: var(--border); }
.detail-links { display: flex; gap: 12px; margin-top: 20px; }
.prose { font-size: 15px; }
.prose.markdown-body { line-height: 1.75; }
.markdown-body pre { background: var(--code-bg); border-radius: 8px; padding: 14px; overflow-x: auto; }
.markdown-body code { font-family: var(--font-mono); font-size: 13px; }
.markdown-body :not(pre) > code { background: var(--border); padding: 2px 6px; border-radius: 4px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin-top: 1.6em; }

.contact-list { list-style: none; padding: 0; font-family: var(--font-mono); font-size: 14px; }
.contact-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); }

/* ---------- Admin ---------- */
.admin-login, .admin-panel { max-width: 480px; }
.admin-login input, .admin-panel input {
  display: block; width: 100%; padding: 10px 12px; margin: 10px 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); color: var(--text);
}
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-row { font-family: var(--font-mono); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- Hamburger ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 12px 0;
    margin-right: 0;
  }
  .nav-links.open { display: flex; }
  .nav-inner { flex-wrap: wrap; }
  .nav-links a {
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 6px;
  }
  .nav-links a:hover { background: var(--rose-dim); color: var(--rose); }
}

@media (max-width: 640px) {
  .nav-links { gap: 12px; }
  .hero { padding: 48px 20px 28px; }
  .section-head { margin: 28px 0 12px; }
}

/* ==============================================================
   P2: Bento Grid
   ============================================================== */

/* Hero in bento context */
.bento-grid .hero {
  max-width: none;
  margin: 0;
  border-radius: var(--radius-lg);
  padding: 32px;
  background: linear-gradient(135deg, #F7F5F2 0%, #FDF0EE 100%);
}
[data-theme="dark"] .bento-grid .hero {
  background: linear-gradient(135deg, #121212 0%, #1A1515 100%);
}

.brand-decor {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 10px;
  letter-spacing: 0.5px;
}
.brand-decor::after {
  content: "_";
  color: var(--rose);
  animation: blink 1.1s step-end infinite;
}

/* ---------- Bento Grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.bento-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bento-wide {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.bento-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.bento-card:hover {
  border-color: var(--rose);
  box-shadow: var(--shadow-md);
}

/* Bento mid section: cap cards + latest updates */
.bento-cap-updates {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.bento-cap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-item {
  text-align: center;
  padding: 8px 4px;
}
.stats-num {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--rose);
  font-family: var(--font-mono);
  line-height: 1.2;
  transition: color var(--transition-fast);
}
.stats-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Skills Grid ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: default;
  transition: background var(--transition-fast);
}
.skill-item:hover {
  background: var(--rose-dim);
}
.skill-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ---------- Cap Cards ---------- */
.cap-card--primary {
  border-left: 3px solid var(--rose);
}

/* ---------- Fade Up Animation ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero stagger — initial hidden state set by JS */
.hero-stagger {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ---------- Empty / Error States ---------- */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.empty-state span:first-child {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  margin: 0;
}

.error-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.error-state span:first-child {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.error-state p {
  font-size: 14px;
  margin: 0 0 12px;
}

/* ---------- Latest section ---------- */
.latest-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition-fast);
}
.latest-section:hover {
  border-color: var(--rose);
}

.latest-section .section-head {
  margin: 0 0 12px;
}
.latest-section .section-head h2 {
  font-size: 17px;
}
.latest-section .doc-item {
  padding: 10px 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.latest-section .doc-item:last-child {
  border-bottom: none;
}
.latest-section .doc-item:hover {
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--line);
}
.latest-section .doc-item:last-child:hover {
  border-bottom-color: transparent;
}

/* ---------- About: Profile ---------- */
.profile-intro {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 16px 0;
}
.profile-avatar-area {
  flex-shrink: 0;
}
.avatar-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
}
.profile-intro p {
  flex: 1;
  margin: 0;
  line-height: 1.8;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border);
  margin: 16px 0;
}
.timeline-item {
  position: relative;
  padding: 0 0 24px 16px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid var(--bg);
  transition: transform var(--transition-fast);
}
.timeline-item:hover::before {
  transform: scale(1.3);
}
.timeline-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--rose);
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-event {
  font-size: 15px;
  margin: 2px 0;
}
.timeline-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- About: Contact ---------- */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.contact-item:hover {
  border-color: var(--rose);
  transform: translateY(-1px);
}
.contact-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.contact-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.contact-label {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}
.contact-value {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--rose);
  margin-left: auto;
}

/* ---------- About: Cooperation Flow ---------- */
.coop-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
}
.coop-step {
  padding: 8px 14px;
  background: var(--rose-dim);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.coop-arrow {
  color: var(--rose);
  font-size: 18px;
  font-weight: 600;
}

/* ---------- Modal Overlay (WeChat QR) ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  max-width: 280px;
  animation: scaleIn 0.25s ease;
}
@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-content img,
.modal-content .qr-placeholder {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
}
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--text-muted);
  font-size: 13px;
  gap: 8px;
}

/* ---------- Responsive: Bento Grid ---------- */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-right { display: grid; grid-template-columns: 1fr 1fr; }
  .bento-cap { grid-template-columns: 1fr; }
  .bento-cap-updates { grid-template-columns: 1fr; }
  .bento-grid .hero { padding: 28px 24px; }
}
@media (max-width: 640px) {
  .bento-right { grid-template-columns: 1fr; }
  .bento-grid .hero { padding: 24px 16px; }
  .bento-cap-updates { grid-template-columns: 1fr; }
  .stats-grid { gap: 8px; }
  .stats-num { font-size: 26px; }
  .coop-flow { justify-content: center; }
}

@media (max-width: 480px) {
  .bento-grid .hero h1 { font-size: clamp(24px, 7vw, 32px); }
  .bento-grid .hero-actions { flex-direction: column; }
  .bento-grid .hero-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover { border-color: var(--rose); color: var(--rose); }
.filter-btn.active { background: var(--rose); color: #fff; border-color: var(--rose); }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg-elevated) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 280px; }
.skeleton-text { height: 14px; margin: 8px 0; width: 60%; }
.skeleton-text.short { width: 40%; }

/* ---------- Empty / Error ---------- */
.empty-state, .error-state { text-align: center; padding: 48px 20px; }
.empty-state .emoji, .error-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state h3, .error-state h3 { margin: 0 0 8px; font-size: 18px; }
.empty-state p, .error-state p { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; margin: 16px 0; }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; transition: transform var(--transition-fast); }
.gallery img:hover { transform: scale(1.03); }
.photo-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100; display: flex; align-items: center; justify-content: center; }
.photo-modal-overlay img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius); cursor: default; }
.photo-modal-overlay .modal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); color: #fff; border: none; padding: 12px 18px; font-size: 24px; cursor: pointer; border-radius: 8px; }
.photo-modal-overlay .modal-nav:hover { background: rgba(255,255,255,0.4); }
.modal-prev { left: 20px; }
.modal-next { right: 20px; }

/* ---------- Metrics ---------- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; margin: 16px 0; }
.metric-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.metric-value { font-size: 28px; font-weight: 700; color: var(--rose); font-family: var(--font-mono); }
.metric-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Back link ---------- */
.back-link { display: inline-block; font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.back-link:hover { color: var(--rose); }

/* ---------- Status badges ---------- */
.badge-active { background: #6EA88A22; color: #6EA88A; }
.badge-launched { background: var(--rose-dim); color: var(--rose); }
.badge-planning { background: #D4B08022; color: #D4B080; }

/* ---------- Highlight search ---------- */
mark { background: var(--rose-dim); color: var(--rose); padding: 1px 4px; border-radius: 3px; }

/* ---------- CMS Admin ---------- */
.cms-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.cms-nav a { padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; text-decoration: none; }
.cms-nav a:hover { background: var(--rose-dim); }
.cms-nav a.active { background: var(--rose); color: #fff; }

.cms-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.cms-stat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.cms-stat-num { font-size: 28px; font-weight: 700; color: var(--rose); font-family: var(--font-mono); }
.cms-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.cms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cms-table th, .cms-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.cms-table th { font-weight: 600; color: var(--text-muted); font-size: 12px; }
.cms-table tr:hover td { background: var(--rose-dim); }

.cms-form label { display: block; font-size: 13px; color: var(--text-muted); margin: 12px 0 4px; }
.cms-form input, .cms-form textarea, .cms-form select { display: block; width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); color: var(--text); font-size: 14px; }
.cms-form textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }
.cms-form .help { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.cms-form .form-row { display: flex; gap: 12px; }
.cms-form .form-row > * { flex: 1; }
.cms-form-actions { display: flex; gap: 8px; margin-top: 16px; }

.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 999; animation: fadeIn .2s ease; max-width: 360px; transition: opacity .3s ease; }
.toast-success { background: #6EA88A; color: #fff; }
.toast-error { background: #D47873; color: #fff; }
.toast-info { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }

.modal-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-confirm { background: var(--bg-elevated); border-radius: var(--radius); padding: 24px; max-width: 400px; width: 90%; }
.modal-confirm h3 { margin: 0 0 8px; }
.modal-confirm p { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; }
.modal-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

.cms-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cms-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--rose-dim); border-radius: 999px; font-size: 12px; }
.cms-tag-remove { cursor: pointer; opacity: .6; font-size: 14px; line-height: 1; }
.cms-tag-remove:hover { opacity: 1; }

.cms-timeline-item { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.cms-timeline-item input { flex: 1; }
.cms-timeline-item .year { width: 60px; }

.md-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-height: 100px; background: var(--bg); margin-top: 8px; font-size: 14px; line-height: 1.7; }
.md-preview img { max-width: 100%; border-radius: 6px; }
.md-preview pre { background: var(--code-bg); padding: 12px; border-radius: 6px; overflow-x: auto; }
.md-preview code { font-family: var(--font-mono); font-size: 13px; }
.md-preview :not(pre) > code { background: var(--border); padding: 2px 6px; border-radius: 4px; }

.cms-section { margin-bottom: 24px; }
.cms-section h3 { font-size: 15px; margin: 0 0 8px; color: var(--text-muted); }

.cms-recent-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; border-radius: 6px; }
.cms-recent-item:hover { background: var(--rose-dim); }
.cms-recent-item:last-child { border-bottom: none; }

.cms-meta { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.cms-loading { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }

.login-error { color: #D47873; font-size: 13px; min-height: 20px; margin: 0 0 8px; text-align: center; }
.admin-login { max-width: 400px; margin: 60px auto 0; text-align: center; }
.admin-login h2 { margin-bottom: 20px; }
.admin-login input { display: block; width: 100%; padding: 10px 12px; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); color: var(--text); font-size: 16px; }
.admin-login input:focus { outline: none; border-color: var(--rose); }

.cms-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cms-section-header h3 { margin: 0; }

.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.status-active { background: #6EA88A22; color: #6EA88A; }
.status-launched { background: var(--rose-dim); color: var(--rose); }
.status-planning { background: #D4B08022; color: #D4B080; }

.cms-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.cms-empty span:first-child { font-size: 32px; display: block; margin-bottom: 8px; }
.cms-empty p { font-size: 14px; margin: 0; }

.cms-checkbox { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.cms-checkbox input[type="checkbox"] { width: auto; margin: 0; }
.cms-checkbox label { margin: 0; }

.cms-word-count { text-align: right; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 4px; }

.admin-panel .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.admin-panel .btn-ghost:hover { border-color: var(--rose); color: var(--rose); }

.cms-btn-sm { padding: 4px 10px; font-size: 12px; }

.cms-preview-toggle { display: flex; gap: 4px; margin-bottom: 4px; }
.cms-preview-toggle button { padding: 4px 12px; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; }
.cms-preview-toggle button.active { background: var(--rose); color: #fff; border-color: var(--rose); }

.cms-image-preview { max-width: 200px; max-height: 120px; border-radius: 6px; margin-top: 4px; border: 1px solid var(--border); object-fit: cover; }

@media (max-width: 768px) {
  .cms-nav { gap: 2px; }
  .cms-nav a { padding: 4px 8px; font-size: 12px; }
  .cms-stats { grid-template-columns: repeat(2, 1fr); }
  .cms-form .form-row { flex-direction: column; }
  .cms-table { font-size: 12px; }
  .cms-table th, .cms-table td { padding: 6px 8px; }
}
