:root {
  --bg: #0b0f12;
  --panel: rgba(18, 24, 28, 0.92);
  --text: #e8e2d6;
  --muted: #9aa39a;
  --line: rgba(232, 226, 214, 0.12);
  --jade: #7d9b78;
  --jade-deep: #4f6b4c;
  --ink: #c7b28a;
  --danger: #b86a6a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  color: var(--text);
  background: var(--bg);
}
.mist {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(125, 155, 120, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 40% at 90% 20%, rgba(199, 178, 138, 0.12), transparent 50%),
    linear-gradient(180deg, #10161a 0%, #0b0f12 55%, #090c0e 100%);
}
.wrap { width: min(980px, calc(100% - 2rem)); margin: 0 auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  flex-wrap: wrap;
}
.back-bar { display: flex; align-items: center; }
.back-always {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(125,155,120,.18);
  border-radius: 999px;
  padding: .32rem .85rem;
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
  font-size: .92rem;
}
.back-always:hover { border-color: rgba(125,155,120,.7); background: rgba(125,155,120,.28); }
.brand {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.9rem;
  color: var(--text);
  text-decoration: none;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-family: "Noto Sans SC", sans-serif;
}
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.hero { padding: 2.8rem 0 1.4rem; }
.kicker {
  margin: 0;
  color: var(--jade);
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
}
.hero h1 {
  margin: 0.5rem 0 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.5rem, 8vw, 3.8rem);
  font-weight: 400;
}
.lead {
  max-width: 38rem;
  color: var(--muted);
  line-height: 1.8;
  font-family: "Noto Sans SC", sans-serif;
}
.notice {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.6;
}
.panel {
  margin: 1.1rem 0 1.6rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.panel h2 { margin: 0 0 0.4rem; font-size: 1.35rem; }
.desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.65;
  font-size: 0.95rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-family: "Noto Sans SC", sans-serif;
}
.card strong { display: block; margin-bottom: 0.35rem; color: var(--ink); }
.card span { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.item {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-family: "Noto Sans SC", sans-serif;
}
.item:last-child { border-bottom: 0; }
.item h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--ink); }
.item p { margin: 0; color: var(--muted); line-height: 1.65; white-space: pre-wrap; }
.meta { font-size: 0.8rem; color: var(--jade); margin-bottom: 0.35rem; }
.form {
  display: grid;
  gap: 0.65rem;
  max-width: 560px;
  font-family: "Noto Sans SC", sans-serif;
}
.form input, .form textarea, .form select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d1215;
  color: var(--text);
  font: inherit;
}
.form textarea { min-height: 140px; resize: vertical; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  background: var(--jade-deep);
  color: #eef5ee;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
}
.chip.active, .chip:hover { background: rgba(125,155,120,0.2); color: var(--text); }
.search {
  width: 100%;
  max-width: 420px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d1215;
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  margin-bottom: 0.9rem;
}
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  background: #1a221c; color: #fff; padding: 0.65rem 1rem; border-radius: 999px;
  opacity: 0; transition: opacity .2s; font-family: "Noto Sans SC", sans-serif; z-index: 20;
}
.toast.show { opacity: 1; }
.foot {
  padding: 1.5rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  justify-content: space-between;
  font-family: "Noto Sans SC", sans-serif;
}
.foot a { color: var(--ink); }

