/* 听山 TINGSHAN · 视觉：米白极简 + 三列瀑布流 + 图内悬停信息 */
:root {
  --bg: #faf8f4;
  --ink: #2a2a26;
  --muted: #8b877c;
  --line: #e6e1d7;
  --accent: #9a7b4f;
  --panel: #ffffff;
  --side-w: 320px;
}
html[data-theme="dark"] {
  --bg: #171714;
  --ink: #e9e5dc;
  --muted: #8f8b81;
  --line: #2d2c26;
  --accent: #c2a473;
  --panel: #1e1e1a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
::selection { background: rgba(154, 123, 79, 0.22); }

/* ---------------- 侧栏 ---------------- */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  padding: 42px 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: var(--bg);
  z-index: 40;
  transition: transform 0.4s, background 0.4s;
}
.brand { display: flex; align-items: baseline; gap: 10px; font-size: 15px; letter-spacing: 0.16em; }
.brand__sep { color: var(--muted); font-weight: 300; }
#brand-zh { letter-spacing: 0.3em; }
.side__top { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.nav { margin-top: 40px; display: flex; align-items: stretch; gap: 20px; }
.nav__list { display: grid; gap: 6px; align-content: start; flex: none; }
.nav__cat {
  position: relative; height: 30px; display: flex; align-items: center;
  min-width: 44px; font-size: 15px; letter-spacing: 0.08em; color: var(--muted);
  text-align: left; transition: color 0.3s;
}
.nav__cat:hover { color: var(--ink); }
.nav__cat.is-active { color: var(--ink); }
.nav__cat.is-active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}
.nav__panel { display: flex; gap: 18px; animation: navIn 0.25s ease; }
.nav__line { width: 1px; background: var(--accent); opacity: 0.5; align-self: stretch; }
.nav__tags {
  display: grid; grid-auto-flow: column; gap: 6px 26px;
  align-content: start; justify-content: start;
}
.nav__tag {
  height: 30px; display: flex; align-items: center;
  font-size: 12px; letter-spacing: 0.04em; color: var(--muted);
  white-space: nowrap; text-align: left; transition: color 0.25s;
}
.nav__tag:hover, .nav__tag.is-active { color: var(--accent); }
@keyframes navIn {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}
.tags { display: none; }
.side__bottom { display: grid; gap: 20px; }
.switchers { display: flex; align-items: center; justify-content: space-between; gap: 22px; width: 100%; }
.langs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.langs i { font-style: normal; opacity: 0.4; }
.langs span.is-active { color: var(--ink); }
.theme { width: 22px; height: 22px; color: var(--muted); display: grid; place-items: center; }
.theme svg { width: 18px; height: 18px; }
.socials { display: flex; flex-wrap: wrap; gap: 12px; }
.socials a { width: 20px; height: 20px; color: var(--muted); transition: color 0.3s; }
.socials a:hover { color: var(--ink); }
.socials svg { width: 20px; height: 20px; }
.side-toggle { display: none; }

/* ---------------- 主区 ---------------- */
.main { margin-left: var(--side-w); padding: 42px 46px 90px; min-height: 100vh; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: 0.12em; }
.section-head span { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }

