/* ============================================================
   base.css — 全站共享基础（重置 / 无障碍 / 通用工具 / 动效）
   配色由各站点 theme.css 注入，排版结构由各站点专属 layout CSS 定义
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #4a6670;
  --brand-deep: #2f4a52;
  --brand-soft: #8fa8a0;
  --accent: #b8895c;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --text: #2a3033;
  --text-muted: #66747a;
  --nav-text: #ffffff;
  --footer-bg: #26363c;
  --footer-text: #dbe4e6;
  --border: #e6e2d8;
  --shadow: 0 4px 18px rgba(0, 0, 0, .08);
  --radius: 12px;
  --maxw: 1200px;
  --header-h: 68px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* 无障碍：跳转链接 */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand-deep); color: #fff; padding: 10px 16px; z-index: 2000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- 面包屑（共享外观） ---------- */
.breadcrumb { padding: 16px 0 0; font-size: 14px; color: var(--text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .crumb-current { color: var(--text); }

/* ---------- 按钮（共享基础） ---------- */
.btn { display: inline-block; padding: 10px 22px; border-radius: 8px; font-weight: 700; font-size: 15px; border: 0; transition: transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .7); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- 滚动渐显动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   魔云短剧 · 云端安然专属布局
   结构差异化：悬浮大卡（柔和阴影）/ 3 列 / 进度条榜单 / 漂浮导航
   配色由 theme.css 注入
   ============================================================ */

:root { --radius: 18px; }

/* ---------- 头部：魔云短剧云青实色，漂浮圆角导航 ---------- */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--brand-deep); color: var(--nav-text); box-shadow: 0 6px 24px rgba(40, 80, 70, .28); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px 12px 4px 12px; margin-right: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.brand-name { font-size: 20px; font-weight: 800; color: var(--nav-text); white-space: nowrap; }

.main-nav { display: flex; align-items: center; flex: 1; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--nav-text); }
.hamburger, .hamburger::before, .hamburger::after { display: block; width: 22px; height: 2px; background: var(--nav-text); border-radius: 2px; transition: .25s; }
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.nav-toggle.open .hamburger { background: transparent; }
.nav-toggle.open .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open .hamburger::after { top: 0; transform: rotate(-45deg); }

.nav-menu { display: flex; gap: 6px; }
.nav-menu a { display: block; padding: 9px 16px; color: var(--nav-text); font-weight: 600; font-size: 15px; border-radius: 999px; transition: all .22s; }
.nav-menu a:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); text-decoration: none; }
.nav-menu a.active, .nav-menu a[aria-current="page"] { background: #fff; color: var(--brand-deep); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }

.search-form { display: flex; margin-left: auto; flex-shrink: 0; }
.search-form input { border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); color: #fff; padding: 8px 14px; border-radius: 999px 0 0 999px; width: 168px; font-size: 14px; }
.search-form input::placeholder { color: rgba(255, 255, 255, .65); }
.search-form input:focus { outline: none; background: rgba(255, 255, 255, .25); border-color: #fff; }
.search-btn { border: 0; background: #fff; color: var(--brand-deep); padding: 8px 16px; border-radius: 0 999px 999px 0; font-weight: 700; font-size: 14px; }
.search-btn:hover { filter: brightness(1.05); }

/* ---------- 首屏轮播：大圆角 + 悬浮阴影 ---------- */
.hero { margin-top: 26px; margin-bottom: 10px; }
.carousel { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 18px 40px rgba(40, 90, 80, .22); background: var(--brand-deep); }
.slides { position: relative; height: 360px; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 30px 28px; background: linear-gradient(transparent, rgba(35, 70, 62, .84)); color: #fff; }
.slide-caption h3 { font-size: 24px; font-weight: 800; }
.slide-caption p { margin-top: 6px; color: rgba(255, 255, 255, .88); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: var(--brand-deep); font-size: 20px; line-height: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); transition: background .2s; }
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
.dots { position: absolute; bottom: 16px; right: 24px; display: flex; gap: 6px; z-index: 5; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .5); padding: 0; }
.dot.active { background: #fff; transform: scale(1.2); }

/* ---------- 区块标题 ---------- */
.section { padding: 30px 0 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { font-size: 22px; font-weight: 800; }
.section-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 10px; transform: rotate(45deg); }
.section-head .more { font-size: 14px; color: var(--text-muted); }
.section-head .more:hover { color: var(--brand); }

/* ---------- 卡片：3 列悬浮大卡 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: 0 14px 34px rgba(40, 90, 80, .14); transition: transform .3s ease, box-shadow .3s ease; }
.card:hover { transform: translateY(-8px); box-shadow: 0 24px 48px rgba(40, 90, 80, .22); }
.card-link { display: block; color: var(--text); }
.card-link:hover { text-decoration: none; }
.card-cover { position: relative; aspect-ratio: 2 / 3; background: var(--border); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .92); color: var(--brand-deep); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.card-body { padding: 14px 16px 18px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.card-meta { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ---------- 榜单：进度条式 ---------- */
.rank-list { display: grid; gap: 14px; }
.rank-item { position: relative; display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: 16px; padding: 14px 16px 18px; box-shadow: 0 8px 24px rgba(40, 90, 80, .1); overflow: hidden; transition: transform .2s; }
.rank-item:hover { transform: translateY(-3px); }
.rank-item::before { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 0 3px 3px 0; }
.rank-item:nth-child(1)::before { width: 100%; }
.rank-item:nth-child(2)::before { width: 86%; }
.rank-item:nth-child(3)::before { width: 74%; }
.rank-item:nth-child(4)::before { width: 62%; }
.rank-item:nth-child(5)::before { width: 52%; }
.rank-item:nth-child(6)::before { width: 44%; }
.rank-item:nth-child(7)::before { width: 38%; }
.rank-item:nth-child(8)::before { width: 32%; }
.rank-num { font-size: 20px; font-weight: 800; min-width: 40px; text-align: center; color: var(--brand); }
.rank-cover { width: 58px; height: 82px; border-radius: 12px; object-fit: cover; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, .14); }
.rank-info { flex: 1; min-width: 0; }
.rank-title { font-weight: 700; font-size: 16px; }
.rank-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 2px 8px rgba(40, 90, 80, .06); transition: all .2s; }
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip.active, .chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px rgba(40, 90, 80, .24); }

