/* 国学术数馆 · 八栏共用样式。宣纸底 + 朱砂点缀，手机优先。
   改这一个文件影响全部八栏，部署用：Guoxue\deploy.ps1 -Only shared */

:root {
  --paper: #f6f1e6;
  --paper-2: #fffdf8;
  --ink: #2a2520;
  --ink-2: #5c5348;
  --ink-3: #8a7f70;
  --line: #ddd2bd;
  --red: #8c2b25;
  --red-2: #b23a30;
  --gold: #9a7b3f;
  --green: #3f6b4e;
  --radius: 12px;
  --wrap: 760px;
  --shadow: 0 1px 2px rgba(42, 37, 32, .06), 0 8px 24px rgba(42, 37, 32, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(154, 123, 63, .05) 0, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(140, 43, 37, .04) 0, transparent 50%);
  color: var(--ink);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */

.site-head {
  background: rgba(255, 253, 248, .92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.4) blur(6px);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-copy strong { font-size: 16px; letter-spacing: .08em; }
.brand-copy span { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }

/* 右上角功能切换器 */
nav.cross {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.col-switch {
  position: relative;
  flex-shrink: 0;
}
.col-switch-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 28px 8px 10px;
  min-height: 36px;
  max-width: 48vw;
  cursor: pointer;
}
.col-switch-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: var(--red);
  transform: translateY(2px);
}
.col-switch-btn:focus { outline: 2px solid rgba(140, 43, 37, .35); }
.sw-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.col-switch-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 11.5em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}
.col-switch[data-open="1"] .col-switch-menu { display: block; }
.sw-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}
.sw-item:hover { background: rgba(140, 43, 37, .08); text-decoration: none; }
.sw-item[aria-current="page"] { color: var(--red); font-weight: 600; }

/* ---------- 正文 ---------- */

main.wrap { padding-bottom: 40px; }

.crumb { font-size: 13px; color: var(--ink-3); margin: 16px 0 4px; }
.crumb a { color: var(--ink-3); }

h1 {
  font-size: 24px;
  line-height: 1.4;
  margin: 6px 0 10px;
  letter-spacing: .02em;
}

h2 {
  font-size: 18px;
  margin: 30px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--red);
  letter-spacing: .02em;
}

h3 { font-size: 16px; margin: 20px 0 6px; }

p { margin: 0 0 12px; }

.lead { color: var(--ink-2); }

.privacy {
  font-size: 13px;
  color: var(--green);
  background: rgba(63, 107, 78, .07);
  border-radius: 8px;
  padding: 8px 12px;
}

.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.prose b { color: var(--ink); }

/* ---------- 卡片网格 ---------- */

.grid-cols, .grid-cards {
  display: grid;
  gap: 10px;
  margin: 14px 0 8px;
}
.grid-cols { grid-template-columns: repeat(2, 1fr); }
.grid-cards { grid-template-columns: 1fr; }

.card {
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.card:hover { text-decoration: none; border-color: var(--red-2); }
.card b { display: block; font-size: 16px; margin-bottom: 4px; }
.card p { font-size: 13px; color: var(--ink-3); margin: 0; }

.col-card { position: relative; padding: 14px 12px 12px; text-align: center; }
.col-card .emblem {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
}
.col-card b { font-size: 15px; }
.col-card p { min-height: 2.6em; }
.col-card.is-live { border-color: rgba(140, 43, 37, .35); }
.hall-guide { padding-left: 22px; }
.hall-guide li { margin-bottom: 8px; }
.col-hub .crumb { display: none; }
.col-hub h1 { text-align: center; margin-top: 18px; }
.col-hub .lead { text-align: center; max-width: 36em; margin-left: auto; margin-right: auto; }
.card .tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--gold);
  border: 1px solid rgba(154, 123, 63, .4);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------- 建设中 / 规划列表 ---------- */

.building {
  font-size: 14px;
  color: var(--ink-2);
  background: rgba(154, 123, 63, .08);
  border: 1px dashed rgba(154, 123, 63, .45);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.planned { margin-top: 26px; }
.planned-note { font-size: 13px; color: var(--ink-3); }
.planned-list { list-style: none; padding: 0; margin: 10px 0 0; }
.planned-list li {
  border-bottom: 1px dashed var(--line);
  padding: 9px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.planned-list b { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.planned-list span { font-size: 13px; color: var(--ink-3); }

/* ---------- 工作台（各栏工具区） ---------- */

.workbench {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 16px 0 4px;
  box-shadow: var(--shadow);
}
.col-index .workbench { background: transparent; border: 0; padding: 0; box-shadow: none; }

.field { margin-bottom: 12px; }
.field > label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 5px;
}

input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(140, 43, 37, .35);
  border-color: var(--red);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  min-height: 38px;
  color: var(--ink-2);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}
.btn:active { background: var(--red-2); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

.result { margin-top: 14px; }
.result-head {
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* ---------- 怎么用 / FAQ / 相关 ---------- */

.howto ol { padding-left: 22px; }
.howto li { margin-bottom: 6px; }

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "问 "; color: var(--red); }
.faq details p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }

.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-list a {
  font-size: 13px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink-2);
}
.related-list a:hover { border-color: var(--red-2); color: var(--red); text-decoration: none; }

/* ---------- 免责 / 页脚 ---------- */

.disclaimer {
  margin-top: 30px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.site-foot {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, .7);
  padding: 18px 0 32px;
  font-size: 13px;
  color: var(--ink-3);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.site-foot p { margin: 0 0 6px; }
.disclaimer-foot { font-size: 12px; line-height: 1.7; }

/* ---------- toast ---------- */

.gx-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: rgba(42, 37, 32, .92);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 90;
  max-width: 88vw;
  text-align: center;
}

/* ---------- 宽屏 ---------- */

@media (min-width: 560px) {
  .grid-cols { grid-template-columns: repeat(3, 1fr); }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 27px; }
}

@media (min-width: 860px) {
  :root { --wrap: 820px; }
  .grid-cols { grid-template-columns: repeat(4, 1fr); }
  .col-switch { max-width: 260px; }
  .btn { width: auto; min-width: 200px; padding: 0 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