/* ---------------- 首页 ---------------- */
.hero { position: relative; margin: -42px -46px 0; height: min(82vh, 900px); min-height: 420px; background: #14140f; overflow: hidden; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero__slide.is-active { opacity: 1; }
.hero__slide img { width: 100%; height: 100%; object-fit: cover; }
.hero__veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0) 55%); pointer-events: none; }
.hero__caption { position: absolute; left: 48px; bottom: 42px; color: #fff; max-width: 70%; }
.hero__title { margin: 0 0 12px; font-size: 24px; font-weight: 400; letter-spacing: 0.06em; }
.hero__meta { font-size: 12px; letter-spacing: 0.12em; opacity: 0.75; }
.badge-collect { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 12px; letter-spacing: 0.1em; }
.badge-collect::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d8c08a; }
.hero__nav { position: absolute; inset: 50% 0 auto; display: flex; justify-content: space-between; padding: 0 22px; transform: translateY(-50%); }
.hero__nav button { width: 42px; height: 42px; color: #fff; opacity: 0.55; font-size: 30px; line-height: 1; transition: opacity 0.3s; }
.hero__nav button:hover { opacity: 1; }
.intro { max-width: 640px; margin: 72px 0 0; }
.intro p { margin: 0; font-size: 15px; line-height: 2.1; color: var(--muted); }
.intro .contact-line { margin-top: 26px; font-size: 13px; }
.intro .contact-line a { color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px; }

/* ---------------- 订阅 ---------------- */
.subscribe { margin-top: 84px; padding-top: 42px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.subscribe h3 { margin: 0 0 8px; font-size: 15px; font-weight: 400; letter-spacing: 0.1em; }
.subscribe p { margin: 0 0 20px; font-size: 12.5px; line-height: 1.9; color: var(--muted); }
.subscribe form { display: flex; gap: 12px; }
.subscribe input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 2px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s;
}
.subscribe input:focus { border-color: var(--accent); }
.subscribe button[type="submit"] { font-size: 13px; letter-spacing: 0.1em; color: var(--accent); white-space: nowrap; }
.subscribe .qr { width: 132px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 14px; }
.subscribe .msg { display: block; margin-top: 14px; font-size: 12px; color: var(--accent); min-height: 16px; }
.subscribe .note { font-size: 11.5px; color: var(--muted); margin-top: 12px; }

/* ---------------- 瀑布流 ---------------- */
.masonry { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; align-items: start; }
.masonry__col { display: grid; gap: 30px; align-content: start; }
.work { position: relative; cursor: pointer; }
.work__frame { position: relative; overflow: hidden; border-radius: 3px; background: var(--line); }
.work__frame img { width: 100%; height: auto; opacity: 0; transition: opacity 0.8s, transform 0.9s; }
.work__frame img.is-loaded { opacity: 1; }
.work:hover .work__frame img { transform: scale(1.025); }
.work__veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0.15) 55%, rgba(0,0,0,0));
  opacity: 0; transition: opacity 0.45s;
}
.work__info {
  position: absolute; left: 18px; right: 18px; bottom: 16px;
  text-align: right; color: #fff;
  font-size: 12px; line-height: 1.9; letter-spacing: 0.04em;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s, transform 0.45s;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
  pointer-events: none;
}
.work:hover .work__veil, .work:focus-visible .work__veil { opacity: 1; }
.work:hover .work__info, .work:focus-visible .work__info { opacity: 1; transform: none; }
.work__title { font-size: 14px; font-weight: 600; letter-spacing: 0.06em; }
.work__size { font-weight: 400; }
.work__line { opacity: 0.88; }
.work__tags { opacity: 0.72; letter-spacing: 0.08em; }
.work__play {
  position: absolute; left: 14px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.4); color: #fff;
  display: grid; place-items: center; font-size: 10px;
}
.empty { padding: 80px 0; color: var(--muted); font-size: 13px; letter-spacing: 0.1em; }
.footer { margin-top: 80px; padding-top: 26px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------- 详情弹层 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(12,12,10,0.86); padding: 40px; opacity: 0; transition: opacity 0.35s; }
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }
.modal__inner { background: var(--bg); max-width: 1060px; width: 100%; max-height: 88vh; overflow: auto; display: grid; grid-template-columns: 1.4fr 1fr; border-radius: 4px; }
.modal__media { background: #111; display: grid; place-items: center; }
.modal__media img, .modal__media video { width: 100%; height: 100%; max-height: 88vh; object-fit: contain; }
.modal__text { padding: 40px 34px; }
.modal__text h3 { margin: 0 0 6px; font-size: 21px; font-weight: 500; }
.modal__text .meta { font-size: 12px; color: var(--muted); line-height: 2.1; margin-bottom: 22px; }
.modal__text .desc { font-size: 13.5px; line-height: 2.1; color: var(--muted); white-space: pre-wrap; }
.modal__text .link { display: inline-block; margin-top: 26px; font-size: 13px; color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 3px; }
.modal__close { position: fixed; right: 28px; top: 22px; color: #fff; font-size: 30px; opacity: 0.7; z-index: 61; }
.modal__close:hover { opacity: 1; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s, transform 0.8s; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
  .masonry { gap: 22px; }
  .main { padding: 34px 30px 70px; }
  .hero { margin: -34px -30px 0; }
}
@media (max-width: 1024px) {
  .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subscribe { grid-template-columns: 1fr; gap: 40px; }
  .modal__inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --side-w: 290px; }
  .side { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,0.12); }
  body.side-open .side { transform: none; }
  .side-toggle {
    display: grid; gap: 5px; place-content: center;
    position: fixed; right: 18px; top: 18px; z-index: 50;
    width: 40px; height: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  }
  .side-toggle span { display: block; width: 18px; height: 1px; background: var(--ink); }
  .main { margin-left: 0; padding: 24px 20px 60px; }
  .hero { margin: -24px -20px 0; height: 68vh; min-height: 340px; }
  .hero__caption { left: 24px; bottom: 28px; }
  .hero__title { font-size: 19px; }
  .masonry { grid-template-columns: 1fr; }
  .work__info, .work__veil { opacity: 1; transform: none; }
  .modal { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================================
   前台 / 后台一体：编辑条、发布页、块编辑器
   ========================================================================= */
[hidden] { display: none !important; }

.editbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 70;
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.editbar__tag {
  flex: none; font-size: 10.5px; letter-spacing: .16em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 3px 9px;
}
.editbar__group { display: flex; align-items: center; gap: 4px; flex: none; }
.editbar__group:last-child { margin-left: auto; }
.editbar button { font-size: 12.5px; padding: 5px 10px; border-radius: 4px; color: var(--muted); white-space: nowrap; transition: .2s; }
.editbar button:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.editbar button.primary { background: var(--accent); color: #fff; }
.editbar button.primary:hover { opacity: .9; background: var(--accent); }
body.editing .main { padding-top: 96px; }
body.editing .side { padding-top: 98px; }

.new-work {
  margin-top: 26px; width: 100%; text-align: left;
  font-size: 12px; letter-spacing: .08em; color: var(--accent);
  border: 1px dashed var(--line); border-radius: 4px; padding: 9px 12px;
}
.new-work:hover { border-color: var(--accent); }
.home-actions { margin-top: 30px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 4px; padding: 9px 18px; font-size: 13px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn.danger { border: 1px solid rgba(170,80,60,.35); color: #b4533e; background: transparent; }
.btn.small { padding: 5px 11px; font-size: 12px; }

.work__edit {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  background: rgba(255,255,255,.94); color: #222; font-size: 11px; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 3px; opacity: 0; transition: .25s;
}
.work:hover .work__edit { opacity: 1; }

/* ---------------- 发布页 ---------------- */
.post { padding-top: 18px; }
.post--gallery {
  display: grid; grid-template-columns: minmax(0, 1fr) 258px; gap: 58px;
  max-width: 1080px; margin: 0 auto;
}
.post__body { min-width: 0; }
.blocks { display: grid; gap: 38px; }
.blk-wrap { position: relative; }
.blk--image { margin: 0; }
.blk--image img, .blk--video {
  display: block; width: 100%; height: auto; border-radius: 2px; background: var(--line);
}
.blk--text {
  margin: 0; font-size: 15px; line-height: 2.05; white-space: pre-wrap; letter-spacing: .01em;
}
.blk--text[contenteditable]:empty::before {
  content: attr(data-placeholder); color: var(--muted); opacity: .55;
}
.blk--text[contenteditable] { outline: none; border-radius: 3px; }
.blk--text[contenteditable]:focus { box-shadow: 0 0 0 1px var(--line); padding: 4px 8px; margin: -4px -8px; }
.blk-wrap.is-editable { padding: 6px; margin: -6px; border-radius: 4px; }
.blk-wrap.is-editable:hover { background: rgba(154,123,79,.045); }

.post__aside { position: sticky; top: 92px; align-self: start; padding-top: 6px; }
.post__title { margin: 0 0 14px; font-size: 19px; font-weight: 500; letter-spacing: .04em; line-height: 1.5; }
.post__meta { font-size: 12px; line-height: 2.05; color: var(--muted); }
.post__tags { margin-top: 14px; font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.post__link { display: inline-block; margin-top: 18px; font-size: 12.5px; color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.post__aside .btn { margin-top: 22px; margin-right: 8px; }

/* 右上角信息：编辑模式下逐项可改 */
.editable-field {
  outline: none; border-radius: 3px; cursor: text;
  transition: background .2s, box-shadow .2s;
}
.editable-field:hover { background: rgba(154,123,79,.06); }
.editable-field:focus { background: rgba(154,123,79,.09); box-shadow: 0 0 0 1px var(--line); }
.editable-field:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .5; }
.post__editions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; font-size: 11.5px; color: var(--muted);
}
.meta-num {
  width: 50px; padding: 3px 5px; font: inherit; font-size: 12px;
  color: var(--ink); background: transparent; border: 1px solid var(--line);
  border-radius: 3px; outline: none;
}
.meta-num:focus { border-color: var(--accent); }
.post__editions input[type="checkbox"] { width: auto; margin-left: 4px; accent-color: var(--accent); }
.post__cat {
  display: block; margin-top: 14px; font-size: 11.5px; color: var(--muted);
  border-bottom: 1px dashed var(--line); padding-bottom: 2px;
}
.post__cat:hover { color: var(--accent); border-color: var(--accent); }
.post__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag-chip {
  font-size: 11px; letter-spacing: .05em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px;
  transition: color .2s, border-color .2s;
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); }
.tag-chip--add { border-style: dashed; }
.post__linkable {
  margin-top: 18px; font-size: 12.5px; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
  overflow-wrap: anywhere; outline: none;
}
.post__linkable:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .6; }

/* 拖拽上传提示 */
.main.is-dragover::after {
  content: "松开鼠标，把图片或视频添加到作品里";
  position: fixed; inset: 52px 0 0 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(154,123,79,.1);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent); font-size: 14px; letter-spacing: .14em;
  pointer-events: none;
}

/* 块工具条 */
.blk-tools {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  display: flex; gap: 2px; padding: 5px; border-radius: 5px;
  background: rgba(22,21,17,.82); backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(-4px); transition: .22s; pointer-events: none;
}
.blk-wrap:hover > .blk-tools,
.essay__media:hover > .blk-tools,
.essay__text:hover > .blk-tools { opacity: 1; transform: none; pointer-events: auto; }
.blk-tool { color: #fff; font-size: 11px; line-height: 1.5; padding: 3px 8px; border-radius: 3px; white-space: nowrap; }
.blk-tool:hover { background: rgba(255,255,255,.18); }
.blk-tool.is-on { color: #e9cf9d; }
.blk-cover {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0,0,0,.58); color: #fff; font-size: 10px; letter-spacing: .12em;
  padding: 3px 9px; border-radius: 3px;
}

.addbar {
  position: sticky; bottom: 18px; z-index: 8;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 42px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0,0,0,.07);
}
.addbar button { font-size: 12.5px; color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.addbar button:hover { background: rgba(154,123,79,.1); color: var(--accent); }
.addbar__hint { margin-left: auto; font-size: 11px; color: var(--muted); }

.empty-blocks {
  padding: 60px 0; text-align: center; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 4px;
}

/* ---------------- 随笔模板 ---------------- */
.post--essay { max-width: 700px; margin: 0 auto; padding: 26px 0 20px; }
.essay__head { text-align: center; }
.essay__head h1 {
  margin: 0; font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 27px; font-weight: 400; letter-spacing: .05em;
}
.essay__rule { display: block; width: 74%; height: 1px; background: var(--line); margin: 20px auto 62px; }
.essay__rows { display: grid; gap: 66px; }
.essay__row { display: flex; align-items: center; gap: 28px; }
.essay__row.is-flip { flex-direction: row-reverse; }
.essay__media { position: relative; flex: 0 0 42%; min-width: 0; }
.essay__media-inner { position: relative; }
.essay__media img, .essay__media video { display: block; width: 100%; height: auto; border-radius: 2px; }
.essay__text { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; }
.essay__paragraph {
  margin: 0; font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 12.8px; line-height: 1.95; text-align: center; color: var(--muted);
  white-space: pre-wrap; outline: none; width: 100%;
}
.essay__paragraph[contenteditable]:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .5; }
.essay__paragraph[contenteditable]:focus { box-shadow: 0 0 0 1px var(--line); border-radius: 3px; padding: 4px; margin: -4px; }
.essay__media.is-editable { outline: 1px dashed transparent; transition: .2s; }
.essay__media.is-editable:hover { outline-color: var(--line); }
.essay__foot {
  margin-top: 70px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px;
  font-size: 11.5px; letter-spacing: .08em; color: var(--muted);
}

/* ---------------- 登录 ---------------- */
.auth { position: fixed; inset: 0; z-index: 92; display: grid; place-items: center; background: rgba(22,21,17,.5); backdrop-filter: blur(3px); }
.auth__box {
  width: min(360px, 92vw); background: var(--panel); border-radius: 8px;
  padding: 32px; display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.18);
}
.auth__box h1 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: .06em; }
.auth__box p { margin: -6px 0 6px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.auth__box input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 13px; background: transparent; color: var(--ink); outline: none; }
.auth__box input:focus { border-color: var(--accent); }
.auth__msg { min-height: 16px; font-size: 12px; color: #b4533e; }

/* ---------------- 信息抽屉 ---------------- */
.drawer {
  position: fixed; top: 52px; right: 0; bottom: 0; z-index: 76;
  width: 382px; max-width: 94vw;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  box-shadow: -24px 0 70px rgba(0,0,0,.1);
}
.drawer__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-size: 13px; letter-spacing: .08em;
}
.drawer__head button { font-size: 22px; line-height: 1; color: var(--muted); }
.drawer__body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.drawer__body label { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); }
.drawer__body input, .drawer__body select {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 12.5px;
  color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 4px; outline: none;
}
.drawer__body input:focus, .drawer__body select:focus { border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.checks label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink); }
.checks input { width: auto; }
.checkline { display: flex !important; align-items: center; gap: 6px; font-size: 12px !important; color: var(--ink) !important; }
.checkline input { width: auto !important; }
.drawer__hint { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 2px 0 6px; }