/* ---------- 页面标题区 ---------- */
.page-head { padding: 26px 0 12px; }
.page-head h2 { font-size: 28px; font-weight: 800; }
.page-head .page-sub { color: var(--text-muted); margin-top: 6px; }

/* ---------- 下载 APP 引导 ---------- */
.app-guide { margin: 36px 0; padding: 32px; border-radius: 22px; background: linear-gradient(120deg, var(--brand-deep), var(--brand)); color: #fff; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; box-shadow: 0 18px 40px rgba(40, 90, 80, .24); }
.app-guide h2 { font-size: 24px; font-weight: 800; }
.app-guide p { margin-top: 6px; color: rgba(255, 255, 255, .88); max-width: 560px; }
.app-guide .app-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.qr { width: 98px; height: 98px; flex-shrink: 0; border-radius: 14px; background: #fff; padding: 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.qr span { background: var(--brand-deep); border-radius: 2px; }
.qr span.blank { background: transparent; }

/* ---------- 关于/密度区 ---------- */
.about { background: var(--surface); border-radius: 18px; padding: 28px; box-shadow: 0 10px 28px rgba(40, 90, 80, .1); }
.about h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.about p { color: var(--text-muted); margin-bottom: 10px; }
.about p strong { color: var(--brand); }

/* ---------- 详情页 ---------- */
.detail { background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: 0 10px 28px rgba(40, 90, 80, .1); }
.detail-main { display: flex; gap: 26px; }
.detail-cover { width: 220px; flex-shrink: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .14); }
.detail-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.detail-info { flex: 1; }
.detail-title { font-size: 28px; font-weight: 800; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 14px 0; color: var(--text-muted); font-size: 14px; }
.meta-pill { background: var(--brand-soft); color: #fff; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.detail-meta .status { color: var(--accent); font-weight: 700; }
.detail-intro { font-size: 15px; color: var(--text); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { border: 1px solid var(--border); color: var(--text-muted); padding: 3px 12px; border-radius: 999px; font-size: 13px; }
.detail-actions { display: flex; gap: 12px; margin-top: 20px; }
.detail-section { margin-top: 26px; }
.detail-section h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.episode-list { display: flex; flex-wrap: wrap; gap: 10px; }
.episode { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 7px 16px; border-radius: 12px; font-size: 14px; }
.episode:hover { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }

/* ---------- 个人中心 ---------- */
.profile { display: flex; align-items: center; gap: 18px; background: var(--surface); border-radius: 18px; padding: 22px; box-shadow: 0 10px 28px rgba(40, 90, 80, .1); margin-bottom: 20px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-soft), var(--brand)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; flex-shrink: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .14); }
.profile-info h2 { font-size: 20px; font-weight: 800; }
.profile-info p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.tabs { display: flex; gap: 8px; margin: 20px 0; border-bottom: 2px solid var(--border); }
.tab { border: 0; background: none; padding: 10px 18px; font-size: 15px; font-weight: 700; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 40px; background: var(--footer-bg); color: var(--footer-text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 40px 0 24px; }
.footer-brand .footer-site-name { font-size: 22px; font-weight: 800; color: #fff; white-space: nowrap; }
.footer-brand .footer-site-title { font-size: 14px; color: var(--footer-text); margin-top: 8px; }
.footer-brand p.desc { font-size: 13px; color: var(--footer-text); margin-top: 12px; max-width: 300px; }
.footer-col h3 { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.footer-col li { margin-bottom: 8px; font-size: 14px; }
.footer-col a { color: var(--footer-text); }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding: 18px 0 26px; font-size: 13px; color: var(--footer-text); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .slides { height: 300px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav { flex: 0 0 auto; }
  .nav-menu { position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--brand-deep); flex-direction: column; padding: 8px 16px 16px; display: none; box-shadow: 0 12px 20px rgba(0, 0, 0, .2); }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px 14px; }
  .nav-menu a.active { background: #fff; color: var(--brand-deep); }
  .search-form { margin-left: 0; }
  .search-form input { width: 120px; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-main { flex-direction: column; }
  .detail-cover { width: 100%; max-width: 240px; margin: 0 auto; }
  .slides { height: 220px; }
  .slide-caption h3 { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .app-guide { flex-direction: column; align-items: flex-start; }
  .rank-item { gap: 12px; padding: 10px 12px 16px; }
}
