/* 萝卜真题 · site.css 原型 v3（移动优先：底部标签栏 + 表格卡片化） */
:root {
  --brand: #E8650C;
  --brand-dark: #C2540A;
  --brand-soft: #FDEEDF;
  --teal: #0F6E56;
  --teal-soft: #E1F5EE;
  --ink: #2C2C2A;
  --muted: #77746C;
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --line: #E8E4DB;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--brand); }

/* ---- 头部（移动端只放品牌，导航走底部标签栏） ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  height: 52px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.brand:hover { color: var(--brand); }
.main-nav { display: none; }
.main-nav a {
  padding: 6px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
}
.main-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }

/* ---- 底部标签栏（移动端主导航） ---- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 30;
  height: calc(54px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); font-weight: 500; }
.tabbar { display: flex; }
body { padding-bottom: calc(54px + env(safe-area-inset-bottom) + 10px); }

/* ---- 版心 ---- */
.layout { max-width: 1080px; margin: 0 auto; padding: 18px 14px 30px; }

/* ---- 首页 hero ---- */
.hero {
  background: linear-gradient(180deg, #FFF7EE 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 18px;
  text-align: center;
  margin-bottom: 24px;
}
.hero h1 {
  margin: 12px 0 8px;
  font-size: 25px;
  line-height: 1.35;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 14.5px; }
.hero .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 9px 24px;
  border-radius: 10px;
  font-size: 14.5px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal); }

/* ---- 卡片 ---- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 14px;
  font-size: 18px;
  font-weight: 600;
}
.section-title small { color: var(--muted); font-weight: 400; font-size: 13px; }
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 15px;
  display: block;
  color: var(--ink);
  position: relative;
  transition: border-color .15s;
}
.cat-card:hover { border-color: var(--brand); color: var(--ink); }
.cat-card .cc-name { font-size: 16px; font-weight: 600; margin: 8px 0 3px; }
.cat-card .cc-sub { color: var(--muted); font-size: 13px; }
.cat-card .cc-count {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* ---- 文章列表 ---- */
.art-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.art-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.art-item:last-child { border-bottom: none; }
.art-item:hover { background: #FFFBF5; }
.art-item .ai-title { flex: 1; font-size: 15px; min-width: 0; }
.art-item .ai-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  white-space: nowrap;
}
.badge-hot { background: var(--brand-soft); color: var(--brand-dark); }