/* ---------------- 管理面板 ---------------- */
.panel-frame { position: fixed; inset: 0; z-index: 94; background: rgba(18,17,14,.45); display: flex; flex-direction: column; }
.panel-frame__bar {
  height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: 12px; letter-spacing: .06em;
}
.panel-frame__bar button { font-size: 12px; color: var(--accent); }
.panel-frame iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------------- 模板选择 ---------------- */
.tpl-mask { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; background: rgba(20,19,16,.55); backdrop-filter: blur(3px); }
.tpl-box { width: min(620px, 92vw); background: var(--panel); border-radius: 8px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.tpl-box h2 { margin: 0 0 6px; font-size: 17px; font-weight: 500; letter-spacing: .06em; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.tpl-card {
  text-align: left; display: grid; gap: 7px; padding: 20px;
  border: 1px solid var(--line); border-radius: 6px; transition: .2s;
}
.tpl-card:hover { border-color: var(--accent); background: rgba(154,123,79,.05); }
.tpl-card strong { font-size: 14px; font-weight: 500; }
.tpl-card span { font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 99;
  background: rgba(22,21,17,.9); color: #fff; font-size: 12.5px; letter-spacing: .04em;
  padding: 9px 18px; border-radius: 999px;
}

/* ---------------- 批量管理 ---------------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head__right { display: flex; align-items: center; gap: 18px; }
.batch-toggle {
  font-size: 12px; letter-spacing: .06em; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 15px;
  transition: .2s;
}
.batch-toggle:hover, .batch-toggle.is-on { border-color: var(--accent); background: rgba(154,123,79,.08); }
.work--batch .work__veil {
  opacity: 1;
  background: linear-gradient(180deg, rgba(20,18,14,.22) 0%, rgba(20,18,14,0) 32%, rgba(20,18,14,.66) 100%);
}
.work__delete {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 999px; background: rgba(20,18,14,.74); color: #fff;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
  transition: background .2s;
}
.work__delete:hover { background: #b4533e; }
.work.is-deleted { opacity: .38; }
.work.is-deleted .work__delete { font-size: 11px; }
.batch-info {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5;
  display: grid; gap: 2px; justify-items: end; text-align: right; color: #fff;
}
.batch-field {
  font-size: 11px; line-height: 1.7; letter-spacing: .05em;
  max-width: 100%; min-width: 34px; padding: 0 4px;
  outline: none; border-radius: 2px; cursor: text;
}
.batch-field:hover, .batch-field:focus { background: rgba(255,255,255,.18); }
.batch-field:empty::before { content: attr(data-placeholder); opacity: .6; }
.batch-title { font-size: 13px; font-weight: 600; }

.confirm-mask { position: fixed; inset: 0; z-index: 97; display: grid; place-items: center; background: rgba(20,19,16,.5); backdrop-filter: blur(3px); }
.confirm-box { width: min(430px, 92vw); background: var(--panel); border-radius: 8px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.confirm-box h3 { margin: 0 0 8px; font-size: 16px; font-weight: 500; letter-spacing: .04em; }
.confirm-box p { margin: 0 0 22px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.tag-add { display: flex; gap: 8px; margin-top: 2px; }
.tag-add input { flex: 1; min-width: 0; }
.tag-add button {
  flex: none; padding: 0 14px; font-size: 12px; color: var(--accent);
  border: 1px solid var(--line); border-radius: 4px;
}
.tag-add button:hover { border-color: var(--accent); }

@media (max-width: 1024px) {
  .post--gallery { grid-template-columns: 1fr; gap: 34px; }
  .post__aside { position: static; order: -1; padding-top: 0; }
}
@media (max-width: 760px) {
  body.editing .main { padding-top: 92px; }
  .editbar { gap: 8px; padding: 0 10px; height: auto; min-height: 52px; flex-wrap: nowrap; }
  .editbar__tag { display: none; }
  .editbar__group:last-child { margin-left: 0; }
  .post--essay { padding: 8px 0 10px; }
  .essay__head h1 { font-size: 22px; }
  .essay__rule { margin-bottom: 40px; }
  .essay__rows { gap: 46px; }
  .essay__row, .essay__row.is-flip { flex-direction: column; gap: 18px; }
  .essay__media { flex: none; width: 66%; margin: 0 auto; }
  .essay__paragraph { font-size: 13px; }
  .addbar { border-radius: 12px; }
  .addbar__hint { display: none; }
  .tpl-grid { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

