/* 博客与论坛。阅读宽度收窄，列表和表单保持轻量。 */
@import url("account-widget.css");

:root {
  --brand: #0a9676;
  --brand-dark: #087a60;
  --brand-soft: #e7f6f2;
  --text: #1c2833;
  --muted: #5c6b7a;
  --line: #e3e9ef;
  --bg: #f5f7f8;
  --card: #fff;
  --warn: #b45309;
  --danger: #b42318;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 56px; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--brand-dark); }
a:hover { color: var(--brand); }

.c-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 18px;
  background: rgba(20, 28, 36, 0.94);
  color: #fff;
}

.c-brand {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.c-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.c-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}

.c-nav a:hover,
.c-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.c-wrap {
  width: min(920px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.c-article { width: min(760px, calc(100% - 32px)); }

.c-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 650;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.c-lead, .c-meta { color: var(--muted); margin: 0 0 20px; }

.c-card, .c-thread, .c-reply, .c-editor, .c-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.c-list { display: flex; flex-direction: column; gap: 10px; }

.c-card {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}

.c-card:hover { border-color: #b7ddd2; }

.c-card h2, .c-thread h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.c-card p { margin: 0; color: var(--muted); }

.c-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.c-tag, .c-level, .c-bounty, .c-pin {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
}

.c-bounty { background: #fff6e8; color: var(--warn); }
.c-pin { background: #eef2ff; color: #3730a3; }

.c-boards, .c-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.c-boards button, .c-btn, .c-btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.c-boards button[aria-pressed="true"], .c-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.c-btn-ghost { background: #fff; color: var(--text); }
.c-btn.danger, .c-btn-ghost.danger { color: var(--danger); border-color: #f0c9c6; background: #fff; }

.c-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  border: 1px solid #d5dee6;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  width: 100%;
}

textarea { min-height: 220px; resize: vertical; line-height: 1.6; }

.c-search input { flex: 1; }

.c-thread, .c-reply, .c-editor, .c-side { padding: 18px 20px; margin-bottom: 12px; }

.md h1, .md h2, .md h3 { margin: 1.2em 0 0.4em; letter-spacing: 0; }
.md h2 { font-size: 22px; }
.md h3 { font-size: 18px; }
.md p { margin: 0.7em 0; }
.md ul, .md ol { margin: 0.45em 0 0.9em; padding-left: 1.5em; }
.md li { margin: 0.32em 0; }
.md li > ul, .md li > ol { margin: 0.25em 0 0.35em; }
.md ul { list-style: disc; }
.md ul ul { list-style: circle; }
.md ul ul ul { list-style: square; }
.md ol { list-style: decimal; }
.md ol ol { list-style: lower-alpha; }
.md ol ol ol { list-style: lower-roman; }
.md img { max-width: 100%; height: auto; }
.md blockquote {
  margin: 1em 0;
  padding: 4px 0 4px 14px;
  border-left: 3px solid var(--brand);
  color: var(--muted);
}
.md img { border-radius: 8px; margin: 8px 0; }
.md pre {
  background: #15202b;
  color: #e7eef5;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.55;
}
.md code {
  font-family: Consolas, "Sarasa Mono SC", monospace;
  font-size: 0.92em;
}
.md p code, .md li code, .md blockquote code, .md h1 code, .md h2 code, .md h3 code {
  background: #e7f3ef;
  color: #0d5c49;
  padding: 1px 5px;
  border-radius: 4px;
}
.code-chip {
  font-family: Consolas, "Sarasa Mono SC", monospace;
  font-size: 0.92em;
  background: #e7f3ef;
  color: #0d5c49;
  padding: 0 5px;
  border-radius: 4px;
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }

.c-files { list-style: none; padding: 0; margin: 10px 0 0; }
.c-files a { text-decoration: none; }

.c-pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

.c-note {
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 12px 14px;
  color: #24584c;
  font-size: 14px;
}

.c-error {
  color: var(--danger);
  background: #fef2f2;
  border-radius: 8px;
  padding: 8px 10px;
}

.c-split {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
}

.c-foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 16px 28px;
}

.c-foot a { color: var(--muted); }

.admin-strip {
  background: #12382f;
  color: #d8fff3;
  text-align: center;
  font-size: 13px;
  padding: 6px 12px;
}

.admin-strip a { color: #fff; }

.md .math-inline { display: inline-block; vertical-align: middle; }
.md .math-display { display: block; margin: 0.85em 0; overflow-x: auto; overflow-y: hidden; }
.md .math-display .katex-display { margin: 0; }
.math-chip {
  display: inline-block;
  vertical-align: middle;
  padding: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}
.math-chip:hover { background: #f3f0e8; }

body[data-page="studio"].studio-on { overflow: hidden; height: 100vh; background: #fff; }
body[data-page="studio"].studio-on .c-header { flex: none; }

.studio-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: calc(100vh - 52px);
  background: #fff;
}
.studio-side {
  background: #f7f6f3;
  border-right: 1px solid #efeeea;
  overflow: auto;
  padding: 14px 12px 24px;
}
.studio-new, .studio-page, .studio-quiet {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.studio-new {
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 650;
  color: #3d3a34;
}
.studio-new:hover { background: #efece6; }
.studio-side-label {
  margin: 16px 8px 6px;
  color: #8d897f;
  font-size: 12px;
}
.studio-page {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 6px 8px;
  color: #3f3c36;
  font-size: 14px;
}
.studio-page:hover { background: #efece6; }
.studio-page[aria-current="true"] { background: #e7f3ef; color: #0d5c49; }
.studio-page-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-props { margin-top: 8px; }
.studio-props label, .studio-points label {
  display: block;
  margin: 8px 0 4px;
  color: #8d897f;
  font-size: 12px;
}
.studio-side input, .studio-side select, .studio-side textarea {
  font-size: 13px;
  background: #fff;
}
.studio-points { margin-top: 18px; color: #5c584f; font-size: 13px; }
.studio-points summary { cursor: pointer; }
.studio-quiet {
  margin-top: 8px;
  padding: 4px 2px;
  color: #a33b32;
  font-size: 13px;
}
.studio-main { overflow: auto; background: #fff; }
.studio-top {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.92);
}
.studio-status { margin-right: auto; color: #8d897f; font-size: 13px; }
.studio-doc {
  width: min(760px, calc(100% - 128px));
  margin: 8px auto 120px;
}
.studio-title {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.03em;
  min-height: 1.35em;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.studio-title:focus { outline: none; }
.studio-title::placeholder { color: #d0cdc6; }
.blk {
  position: relative;
  margin: 0;
  padding: 4px 0;
}
.blk-gutter {
  position: absolute;
  left: -48px;
  top: 6px;
  width: 46px;
  display: flex;
  gap: 2px;
  opacity: 0;
}
.blk:hover .blk-gutter,
.blk:focus-within .blk-gutter,
.blk.is-dragging .blk-gutter,
.blk.is-menu .blk-gutter { opacity: 1; }
.blk-add, .blk-grip {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b0aca4;
  cursor: pointer;
  font-size: 16px;
  line-height: 22px;
}
.blk-grip { cursor: grab; font-size: 13px; touch-action: none; }
.blk-add:hover, .blk-grip:hover { background: #f1efe9; color: #4d4942; }
body.is-reordering, body.is-reordering * { cursor: grabbing !important; }
body.is-reordering { user-select: none; }
.blk.is-dragging { opacity: 0.45; }
.blk.drop-before { box-shadow: inset 0 2px 0 #0a9676; }
.blk.drop-after { box-shadow: inset 0 -2px 0 #0a9676; }
.blk-body {
  min-height: 1.7em;
  padding: 2px 0;
  outline: none;
  font-size: 16.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.blk-body.is-empty:before {
  content: attr(data-ph);
  color: #c4c0b6;
  float: left;
  height: 0;
  pointer-events: none;
}
.blk-body.is-composing:before { content: none; }
body.is-cross-select .blk,
body.is-cross-select .blk * { user-select: none; }
body.is-cross-select ::selection { background: transparent; }
.blk-h1 .blk-body { font-size: 30px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.blk-h2 .blk-body { font-size: 24px; font-weight: 700; line-height: 1.35; }
.blk-h3 .blk-body { font-size: 19px; font-weight: 650; line-height: 1.4; }
.blk-quote .blk-main { border-left: 3px solid #e4e0d6; padding-left: 12px; }
.blk-quote .blk-body { color: #5e6570; }
.blk.is-selected .blk-main,
.blk.is-selected .blk-hr,
.blk.is-selected .blk-img {
  background: #f6d4d4;
  border-radius: 4px;
}
.blk-code.is-selected .blk-body,
.blk-math.is-selected .blk-body { background: transparent; }
.blk-list { display: flex; gap: 8px; align-items: flex-start; }
.blk-list .blk-body { flex: 1; min-width: 0; }
.blk-mark {
  width: 1.4em;
  flex: none;
  text-align: center;
  color: #8a867e;
  padding-top: 2px;
  user-select: none;
}
.blk-code .blk-body, .blk-math .blk-body {
  font-family: Consolas, "Sarasa Mono SC", monospace;
  font-size: 14px;
  line-height: 1.55;
  background: #f6f5f2;
  border-radius: 8px;
  padding: 10px 12px;
}
.lang-select {
  width: auto;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8d897f;
  font-size: 12px;
}
.blk-math-out { overflow-x: auto; padding: 6px 2px; }
.blk-math-out:empty { display: none; }
.blk-math.has-preview:not(:focus-within) .blk-body { display: none; }
.blk-math.has-preview:not(:focus-within) .blk-math-out { cursor: text; min-height: 1.6em; }
.blk-hr { display: flow-root; }
.blk-hr hr { border: 0; border-top: 1px solid #e6e2da; margin: 14px 0; }
.blk.is-selected .blk-hr hr { border-top-color: #c99292; }
.blk-img img { max-width: 100%; border-radius: 8px; display: block; }
.img-alt {
  margin-top: 6px;
  border: 0;
  padding: 2px 0;
  color: #8d897f;
  font-size: 13px;
  background: transparent;
}
.img-remove {
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #a33b32;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-size: 12px;
}
.studio-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}
.studio-quick button {
  border: 1px solid #eceae4;
  background: #fff;
  color: #5f5b54;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.studio-quick button:hover { background: #f7f6f3; }
.slash-menu {
  position: fixed;
  z-index: 40;
  width: 260px;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #eceae4;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(40, 36, 28, 0.12);
}
.slash-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.slash-item.is-active, .slash-item:hover { background: #f4f1ea; }
.slash-ico {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #eceae4;
  border-radius: 8px;
  color: #5f5b54;
  font-size: 12px;
  background: #fff;
}
.slash-item b { display: block; font-weight: 650; font-size: 14px; }
.slash-item small { display: block; color: #8d897f; font-size: 12px; }
.studio-view { font-size: 13px; }

/* 博客阅读页：系统字体 + 纯 CSS，不额外请求字体或脚本。 */
.page-read {
  background:
    radial-gradient(1200px 420px at 50% -80px, rgba(10, 150, 118, 0.08), transparent 60%),
    #f3f6f4;
}
.c-read {
  width: min(740px, calc(100% - 32px));
  margin: 28px auto 56px;
}
.c-sheet {
  background: #fff;
  border: 1px solid #e4ebe7;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(22, 40, 34, 0.04), 0 18px 40px rgba(22, 40, 34, 0.05);
  padding: 36px 42px 44px;
}
.c-sheet-head { margin-bottom: 1.35em; }
.page-read .c-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.page-read .c-kicker a { color: var(--brand-dark); text-decoration: none; }
.page-read .c-kicker a:hover { color: var(--brand); }
.page-read h1 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.c-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e7eeea;
  color: var(--muted);
  font-size: 13.5px;
}
.c-byline-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b7c4be;
}
.page-read .c-edit { margin: 12px 0 0; }
.page-read .c-edit a {
  font-size: 13px;
  text-decoration: none;
}
.page-read .md {
  font-size: 17.5px;
  line-height: 1.85;
  color: #1d2924;
  overflow-wrap: break-word;
}
.page-read .md p { margin: 0 0 1.05em; }
.page-read .md h2,
.page-read .md h3 {
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.page-read .md h2 {
  font-size: 1.35em;
  margin: 1.7em 0 0.55em;
  padding-top: 0.2em;
}
.page-read .md h3 { font-size: 1.12em; margin: 1.45em 0 0.4em; }
.page-read .md ol {
  list-style: none;
  margin: 0.55em 0 1.1em;
  padding-left: 0.1em;
  counter-reset: step;
}
.page-read .md ol > li { counter-increment: step; margin: 0.48em 0; }
.page-read .md ol > li::before {
  content: counters(step, ".") ". ";
  color: #087a60;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.page-read .md ol ol > li::before { color: #3d6b84; font-weight: 640; }
.page-read .md ul { margin: 0.5em 0 1em; }
.page-read .md li > ol,
.page-read .md li > ul {
  margin: 0.4em 0 0.5em 0.1em;
  padding: 0.15em 0 0.2em 0.95em;
  border-left: 2px solid #d5ebe3;
}
.page-read .md li > ul { padding-left: 1.35em; }
.page-read .md blockquote {
  margin: 1.15em 0;
  padding: 10px 16px;
  background: #f3faf7;
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  color: #3d524b;
}
.page-read .md img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.35em auto;
  border-radius: 12px;
  border: 1px solid #e4ebe7;
  background: #f7faf8;
}
.page-read .md pre { border-radius: 12px; }
.page-read .md hr { border-top-color: #e4ebe7; }

@media (max-width: 800px) {
  h1 { font-size: 26px; }
  .c-nav a:not([aria-current="page"]) { display: none; }
  .c-split { grid-template-columns: 1fr; }
  .c-header { gap: 8px; }
  body[data-page="studio"].studio-on { overflow: auto; height: auto; }
  .studio-shell { grid-template-columns: 1fr; height: auto; }
  .studio-side { max-height: 280px; border-right: 0; border-bottom: 1px solid #efeeea; }
  .studio-doc { width: min(760px, calc(100% - 28px)); }
  .studio-title { font-size: 26px; }
  .blk-gutter { opacity: 1; left: -4px; position: static; width: auto; margin-bottom: 2px; }
  .c-read { width: min(740px, calc(100% - 20px)); margin-top: 16px; }
  .c-sheet { padding: 22px 16px 28px; border-radius: 14px; }
  .page-read .md { font-size: 16.5px; }
}
