/* FateCouncil · 单师断盘（纸本主题，取自原站 light 变量） */
:root {
  --bg: #efe7d0;
  --bg-card: #f5efd9;
  --bg-raised: #fbf5e3;
  --bg-panel: #e8dfc8;
  --text: #1a1410;
  --text-2: #4a3e2e;
  --text-m: #8e7d63;
  --border: rgba(58, 38, 18, .18);
  --border-s: rgba(58, 38, 18, .34);
  --seal: #8a1f1a;
  --seal-warm: #a8392c;
  --seal-soft: rgba(138, 31, 26, .08);
  --qing: #2b6a76;
  --qing-line: rgba(43, 106, 118, .26);
  --lv: #34775a;
  --shadow-sm: 0 2px 12px rgba(58, 38, 18, .07);
  --shadow: 0 8px 40px rgba(58, 38, 18, .1);
  --radius: 8px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, SimSun, serif;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 250, 232, .85), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(58, 38, 18, .05), transparent 70%),
    url("/bg/council-qinglv-wide.webp");
  background-size: cover, cover, cover;
  background-position: center top, center bottom, center center;
  background-attachment: fixed, fixed, fixed;
  background-blend-mode: normal, multiply, luminosity;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(239, 231, 208, .82);
  z-index: -1;
}

.hidden { display: none !important; }

/* ---------------- header ---------------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(245, 239, 217, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.brand b {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--text);
}
.brand em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--text-m);
  text-transform: uppercase;
}

.nav { display: flex; gap: 6px; }
.nav button, .nav a {
  font: inherit;
  font-size: 13px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  transition: .15s;
}
.nav button:hover, .nav a:hover { background: var(--bg-raised); border-color: var(--border); }
.nav button.on { background: var(--bg-raised); border-color: var(--border-s); color: var(--text); }

/* ---------------- layout ---------------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 34px 24px 120px; }
.wrap.wide { max-width: 1000px; }

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-m);
  margin: 0 0 10px;
}

h1.title {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.5;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: .02em;
}

h2.sub {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
}

.lede { color: var(--text-2); margin: 0 0 26px; font-size: 14px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 16px; }

/* ---------------- form ---------------- */
.grid { display: grid; gap: 14px 18px; grid-template-columns: 1fr 1fr; }
.grid .full { grid-column: 1 / -1; }

label.f { display: block; }
label.f > span {
  display: block;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--text-m);
  margin-bottom: 5px;
}

input[type=text], input[type=date], input[type=time], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--qing-line);
  box-shadow: 0 0 0 3px rgba(43, 106, 118, .08);
}

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 13px;
  padding: 8px 18px;
  background: var(--bg-raised);
  border: none; cursor: pointer; color: var(--text-2);
  transition: .15s;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--seal); color: #fbf5e3; }

.checks { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--text-2); }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.row-end { display: flex; align-items: center; gap: 14px; margin-top: 22px; }

.btn {
  font: inherit;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 6px;
  border: 1px solid var(--seal);
  background: var(--seal);
  color: #fdf8ea;
  cursor: pointer;
  letter-spacing: .04em;
  transition: .15s;
}
.btn:hover { background: var(--seal-warm); border-color: var(--seal-warm); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border-s); }
.btn.ghost:hover { background: var(--bg-raised); color: var(--text); }
.btn.qing { background: var(--qing); border-color: var(--qing); color: #f7fbfa; }
.btn.qing:hover { filter: brightness(1.08); }

.hint { font-size: 12.5px; color: var(--text-m); }
.err { color: var(--seal); font-size: 13px; }

/* ---------------- chart strip ---------------- */
.pillars {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .08em;
}
.pillars i {
  font-style: normal;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--text-m);
  margin-right: 2px;
}
.pillars .sep { color: var(--border-s); margin: 0 2px; }
.pillars > span { white-space: nowrap; }

/* ---------------- master picker ---------------- */
.masters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }

.mcard {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: .16s;
}
.mcard:hover { border-color: var(--border-s); transform: translateY(-1px); }
.mcard.on {
  border-color: var(--seal);
  box-shadow: 0 0 0 3px var(--seal-soft);
  background: #fffaf0;
}
.mcard img {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: var(--bg-panel);
  filter: grayscale(.35) contrast(1.04);
  flex: none;
}
.mcard.on img { filter: none; }
.mcard .mbody { display: flex; flex-direction: column; min-width: 0; }
.mcard .mname { display: block; font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.4; }
.mcard .msub { display: block; font-size: 11px; letter-spacing: .14em; color: var(--text-m); line-height: 1.5; }
.mcard .mdesc { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 7px; }
.mcard .tick {
  position: absolute; top: 12px; right: 14px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border-s);
  display: grid; place-items: center;
  font-size: 11px; color: transparent;
}
.mcard.on .tick { background: var(--seal); border-color: var(--seal); color: #fff8ea; }

/* ---------------- reading stream ---------------- */
.sticky-bar {
  position: sticky; top: 57px; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 18px;
  background: rgba(245, 239, 217, .93);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sticky-bar .who { font-family: var(--serif); font-size: 15px; font-weight: 700; }
.sticky-bar .prog { font-size: 12px; color: var(--text-m); margin-left: auto; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lv); display: inline-block; }
.dot.busy { background: var(--seal); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.stream { display: flex; flex-direction: column; gap: 18px; }

.sec {
  border-left: 2px solid var(--border-s);
  padding-left: 18px;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sec-head {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 16px; font-weight: 700;
  margin-bottom: 6px;
}
.sec-head .no {
  font-family: var(--sans);
  font-size: 10.5px; letter-spacing: .2em; color: var(--text-m);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px;
}
.sec-body { white-space: pre-wrap; color: var(--text); font-size: 15px; line-height: 1.95; }
.sec-body:empty::after { content: "…"; color: var(--text-m); }
.sec-body p { margin: 0 0 .72em; }
.sec-body p:last-child { margin-bottom: 0; }
.sec-body ul { margin: 0; padding-left: 20px; }
.sec-body li { margin: 2px 0; }

.qa { display: flex; flex-direction: column; gap: 10px; }
.qline {
  align-self: flex-end;
  max-width: 78%;
  background: var(--seal-soft);
  border: 1px solid rgba(138, 31, 26, .18);
  border-radius: 12px 12px 3px 12px;
  padding: 9px 14px;
  font-size: 14px;
  white-space: pre-wrap;
}
.qline::before { content: "你"; display: block; font-size: 10.5px; letter-spacing: .18em; color: var(--seal); margin-bottom: 2px; }

/* ---------------- composer ---------------- */
.composer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 12px 24px 16px;
  background: linear-gradient(to top, rgba(239, 231, 208, .98) 60%, rgba(239, 231, 208, 0));
}
.composer .inner {
  max-width: 860px; margin: 0 auto;
  display: flex; gap: 10px; align-items: flex-end;
  background: var(--bg-raised);
  border: 1px solid var(--border-s);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.composer textarea {
  flex: 1;
  border: none; background: transparent; padding: 4px 2px;
  resize: none; max-height: 132px; line-height: 1.7;
  box-shadow: none !important;
}
.composer textarea:focus { box-shadow: none; }
.composer .send {
  flex: none; width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--seal); background: var(--seal); color: #fdf8ea;
  cursor: pointer; font-size: 16px; display: grid; place-items: center;
}
.composer .send:disabled { opacity: .35; cursor: not-allowed; }
.composer .meta {
  max-width: 860px; margin: 0 auto 6px;
  display: flex; gap: 10px; align-items: center;
  font-size: 11.5px; color: var(--text-m);
}
.composer .meta .sp { margin-left: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  font: inherit; font-size: 11.5px; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-card); color: var(--text-2); cursor: pointer;
}
.chips button:hover { border-color: var(--border-s); color: var(--text); }

/* ---------------- report ---------------- */
.report .sec { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 18px; }
.report .sec:first-child { border-top: none; padding-top: 0; }
.report .sec-body { font-size: 14.5px; }
.report ul { margin: 0; padding-left: 20px; }
.report li { margin: 3px 0; }

.rep-head {
  font-family: var(--serif);
  font-size: 27px; line-height: 1.55; font-weight: 700;
  margin: 0 0 18px;
}

.metrics {
  display: flex; gap: 22px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
  margin: 0 0 22px;
}
.metrics b { font-family: var(--serif); font-size: 16px; margin-right: 4px; }

/* ---------------- drawer ---------------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(26, 20, 16, .28);
  z-index: 50; opacity: 0; pointer-events: none; transition: .2s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 88vw;
  z-index: 60;
  background: var(--bg-card);
  border-left: 1px solid var(--border-s);
  box-shadow: -12px 0 40px rgba(58, 38, 18, .16);
  transform: translateX(102%);
  transition: transform .24s ease;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer h3 {
  font-family: var(--serif); font-size: 17px; margin: 0;
  padding: 18px 20px 12px; border-bottom: 1px solid var(--border);
}
.drawer .list { overflow-y: auto; padding: 8px; flex: 1; }
.ritem {
  display: block; width: 100%; text-align: left; font: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 11px 12px; cursor: pointer; color: inherit;
}
.ritem:hover { background: var(--bg-raised); border-color: var(--border); }
.ritem .t { font-size: 13.5px; font-weight: 600; }
.ritem .s { font-size: 11.5px; color: var(--text-m); margin-top: 2px; }
.ritem .h { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.drawer .empty { padding: 30px 20px; color: var(--text-m); font-size: 13px; text-align: center; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 10px);
  background: rgba(26, 20, 16, .9); color: #f7f0dd;
  font-size: 13px; padding: 8px 16px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 80;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .wrap { padding: 24px 16px 130px; }
  .grid { grid-template-columns: 1fr; }
  .masters { grid-template-columns: 1fr; }
  h1.title { font-size: 24px; }
  .hdr { padding: 10px 16px; }
  .brand em { display: none; }
  .composer { padding: 10px 14px 12px; }
}