html { scroll-behavior: smooth; }
body {
  overflow-x: hidden;
  transition: background .35s, color .35s;
}
body.soft-night {
  --bg: #15130f;
  --panel: rgba(34, 31, 25, 0.92);
  --text: #f0e7d5;
  --muted: #b2aa9b;
  --line: rgba(240, 231, 213, 0.14);
  --jade: #99aa82;
  --jade-deep: #64735a;
}
button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: .45rem;
  width: 100%;
  padding: .8rem 0 .55rem;
  background: linear-gradient(180deg, rgba(11,15,18,.96), rgba(11,15,18,.82));
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
}
.header-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "brand tools" "nav nav";
  align-items: center;
  column-gap: 1rem;
  row-gap: .55rem;
}
.header-main .brand { grid-area: brand; }
.header-main .nav { grid-area: nav; }
.header-main .header-tools { grid-area: tools; justify-self: end; }
.site-header::before {
  content: "";
  position: fixed;
  left: 0; right: 0; top: 0;
  height: var(--header-h, 7.2rem);
  z-index: -1;
  background: inherit;
  border-bottom: 1px solid var(--line);
}
.header-tools { display: flex; align-items: center; gap: .4rem; }
.quick-search { display: flex; align-items: center; gap: .35rem; }
.quick-search input {
  width: 112px;
  padding: .42rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  transition: width .2s, border-color .2s;
}
.quick-search input:focus { width: 175px; border-color: var(--jade); }
.icon-btn, .ghost-btn, .tab, .random-btn, .action-btn {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.025);
  border-radius: 999px;
  padding: .5rem .78rem;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover, .ghost-btn:hover, .tab:hover, .random-btn:hover, .action-btn:hover {
  color: var(--text);
  border-color: rgba(125,155,120,.55);
  background: rgba(125,155,120,.12);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.section-head h2, .section-head p { margin: 0; }
.hex-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(circle at 85% 20%, rgba(125,155,120,.17), transparent 32%), rgba(255,255,255,.02);
  transition: border-color .3s, transform .3s;
}
.hex-card:hover { border-color: rgba(199,178,138,.4); transform: translateY(-2px); }
.hex-symbol { font-size: 3.5rem; color: var(--jade); float: right; line-height: 1; opacity: .8; }
.hex-name { font: 400 2.1rem "Ma Shan Zheng", cursive; color: var(--ink); }
.hex-text { font-size: 1.06rem; line-height: 1.8; max-width: 36rem; }
.hex-note { color: var(--muted); line-height: 1.7; }
.hex-actions, .content-actions, .flow-links, .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-top: 1rem;
}
.text-link { color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.card {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card::after {
  content: "";
  position: absolute;
  width: 130px; height: 130px;
  right: -70px; bottom: -85px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125,155,120,.22), transparent 68%);
  transition: transform .4s, opacity .4s;
  opacity: .35;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(125,155,120,.45);
  box-shadow: 0 14px 38px rgba(0,0,0,.22), inset 0 0 32px rgba(125,155,120,.04);
}
.card:hover::after { opacity: 1; transform: scale(1.5); }
.card .count { display: block; margin-top: .8rem; color: var(--jade); font-size: .78rem; }
.tabs { display: flex; gap: .35rem; margin: .8rem 0; }
.tab.active { color: var(--text); background: rgba(125,155,120,.2); }
.tag {
  display: inline-flex;
  padding: .18rem .5rem;
  border-radius: 999px;
  color: var(--jade);
  background: rgba(125,155,120,.12);
  font-size: .76rem;
  text-decoration: none;
}
.clickable-item { cursor: pointer; transition: background .2s, transform .2s; border-radius: 12px; padding-inline: .7rem; }
.clickable-item:hover { background: rgba(255,255,255,.025); transform: translateX(3px); }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.read-count { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.fragment {
  position: relative;
  padding: 1.2rem 1.2rem 1.2rem 2.4rem;
  color: var(--muted);
  line-height: 1.9;
}
.fragment::before { content: "“"; position: absolute; left: .2rem; top: -.3rem; color: var(--jade); font: 4rem serif; opacity: .45; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .55rem; margin: .8rem 0 1rem; }
.tag-cloud .chip { font-size: calc(.82rem + var(--weight, 0) * .08rem); }
.note-card, .story-card, .message-card, .masonry-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 1rem;
  margin: .75rem 0;
  background: rgba(255,255,255,.018);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.note-card:hover, .story-card:hover, .message-card:hover, .masonry-card:hover {
  border-color: rgba(125,155,120,.35);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.note-body[hidden] { display: none; }
.note-body { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.masonry { columns: 3 240px; column-gap: .9rem; }
.masonry-card { break-inside: avoid; margin-top: 0; }
.read-badge { color: var(--jade); font-size: .75rem; }
.search-tools { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: .55rem; align-items: center; }
.search-count { margin: .75rem 0 .2rem; }
.search-tools .search { max-width: none; margin: 0; }
.select {
  border: 1px solid var(--line);
  background: #0d1215;
  color: var(--text);
  border-radius: 12px;
  padding: .7rem;
}
.file-field { display: grid; gap: .35rem; }
.file-field[hidden] { display: none !important; }
.file-field input[type="file"] { color: var(--muted); }
.story-video {
  width: 100%;
  max-height: 70vh;
  margin: 1rem 0;
  border-radius: 14px;
  background: #05080a;
}
.video-card video { width: 100%; max-height: 180px; border-radius: 10px; background: #05080a; margin-bottom: .4rem; }
.empty { color: var(--muted); padding: 1rem 0; }
.success-box {
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(125,155,120,.4);
  border-radius: 14px;
  background: rgba(125,155,120,.1);
}
.check-row { display: flex; align-items: center; gap: .55rem; color: var(--muted); }
.check-row input { width: auto; }
.volume-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .8rem; margin-top: 1rem; color: var(--muted); }
.volume-row input { accent-color: var(--jade); }
.login-options { display: grid; gap: .7rem; margin: 1rem 0; }
.login-provider {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  cursor: pointer;
}
.login-provider:disabled { cursor: not-allowed; opacity: .48; }
.login-provider.qq { border-color: rgba(18,183,245,.4); }
.login-provider.wechat { border-color: rgba(9,187,7,.4); }
.login-provider small { color: var(--muted); }
.account-summary { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.account-summary img, .avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: .35rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.captcha-row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.captcha-row img { width: 150px; height: 48px; border: 1px solid var(--line); border-radius: 9px; }
.captcha-row input { width: 140px; }
.danger-btn {
  border: 1px solid rgba(184,106,106,.45);
  color: #d89a9a;
  background: rgba(184,106,106,.08);
  border-radius: 999px;
  padding: .45rem .75rem;
  cursor: pointer;
}
.status-badge { display: inline-flex; padding: .2rem .5rem; border-radius: 999px; font-size: .75rem; background: rgba(125,155,120,.14); color: var(--jade); }
.status-badge.pending { color: #d2b56f; background: rgba(210,181,111,.12); }
.status-badge.rejected, .status-badge.deleted { color: #d89a9a; background: rgba(184,106,106,.1); }
.detail-shell { max-width: 760px; margin-inline: auto; }
.cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-bottom: .8rem; }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin: .4rem 0 1rem; }
.article-body { font-size: 1.05rem; line-height: 2; color: #d4cfc5; white-space: pre-wrap; }
.hero h1.article-title, .article-title {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.45;
  margin: .6rem 0 1rem;
  overflow-wrap: anywhere;
}
.account-form, .comment-form { display: grid; gap: .7rem; margin-top: .8rem; }
.account-form label, .comment-form textarea { display: grid; gap: .35rem; color: var(--muted); }
.account-form input, .comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
  color: var(--text);
  border-radius: 12px;
  padding: .7rem .8rem;
}
.captcha-row { align-items: center; }
.captcha-row img { height: 48px; border-radius: 8px; }
.comment-list { display: grid; gap: .7rem; }
.comment-card { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.comment-card p { margin: .35rem 0 0; white-space: pre-wrap; }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .7rem; }
.chapter-card {
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: .7rem .4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,.02);
}
.chapter-card strong { font-weight: 500; font-size: .92rem; }
.gua-wrap { display: flex; justify-content: center; margin: .4rem 0 1rem; }
.plain-note p { line-height: 1.9; }
.chapter-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.chapter-links a, .back-link a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .75rem;
}
.canon-chapter { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.canon-text, .canon-block { white-space: pre-wrap; line-height: 2; color: #d4cfc5; }
.yao {
  display: block;
  width: 100%;
  text-align: left;
  margin: .45rem 0;
  padding: .8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  line-height: 1.8;
  cursor: pointer;
}
.yao.open { border-color: var(--jade); }
.yao-note {
  margin: 0 0 .8rem;
  padding: .8rem 1rem;
  border-left: 2px solid var(--jade);
  color: var(--muted);
  line-height: 1.8;
}
.yao-note ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.recommend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: .7rem; }
.recommend-card { padding: .85rem; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: .4rem; }
.calendar-head { color: var(--jade); text-align: center; font-size: .8rem; padding: .4rem 0; }
.calendar-day {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.calendar-day:hover, .calendar-day.today { border-color: var(--jade); color: var(--text); }
.calendar-day small { display: block; margin-top: .35rem; color: var(--jade); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3,6,7,.78);
  backdrop-filter: blur(10px);
}
.modal {
  position: relative;
  width: min(620px,100%);
  max-height: min(80vh,720px);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #11171a;
  box-shadow: 0 28px 90px rgba(0,0,0,.5);
}
.modal h2 { margin-top: 0; }
.modal-close { position: absolute; right: .8rem; top: .6rem; border: 0; background: none; color: var(--muted); font-size: 1.7rem; cursor: pointer; }
.imprint-row { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.imprint-row small { color: var(--muted); }
.floating-tools { position: fixed; z-index: 20; right: 1rem; bottom: 1rem; }
.floating-tools button {
  border: 1px solid rgba(125,155,120,.4);
  border-radius: 999px;
  padding: .7rem .95rem;
  color: var(--text);
  background: rgba(20,28,25,.9);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.cursor-glow {
  position: fixed;
  z-index: -1;
  left: -100px; top: -100px;
  width: 180px; height: 180px;
  margin: -90px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(125,155,120,.09), transparent 68%);
}
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s, transform .55s; }
.reveal.revealed { opacity: 1; transform: none; }
.liked { color: #d69b96; border-color: rgba(214,155,150,.5); }

@media (max-width: 760px) {
  .wrap { width: min(100% - 1.15rem, 980px); }
  .site-header { position: relative; align-items: flex-start; }
  .site-header::before { display: none; }
  .header-main { grid-template-columns: 1fr; grid-template-areas: "brand" "nav" "tools"; }
  .header-main .header-tools { justify-self: stretch; }
  .brand { width: auto; }
  .nav {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: .35rem;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; background: rgba(255,255,255,.025); }
  .header-tools { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-search { min-width: 0; grid-column: 1 / -1; }
  .quick-search input, .quick-search input:focus { width: 100%; }
  .icon-btn { width: 100%; padding-inline: .5rem; }
  .hero { padding-top: 1.5rem; }
  .panel { padding: 1rem; border-radius: 15px; }
  .grid { grid-template-columns: 1fr; }
  .search-tools { grid-template-columns: 1fr 1fr; }
  .search-tools .search { grid-column: 1 / -1; }
  .calendar-grid { gap: .22rem; }
  .calendar-day { min-height: 56px; padding: .3rem; font-size: .8rem; }
  .calendar-day small { font-size: .66rem; overflow: hidden; white-space: nowrap; }
  .floating-tools button span { display: none; }
  .foot { padding-bottom: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .cursor-glow { display: none; }
}
