/* ============================================================
   周星驰资料馆 · 共享样式 (移动端优先)
   ============================================================ */
:root {
  --bg: #0e1116;
  --bg-soft: #161b23;
  --card: #1b212b;
  --card-2: #202734;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #f5c542;          /* 星爷金 */
  --accent-2: #e8a13a;
  --accent-soft: rgba(245, 197, 66, 0.14);
  --danger: #e2544d;
  --ok: #4cae6d;
  --radius: 14px;
  --nav-h: 54px;
  --tab-h: 58px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --maxw: 960px;
}
[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-soft: #eceef2;
  --card: #ffffff;
  --card-2: #f6f7f9;
  --border: rgba(20, 24, 34, 0.1);
  --text: #20242e;
  --muted: #626a79;
  --accent: #c8860a;
  --accent-2: #a86e06;
  --accent-soft: rgba(200, 134, 10, 0.12);
  --shadow: 0 8px 24px rgba(30, 34, 44, 0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1406; font-weight: 800; font-size: 17px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(245, 197, 66, 0.35);
}
.brand b { font-size: 15px; letter-spacing: 0.5px; }
.brand small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 17px;
  display: grid; place-items: center; transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.92); }
#hamburger .bar { display: block; width: 18px; height: 2px; background: var(--text); margin: 3px auto; border-radius: 2px; transition: 0.25s; }
#hamburger.open .bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
#hamburger.open .bar:nth-child(2) { opacity: 0; }
#hamburger.open .bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 抽屉导航 (移动端) */
.drawer {
  position: fixed; top: var(--nav-h); left: 0; bottom: 0; z-index: 59;
  width: min(78vw, 300px);
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform 0.28s ease;
  display: flex; flex-direction: column; padding: 16px 10px 24px; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 12px; color: var(--text); font-size: 15px;
}
.drawer a .ico { font-size: 19px; width: 24px; text-align: center; }
.drawer a:active { background: var(--card); }
.drawer a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drawer .drawer-meta { margin-top: auto; padding: 14px; font-size: 11px; color: var(--muted); }
.scrim {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 58; background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- 底部 Tab (移动端常驻) ---------- */
.bottab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--tab-h);
  display: flex; background: var(--bg-soft);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottab a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 10px;
}
.bottab a .ico { font-size: 20px; line-height: 1; }
.bottab a.on { color: var(--accent); }
.bottab a.on .ico { transform: translateY(-1px); }

/* ---------- 主内容 ---------- */
.page {
  padding: calc(var(--nav-h) + 18px) 14px calc(var(--tab-h) + 26px);
  max-width: var(--maxw); margin: 0 auto;
}
h1.page-title { font-size: 24px; margin: 6px 0 4px; letter-spacing: 0.5px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.lead { color: var(--muted); font-size: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; margin: 26px 0 12px; font-weight: 700;
}
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2)); }

/* ---------- 英雄区 (首页) ---------- */
.hero {
  position: relative; text-align: center; padding: 34px 8px 26px; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--border);
  background:
    radial-gradient(560px 220px at 50% -40px, rgba(245, 197, 66, 0.28), transparent 70%),
    linear-gradient(165deg, var(--card-2), var(--card));
}
.hero .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.hero .avatar {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1406; font-weight: 800; font-size: 40px;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(245, 197, 66, 0.4);
  border: 3px solid var(--bg);
}
.hero h1 { font-size: 26px; letter-spacing: 1px; }
.hero .sub { color: var(--muted); font-size: 13px; margin: 6px 0 16px; letter-spacing: 2px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted);
}
.chip b { color: var(--accent); font-size: 14px; }