/* ---- 面包屑 ---- */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { margin: 0 5px; color: #C9C4B8; }

/* ---- 分类/赛事切换器（自动换行，不滚动） ---- */
.switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.switcher a {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
}
.switcher a:hover { border-color: var(--brand); color: var(--brand); }
.switcher a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- 分页 ---- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0 8px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .dots { border: none; background: none; }

/* ---- 文章/介绍页 ---- */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.doc h1 { font-size: 22px; margin: 0 0 10px; line-height: 1.4; }
.doc .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.doc .meta .tags a { margin-right: 4px; }
.doc h2 { font-size: 18px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc p { font-size: 15px; }
.files-card { margin: 18px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.files-card .fc-title {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
  padding: 10px 16px;
  font-size: 14px;
}

/* ---- 表格：桌面横向表格 / 移动端卡片化（无横向滚动） ---- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table.nice { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
table.nice th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  background: #F6F3EC;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.nice td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.nice tr:last-child td { border-bottom: none; }
table.nice tr:hover td { background: #FFFBF5; }
.next-hl { color: var(--brand-dark); font-weight: 500; }

@media (max-width: 767px) {
  .table-scroll { background: transparent; border: none; border-radius: 0; overflow: visible; }
  .table-scroll table.nice { display: block; background: transparent; }
  .table-scroll table.nice thead { display: none; }
  .table-scroll table.nice tbody { display: block; }
  .table-scroll table.nice tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
  }
  .table-scroll table.nice tr:last-child { margin-bottom: 0; }
  .table-scroll table.nice tr:hover td { background: transparent; }
  .table-scroll table.nice td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
    border-bottom: none;
    padding: 6px 16px;
    text-align: right;
    font-size: 14px;
  }
  .table-scroll table.nice td::before {
    content: attr(data-l);
    color: var(--muted);
    font-size: 12.5px;
    flex: none;
    text-align: left;
  }
  .table-scroll table.nice td:first-child {
    justify-content: flex-start;
    font-weight: 600;
    font-size: 15.5px;
    padding: 10px 16px 4px;
  }
  .table-scroll table.nice td:first-child::before { content: none; }
  /* 长文本表格（赛事介绍）：标签在上、内容在下堆叠 */
  .table-scroll.table-stack table.nice td { display: block; text-align: left; padding: 6px 16px; }
  .table-scroll.table-stack table.nice td::before { display: block; margin-bottom: 1px; }
  .table-scroll.table-stack table.nice td:first-child { padding-top: 12px; font-size: 16px; }
}

/* ---- 网盘页 ---- */
.pan-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pan-toolbar { padding: 12px 14px 11px; border-bottom: 1px solid var(--line); background: #FCFAF6; }
.pan-crumb { font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.pan-crumb a { color: var(--muted); }
.pan-crumb a:hover { color: var(--brand); }
.pan-crumb .sep { margin: 0 5px; color: #CFCABF; }
.pan-crumb em { font-style: normal; color: var(--ink); font-weight: 500; }
.pan-count { margin-top: 3px; font-size: 12px; color: #A9A49A; }
.pan-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.pan-list .pan-row:last-child { border-bottom: none; }
a.pan-row { color: var(--ink); -webkit-tap-highlight-color: transparent; }
a.pan-row:hover { background: #FFFBF5; }
a.pan-row:active { background: var(--brand-soft); }
.pr-ico { width: 22px; height: 22px; flex: none; }
.pr-ico svg { width: 100%; height: 100%; fill: #8A877E; }
.pr-ico.is-folder svg { fill: var(--brand); }
.pr-ico.is-pdf svg { fill: #E53935; }
.pr-ico.is-img svg { fill: #43A047; }
.pr-ico.is-vid svg { fill: #8E24AA; }
.pr-ico.is-up svg { fill: none; stroke: var(--teal); stroke-width: 2.4; }
.pr-main { flex: 1; min-width: 0; }
.pr-name { display: block; font-size: 14.5px; line-height: 1.5; word-break: break-all; }
.pr-name i { font-style: normal; color: var(--muted); font-size: 13px; }
.pr-sub { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }
.pr-side { display: none; }
.pr-chev { flex: none; width: 8px; height: 8px; border-top: 2px solid #CFCABF; border-right: 2px solid #CFCABF; transform: rotate(45deg); margin-left: 2px; }
.pan-group {
  position: sticky;
  top: 52px;
  z-index: 5;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-dark);
  background: #FCF6EC;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.pan-empty { padding: 36px 14px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---- 页头 ---- */
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 21px; margin: 0 0 6px; }
.page-head .ph-sub { color: var(--muted); font-size: 14px; }

/* ---- 相关链接块 ---- */
.doc .also { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.doc .also a { margin: 0 10px 0 0; }

/* ---- 页脚 ---- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 2;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }

/* ---- 平板/桌面增强 ---- */
@media (min-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .layout { padding: 24px 20px 56px; }
}
@media (min-width: 768px) {
  /* 桌面：顶部导航回归，收起底部标签栏 */
  .header-inner { height: 58px; padding: 0 20px; justify-content: flex-start; }
  .brand { font-size: 19px; }
  .main-nav { display: flex; gap: 4px; flex: 1; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
  .hero { padding: 48px 40px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .doc { padding: 36px 44px; }
  .doc h1 { font-size: 26px; }
  .doc h2 { font-size: 20px; }
  .art-item { padding: 15px 22px; }
  .art-item .ai-title { font-size: 15.5px; }
  .section-title { font-size: 20px; margin: 34px 0 16px; }
  .page-head h1 { font-size: 25px; }
  /* 网盘：桌面端信息改右侧双列 */
  .pan-row { padding: 10px 18px; min-height: 48px; }
  .pr-sub { display: none; }
  .pr-side { display: flex; gap: 24px; flex: none; }
  .ps-date { width: 90px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
  .ps-size { width: 74px; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-align: right; }
  .pan-group { top: 58px; padding: 6px 18px; }
}
@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 长正文移动端适配（P2 实测补）：图片自适应、长文件名/英文行换行 ---- */
.doc img { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.doc p, .doc li, .doc td, .doc th, .doc h1, .doc h2, .doc h3 { overflow-wrap: anywhere; }
.doc pre { overflow-x: auto; max-width: 100%; }
.files-card td:first-child { overflow-wrap: anywhere; }
