/* dhamma.yidao.online 站点样式：跟一道主站共用同一套配色/字体，移动优先，阅读为主 */
:root {
  --bg: #faf8f4;
  --fg: #2d2a26;
  --muted: #6f685d;
  --accent: #7a5c3e;
  --card: #ffffff;
  --border: #e8e2d8;
  --badge-bg: #f3eee6;
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 17px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17; --fg: #d8d2c8; --card: #262320;
    --border: #3a362f; --badge-bg: #2a2622; --accent: #c9a87c;
    --muted: #8a8378;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  line-height: 1.9;
}
main { max-width: 42rem; margin: 0 auto; padding: 1rem 1.2rem 3rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.45; margin: 1rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; color: var(--accent); }
p { margin: 0 0 1.1em; }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.2rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.site-name { font-size: 1.05rem; font-weight: 700; letter-spacing: .15em; color: var(--fg); }
.site-name.home-link { font-weight: 400; letter-spacing: normal; color: var(--accent); }
.site-name.home-link:hover { text-decoration: underline; }

/* 未定稿状态提示条 */
.status-badge {
  display: inline-block; background: var(--badge-bg); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .2rem .8rem; font-size: .82rem; margin: .3rem 0 1.2rem;
}
.draft-notice {
  background: var(--badge-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: .8rem 1rem; color: var(--muted); font-size: .88rem; margin: 0 0 1.5rem;
}

/* 系列/章节列表 */
.series-list, .toc-list { list-style: none; padding: 0; margin: 1rem 0; }
.series-list li, .toc-list li {
  border-bottom: 1px solid var(--border); padding: .9rem 0;
}
.series-list a, .toc-list a { color: var(--fg); font-size: 1.02rem; }
.toc-list .toc-status { color: var(--muted); font-size: .8rem; margin-left: .6rem; }
.series-list .series-desc { color: var(--muted); font-size: .85rem; margin-top: .2rem; }

/* 章节间导航 */
.chapter-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .9rem;
}
.chapter-nav a { flex: 1; }
.chapter-nav .next { text-align: right; }
.chapter-nav .placeholder { color: var(--border); }
.back-link { display: block; margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }

.hero { text-align: center; padding: 1.6rem 0 .6rem; }
.hero h1 { font-size: 1.7rem; }
.hero .intro { color: var(--muted); font-size: .9rem; }

/* 划词评论 */
mark.commented {
  background: rgba(122,92,62,.18); color: inherit; border-bottom: 2px solid var(--accent);
  cursor: pointer; padding: 0 .05em;
}
.add-comment-btn {
  position: absolute; z-index: 30; background: var(--accent); color: var(--bg);
  border: none; border-radius: 6px; padding: .35rem .7rem; font-size: .82rem;
  cursor: pointer; font-family: inherit; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.add-comment-form {
  position: fixed; z-index: 31; right: 1rem; top: 4.5rem;
  width: min(85vw, 20rem); max-height: calc(100vh - 6rem); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.add-comment-form .quote-preview {
  color: var(--muted); font-size: .85rem; margin-bottom: .6rem; max-height: 4.5em; overflow: auto;
}
.add-comment-form input, .add-comment-form textarea {
  width: 100%; box-sizing: border-box; padding: .5rem .7rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--fg); font-family: inherit;
  font-size: .92rem; margin-bottom: .6rem;
}
.add-comment-form textarea { min-height: 5rem; resize: vertical; }
.add-comment-form .ac-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.add-comment-form button { padding: .4rem .9rem; border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--fg); cursor: pointer; font-family: inherit; font-size: .88rem; }
.add-comment-form .ac-submit { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.add-comment-form .ac-err { color: #b5533c; font-size: .82rem; margin-top: .4rem; }

.comments-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 20;
  background: var(--accent); color: var(--bg); border: none; border-radius: 999px;
  padding: .6rem 1.1rem; font-size: .88rem; cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.comments-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(90vw, 22rem);
  background: var(--card); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .2s ease; z-index: 25;
  display: flex; flex-direction: column;
}
.comments-panel.open { transform: translateX(0); }
.comments-panel-head {
  padding: .9rem 1rem; border-bottom: 1px solid var(--border); font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.comments-panel-head button { background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; }
.comments-list { overflow-y: auto; padding: .5rem 1rem; }
.comments-empty { color: var(--muted); font-size: .85rem; }
.comment-item { border-bottom: 1px solid var(--border); padding: .8rem 0; }
.comment-item.flash { background: var(--badge-bg); }
.comment-quote { color: var(--accent); font-size: .85rem; margin-bottom: .3rem; }
.comment-body { font-size: .92rem; margin-bottom: .3rem; }
.comment-meta { color: var(--muted); font-size: .78rem; }