/* 数据条 */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px; }
.stat .num { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat .lbl { font-size: 11px; color: var(--muted); }

/* ---------- 时间线 (生平页) ---------- */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--border)); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-2);
}
.tl-year { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.tl-title { font-size: 15px; font-weight: 700; margin: 2px 0 4px; }
.tl-desc { font-size: 13px; color: var(--muted); }
.tl-more {
  margin-top: 6px; font-size: 13px; color: var(--accent); display: inline-flex; align-items: center; gap: 4px;
}
.tl-more .arr { transition: transform 0.2s; }
.tl-item.open .tl-more .arr { transform: rotate(180deg); }
.tl-extra {
  display: none; margin-top: 8px; font-size: 13px; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}
.tl-item.open .tl-extra { display: block; animation: fadeIn 0.25s ease; }

/* ---------- 电影页 ---------- */
.filters { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20; background: var(--bg); padding: 8px 0; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.fbtn {
  flex: none; padding: 8px 15px; border-radius: 999px; font-size: 13px;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  transition: 0.15s;
}
.fbtn.on { background: var(--accent); border-color: var(--accent); color: #1a1406; font-weight: 600; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; margin-bottom: 8px;
}
.search-box input {
  flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; font-family: inherit;
}
.search-box .ico { color: var(--muted); }
.film-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.film {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 13px; position: relative; overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.film:active { transform: scale(0.98); }
.film .fposter {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); margin-bottom: 10px;
  background: var(--bg-soft); display: block;
}
.film .yr {
  position: absolute; top: 0; right: 0;
  font-size: 11px; padding: 3px 10px; border-bottom-left-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.film h3 { font-size: 15px; padding-right: 34px; margin-bottom: 4px; }
.film .role { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.rtag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted);
}
.rtag.dir { color: var(--ok); border-color: rgba(76, 174, 109, 0.4); }
.rtag.wri { color: #6ea8ff; border-color: rgba(110, 168, 255, 0.4); }
.film .note { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.film .deta {
  display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--muted);
}
.film.open .deta { display: block; animation: fadeIn 0.25s ease; }
.film.open .note { -webkit-line-clamp: unset; }
.film-count { font-size: 12px; color: var(--muted); margin: 6px 2px 10px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------- 新闻页 ---------- */
.news-item { padding: 16px; }
.news-date { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 0.5px; }
.news-cat { font-size: 10px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.news-title { font-size: 15px; font-weight: 700; margin: 5px 0 6px; }
.news-sum { font-size: 13px; color: var(--muted); }
.news-full {
  display: none; margin-top: 10px; font-size: 13px; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}
.news-item.open .news-full { display: block; animation: fadeIn 0.25s ease; }
.news-src { font-size: 11px; color: var(--muted); margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.news-src a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.news-more { margin-top: 8px; font-size: 13px; color: var(--accent); display: inline-flex; gap: 4px; align-items: center; }
.news-more .arr { transition: transform 0.2s; }
.news-item.open .news-more .arr { transform: rotate(180deg); }

/* ---------- 台词页 ---------- */
.quote-card { text-align: center; padding: 30px 20px; }
.quote-text { font-size: 19px; font-weight: 600; line-height: 1.8; }
.quote-text::before { content: "「"; color: var(--accent); }
.quote-text::after { content: "」"; color: var(--accent); }
.quote-from { margin-top: 14px; font-size: 13px; color: var(--muted); }
.quote-from b { color: var(--accent); }
.quote-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.btn {
  padding: 11px 22px; border-radius: 12px; border: none; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a1406;
  box-shadow: 0 6px 16px rgba(245, 197, 66, 0.3); transition: transform 0.15s;
}
.btn:active { transform: scale(0.95); }
.btn.ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.quote-list { margin-top: 18px; }
.qitem { display: flex; gap: 10px; padding: 13px 4px; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.qitem .qc {
  flex: none; width: 26px; height: 26px; border-radius: 8px; font-size: 12px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.qitem p { font-size: 13.5px; }
.qitem span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 荣誉 ---------- */
.honor { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.honor:last-child { border-bottom: none; }
.honor .hd { flex: none; width: 66px; font-size: 11px; color: var(--accent); font-weight: 700; padding-top: 2px; }
.honor .bd { font-size: 13.5px; }
.honor .bd small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 26px 14px 0; font-size: 12px; color: var(--muted); }
.footer a { color: var(--accent); }

/* ---------- 返回顶部 ---------- */
#toTop {
  position: fixed; right: 14px; bottom: calc(var(--tab-h) + 14px); z-index: 55;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 18px;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: 0.25s;
  box-shadow: var(--shadow);
}
#toTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-up { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-up.in { opacity: 1; transform: none; }

/* ---------- 桌面端增强 ---------- */
@media (min-width: 768px) {
  .page { padding-top: calc(var(--nav-h) + 30px); padding-bottom: 60px; }
  .bottab { display: none; }
  .drawer { width: 300px; }
  #toTop { bottom: 24px; }
  .film-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .film:hover { transform: translateY(-3px); border-color: rgba(245, 197, 66, 0.5); }
  .hero { padding: 48px 30px; }
  .hero .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.hero .avatar { width: 110px; height: 110px; font-size: 48px; }
  .stat-row { gap: 14px; }
  .card { padding: 22px 20px; }
  .quote-text { font-size: 22px; }
}
@media (min-width: 1080px) {
  .film-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 照片墙 ---------- */
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gallery img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); transition: transform 0.2s;
}
@media (max-width: 767px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

.news-item .nthumb {
  width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); margin-bottom: 12px;
  background: var(--bg-soft); display: block;
}
