:root {
  color-scheme: light;
  --az-accent: #7c0a21;
  --az-accent-alpha: #7c0a2164;
  --az-text: #000;
  --az-text-soft: rgba(0, 0, 0, .78);
  --az-muted: rgba(0, 0, 0, .55);
  --az-placeholder: rgba(128, 128, 128, .7);
  --az-page: #fff;
  --az-surface: rgba(255, 255, 255, .1);
  --az-on-accent: #fff;
  --az-border: rgba(124, 10, 33, .15);
  --az-border-strong: rgba(124, 10, 33, .2);
  --az-hover-tint: rgba(124, 10, 33, .06);
  --az-code-tint: rgba(124, 10, 33, .04);
  --az-reader-bg: #fff;
  --az-warn: #a15c00;
  --az-modal-backdrop: rgba(128, 128, 128, .2);
  --az-modal-border: rgba(128, 128, 128, .5);
  --az-shadow: 0 0.7565932872px 5px var(--az-accent-alpha);
  --az-panel-shadow: 0 1.7565932872px 9px var(--az-accent-alpha);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --az-accent: #e8a2ae;
  --az-accent-alpha: #e8a2ae4d;
  --az-text: #ece6df;
  --az-text-soft: rgba(236, 230, 223, .8);
  --az-muted: #a59d95;
  --az-placeholder: #8d857c;
  --az-page: #141116;
  --az-surface: rgba(255, 238, 240, .06);
  --az-on-accent: #141116;
  --az-border: rgba(232, 162, 174, .16);
  --az-border-strong: rgba(232, 162, 174, .26);
  --az-hover-tint: rgba(232, 162, 174, .09);
  --az-code-tint: rgba(232, 162, 174, .08);
  --az-reader-bg: #141116;
  --az-warn: #d9b483;
  --az-modal-backdrop: rgba(8, 6, 10, .58);
  --az-modal-border: rgba(236, 230, 223, .18);
  --az-shadow: 0 1px 5px rgba(0, 0, 0, .55), 0 0 1px rgba(232, 162, 174, .32);
  --az-panel-shadow: 0 2px 12px rgba(0, 0, 0, .5), 0 0 1px rgba(232, 162, 174, .3);
}

:root[data-theme="dark"] body {
  background-color: var(--az-page);
  background-image:
    radial-gradient(110% 70% at 50% -25%, rgba(124, 10, 33, .24), transparent 78%),
    radial-gradient(70% 50% at 90% 115%, rgba(232, 162, 174, .04), transparent 70%);
  background-attachment: fixed;
}

:root[data-theme="dark"] .main-panel,
:root[data-theme="dark"] .article-head {
  background-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--az-page);
  color: var(--az-text);
}

body {
  font-family: 'Times New Roman', '宋体', 'SimSun', 'Noto Serif CJK SC', serif;
  font-size: 16px;
  min-height: 100vh;
}

button, input, textarea, select { font-family: inherit; }
a { color: var(--az-accent); }

::selection { background: var(--az-accent-alpha); }

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar ---------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px max(20px, calc((100vw - 960px) / 2)) 0;
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
  padding-top: 2px;
  white-space: nowrap;
}

.brand-cn {
  font-size: 30px;
  color: var(--az-accent);
  line-height: 1.05;
}

.brand-en {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--az-placeholder);
  margin-top: 3px;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.search-input { width: 180px; }

/* ---------- glass ---------- */

.glass {
  position: relative;
  transform: translateZ(0);
  border: 0 solid transparent;
  border-radius: .15em;
  background-color: var(--az-surface);
  box-shadow: var(--az-panel-shadow);
}

.glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: inherit;
  background-size: cover;
  backdrop-filter: url(#az-glass) blur(1px);
  filter: blur(8px);
  pointer-events: none;
  border-radius: inherit;
}

.panel { border-radius: .15em; }

/* ---------- layout ---------- */

.view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 0;
  overflow: hidden;
}

.workspace {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.main-panel {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow: auto;
  padding: 24px max(20px, calc((100vw - 960px) / 2)) 28px;
}

.side-panel,
.mini-panel {
  flex: 0 0 auto;
  overflow: auto;
  padding: 14px 16px 16px;
}

.mini-panel { overflow: visible; }

/* ---------- panel headings ---------- */

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--az-accent-alpha);
}

.panel-title {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--az-accent);
}

.panel-note {
  font-size: 10px;
  line-height: 1.4;
  color: var(--az-placeholder);
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ---------- inputs ---------- */

.az-input {
  display: inline-block;
  height: 20px;
  padding: 0 4px 0 0;
  background-color: var(--az-surface);
  color: var(--az-text);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: .15em;
  outline: none;
  text-indent: 3px;
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 13px;
  font-style: italic;
  box-shadow: var(--az-shadow);
  backdrop-filter: blur(15px);
  min-width: 0;
}

.az-input::placeholder { color: var(--az-placeholder); }

.az-input:hover {
  transition: .2s;
  box-shadow: 0 0 10px var(--az-accent-alpha);
}

.az-input:focus {
  transition: .2s;
  border-bottom: 2px solid var(--az-accent-alpha);
}

.az-textarea {
  width: 100%;
  padding: 8px 10px;
  background-color: var(--az-surface);
  color: var(--az-text);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: .15em;
  outline: none;
  font-family: 'Liberation Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: var(--az-shadow);
  backdrop-filter: blur(15px);
  resize: none;
}

.az-textarea::placeholder { color: var(--az-placeholder); }
.az-textarea:focus { border-bottom: 2px solid var(--az-accent-alpha); transition: .2s; }
.az-textarea.small { height: 66px; resize: vertical; }

select.az-input {
  font-style: normal;
  font-family: 'Times New Roman', 'Liberation Mono', serif;
  color: var(--az-text);
}

/* ---------- buttons ---------- */

.az-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 10px;
  background-color: var(--az-surface);
  color: var(--az-text);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: .15em;
  outline: none;
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 13px;
  font-style: normal;
  text-indent: 0;
  text-align: center;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--az-shadow);
  backdrop-filter: blur(15px);
}

.az-button:hover { transition: .2s; box-shadow: 0 0 10px var(--az-accent-alpha); }
.az-button:focus-visible { border-bottom: 2px solid var(--az-accent-alpha); }
.az-button:disabled { opacity: .45; cursor: default; }
.btn { text-decoration: none; }
.subscribe-btn[hidden] { display: none; }
.subscribe-btn[data-state="subscribed"] { color: var(--az-accent); }
.subscribe-btn[data-state="busy"] { opacity: .55; cursor: default; }

.op {
  padding: 0 2px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 10px;
  line-height: 26px;
  color: var(--az-text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.op:hover {
  color: var(--az-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tab {
  padding: 0 8px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  line-height: 22px;
  color: var(--az-text);
  cursor: pointer;
}

.tab:hover { color: var(--az-accent); }

.tab.active {
  color: var(--az-accent);
  border-bottom-color: var(--az-accent-alpha);
}

.az-confirm {
  width: 200px;
  height: 50px;
  padding: 0;
  background: transparent;
  color: var(--az-accent);
  border: 2px solid var(--az-accent);
  border-radius: .15em;
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 46px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0.7565932872px 5px var(--az-accent);
  transition: .3s;
}

.az-confirm:hover { background: var(--az-accent); color: var(--az-on-accent); }
.az-confirm:active { width: 160px; height: 35px; line-height: 31px; transition: .1s; }
.az-confirm:disabled { opacity: .45; cursor: default; }

/* ---------- status bar ---------- */

.statusbar {
  flex: 0 0 30px;
  height: 30px;
  line-height: 30px;
  padding: 0 20px;
  font-size: 18px;
  color: var(--az-text);
  background: var(--az-surface);
  box-shadow: 0 -2px 9px 0 var(--az-accent-alpha);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(15px);
}

.statusbar[data-tone="error"] { color: var(--az-accent); }

/* ---------- home ---------- */

.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.category-strip .tag.active {
  background: var(--az-accent);
  border-color: var(--az-accent);
  color: var(--az-on-accent);
}

/* ---------- blocking ---------- */

.block-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.block-bar .tag.active {
  background: var(--az-accent);
  border-color: var(--az-accent);
  color: var(--az-on-accent);
}

.block-summary {
  font-size: 11px;
  color: var(--az-muted);
}

.block-panel {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  background: var(--az-hover-tint);
}

.block-hint {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--az-placeholder);
}

.block-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
}

.block-label {
  flex: 0 0 auto;
  min-width: 40px;
  font-size: 11px;
  line-height: 20px;
  color: var(--az-placeholder);
}

.block-chip.is-blocked {
  background: var(--az-accent);
  border-color: var(--az-accent);
  color: var(--az-on-accent);
}

.block-chip.is-blocked::after { content: ' ×'; }

.block-empty {
  font-size: 11px;
  line-height: 20px;
  color: var(--az-placeholder);
}

.post-list { margin: 0 -10px; }

.post-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 10px;
  border-bottom: 1px solid var(--az-accent-alpha);
}

.post-row:last-child { border-bottom: 0; }

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--az-accent-alpha);
  font-size: 12px;
}

.pagination .tag {
  font-size: 12px;
  line-height: 22px;
}

.pagination .tag:disabled {
  opacity: .4;
  cursor: default;
}

.pagination .tag:disabled:hover {
  background: transparent;
}

.page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.page-number.active {
  background: var(--az-accent);
  border-color: var(--az-accent);
  color: var(--az-on-accent);
}

.page-gap {
  padding: 0 2px;
  color: var(--az-placeholder);
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.page-jump-input {
  width: 56px;
  height: 22px;
  padding: 0 6px;
  text-align: center;
}

.page-count {
  color: var(--az-placeholder);
}

.post-link {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  color: var(--az-text);
  text-decoration: none;
}

.post-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--az-accent);
}

.post-link:hover .post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.post-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--az-placeholder);
}

.post-excerpt {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--az-text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-ops {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  align-items: flex-start;
  padding-top: 3px;
}

.side-list {
  display: flex;
  flex-direction: column;
  margin: 0 -6px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  border-radius: .15em;
  font-family: inherit;
  font-size: 14px;
  line-height: 30px;
  color: var(--az-text);
  text-align: left;
  cursor: pointer;
}

.list-row:hover { color: var(--az-accent); }
.list-row.active { color: var(--az-accent); box-shadow: inset 2px 0 0 var(--az-accent); }

.row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-count {
  margin-left: 8px;
  font-size: 10px;
  line-height: 26px;
  color: var(--az-placeholder);
}

.about-text {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--az-text-soft);
}

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-left: 2px;
  font-size: 14px;
  line-height: 30px;
  border-top: 1px solid var(--az-border-strong);
}

.stat-num {
  font-size: 25px;
  line-height: 1.2;
  color: var(--az-accent);
  text-align: right;
}

.stat-small {
  max-width: 190px;
  font-size: 11px;
  color: var(--az-placeholder);
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------- article ---------- */

.article-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background-color: var(--az-page);
}

.article-head {
  flex: 0 0 auto;
  padding: 12px max(20px, calc((100vw - 800px) / 2)) 10px;
  border-bottom: 1px solid var(--az-accent-alpha);
  background: var(--az-page);
}

.article-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 5px 0 3px;
}

.article-tags { margin: 0; gap: 6px; }

.back-link {
  display: inline-block;
  font-size: 12px;
  line-height: 20px;
  color: var(--az-accent);
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.article-title {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--az-accent);
}

.article-meta {
  font-size: 12px;
  line-height: 1.6;
  color: var(--az-placeholder);
}

.inline-link {
  color: var(--az-accent);
  text-decoration: none;
}

.inline-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.article-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.reader-shell {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--az-reader-bg);
}

.reader-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--az-reader-bg);
}

body.article-view .app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.article-view .view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

body.article-view .article-workspace {
  height: 100%;
  flex-direction: column;
}

body.article-view .article-panel {
  height: 100%;
  padding: 0;
  overflow: hidden;
}

body.article-view .reader-shell {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  margin: 0;
}

.reader-fallback {
  flex: 0 0 auto;
  padding-top: 6px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--az-placeholder);
}

.reader-fallback a { color: var(--az-accent); text-decoration: none; }
.reader-fallback a:hover { text-decoration: underline; }
.reader-fallback .dot { margin: 0 6px; }

.meta-list { margin: 0 -4px; }

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  font-size: 14px;
  line-height: 30px;
  border-bottom: 1px solid var(--az-border);
}

.meta-row:last-child { border-bottom: 0; }

.meta-row span:first-child {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--az-placeholder);
}

.meta-row span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  padding: 0 8px;
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  background: transparent;
  color: var(--az-accent);
  font-family: inherit;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}

.tag:hover { background: var(--az-hover-tint); }

/* ---------- login ---------- */

.login-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 20px;
}

.login-panel {
  width: 500px;
  height: 600px;
  max-height: 100%;
  padding: 24px 40px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
}

.login-title {
  margin: 16px 0 8px;
  font-size: 60px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--az-accent);
  text-align: center;
}

.login-sub {
  max-width: 380px;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}

#login-form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-input {
  width: 100%;
  height: 30px;
  font-size: 15px;
  text-indent: 6px;
}

.login-submit { margin-top: 24px; }

.login-hint {
  max-width: 360px;
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--az-placeholder);
  text-align: center;
}

.login-back {
  margin-top: auto;
  color: var(--az-text);
  text-decoration: none;
}

.form-error {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--az-accent);
  text-align: center;
}

/* ---------- fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-bottom: 10px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  line-height: 1.2;
  color: var(--az-placeholder);
}

.field .az-input { width: 100%; }

/* ---------- admin ---------- */

.admin-main {
  display: block;
  overflow: auto;
}

.admin-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  padding-bottom: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--az-accent-alpha);
}

.tabs { display: flex; gap: 2px; }
.admin-bar-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

.new-post-btn {
  color: var(--az-accent);
  border: 1px solid var(--az-accent-alpha);
  padding: 0 9px;
}

.new-post-btn:hover {
  background: var(--az-hover-tint);
  box-shadow: 0 0 10px var(--az-accent-alpha);
}

.admin-state {
  font-size: 10px;
  line-height: 26px;
  color: var(--az-accent);
}

.editor {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  background: var(--az-hover-tint);
  color: var(--az-accent);
  font-size: 13px;
  line-height: 1.6;
}

.banner .op { color: var(--az-accent); }

.editor-title {
  width: 100%;
  height: 30px;
  padding: 0 6px;
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 18px;
  font-style: normal;
  text-indent: 4px;
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 10px;
  margin: 8px 0;
}

.editor-meta .field.inline {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
  gap: 2px;
}

.editor-meta .az-input { width: 130px; }
.editor-meta input[type="datetime-local"] { width: 168px; font-size: 12px; }

.slug-text {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 20px;
  color: var(--az-muted);
}

.readonly-value {
  display: inline-block;
  min-width: 100px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  border-bottom: 1px solid var(--az-accent-alpha);
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--az-text);
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--az-accent-alpha);
}

.char-count {
  margin-left: auto;
  font-size: 10px;
  line-height: 26px;
  color: var(--az-placeholder);
}

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  padding: 4px 0;
}

.md-toolbar .op { font-size: 10px; line-height: 20px; }

.editor-pane {
  height: 50vh;
  min-height: 320px;
  display: flex;
}

.editor-textarea {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 260px;
  padding: 10px 12px;
  font-family: 'Liberation Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.7;
  resize: none;
}

.editor-preview {
  height: 50vh;
  min-height: 320px;
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  overflow: hidden;
  background: var(--az-reader-bg);
}

.admin-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  align-items: start;
  margin-top: 12px;
}

.admin-bottom > section { width: 100%; }

.publish-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}

.publish-button { width: 200px; }

.hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--az-placeholder);
}

/* versions */

.version-list {
  max-height: 230px;
  overflow: auto;
  padding: 0 2px;
}

.version-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  padding: 2px 0;
  border-bottom: 1px solid var(--az-border);
}

.version-row:last-child { border-bottom: 0; }

.version-label { font-size: 12px; line-height: 26px; color: var(--az-accent); }
.version-time { font-size: 10px; line-height: 26px; color: var(--az-placeholder); }
.version-ops { margin-left: auto; display: flex; gap: 2px; }
.version-row.current .version-label { font-weight: bold; }

/* taxonomy */

.tax-block + .tax-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--az-accent-alpha);
}

.tax-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 20px;
  color: var(--az-placeholder);
}

.tax-list { max-height: 142px; overflow: auto; }

.tax-row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  line-height: 26px;
}

.tax-name {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 2px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--az-text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tax-name:hover { color: var(--az-accent); text-decoration: underline; text-underline-offset: 2px; }

.tax-count { font-size: 10px; color: var(--az-placeholder); }
.tax-del { font-size: 12px; line-height: 20px; padding: 0 4px; }
.tax-token { font-size: 10px; line-height: 20px; padding: 0 2px; }

.tax-add {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.tax-add .az-input { flex: 1 1 auto; min-width: 0; }
.tax-add .az-button { flex: 0 0 auto; height: 20px; padding: 0 8px; }

/* manage */

.manage-list-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--az-accent-alpha);
}

.manage-list {
  min-height: 0;
  margin: 0 -8px;
  padding: 0 8px;
}

.manage-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--az-border);
}

.manage-row:last-child { border-bottom: 0; }
.manage-row.deleted { opacity: .6; }

.manage-main { flex: 1 1 auto; min-width: 0; }

.manage-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--az-accent);
}

.manage-meta {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--az-placeholder);
}

.manage-ops {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 150px;
}

.manage-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.manage-select { flex: 0 0 auto; margin-top: 2px; }

.log-file {
  max-width: 260px;
  height: 24px;
  font-size: 11px;
}

.log-list {
  min-height: 0;
  margin: 0 -8px;
  padding: 0 8px;
}

.log-row { border-bottom: 1px solid var(--az-border); }
.log-row:last-child { border-bottom: 0; }

.log-row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 6px 4px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.6;
  list-style: none;
}

.log-row summary::-webkit-details-marker { display: none; }

.log-status {
  flex: 0 0 auto;
  width: 32px;
  text-align: right;
  font-weight: 600;
}

.log-row.is-warn .log-status { color: var(--az-warn); }
.log-row.is-error .log-status { color: var(--az-accent); }

.log-path {
  flex: 1 1 200px;
  min-width: 0;
  word-break: break-all;
}

.log-meta {
  flex: 0 0 auto;
  color: var(--az-placeholder);
  font-size: 11px;
}

.log-json {
  margin: 0 0 8px;
  padding: 8px;
  background: var(--az-code-tint);
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
  line-height: 14px;
  vertical-align: middle;
  color: var(--az-accent);
}

.badge.pin {
  background: var(--az-accent);
  border-color: var(--az-accent);
  color: var(--az-on-accent);
}

.badge.featured {
  background: var(--az-hover-tint);
  border-color: var(--az-accent-alpha);
}

.badge.pending {
  background: var(--az-hover-tint);
}

.badge.rejected {
  color: var(--az-placeholder);
  border-color: var(--az-border);
}

.badge.edit {
  border-style: dashed;
}

.badge.private {
  border-style: dashed;
  letter-spacing: .02em;
}

.post-title .badge,
.article-title .badge { margin-left: 8px; }

.tab-count {
  margin-left: 3px;
  font-size: 10px;
}

/* review */

.review-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 -8px;
  padding: 0 8px;
}

.review-row {
  padding: 12px 4px;
  border-bottom: 1px solid var(--az-border);
}

.review-row:last-child { border-bottom: 0; }

.review-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.review-title {
  font-size: 16px;
  line-height: 1.4;
  color: var(--az-accent);
}

.review-meta,
.review-current {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--az-placeholder);
}

.review-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--az-accent);
}

.review-excerpt {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--az-text-soft);
}

.review-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.review-approve { color: var(--az-accent); }

.review-preview {
  margin-top: 10px;
  height: 52vh;
  min-height: 320px;
}

.review-preview .reader-frame { height: 100%; }

/* flags */

.flag-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--az-border);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 20px;
  color: var(--az-text);
  cursor: pointer;
}

.check input[type="checkbox"] {
  position: relative;
  width: 15px;
  height: 15px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--az-surface);
  border: 1px solid var(--az-accent-alpha);
  border-radius: .15em;
  box-shadow: var(--az-shadow);
  cursor: pointer;
}

.check input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--az-accent);
  cursor: pointer;
}

.check input[type="checkbox"]:checked {
  background: var(--az-accent);
  border-color: var(--az-accent);
}

.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 4px;
  height: 9px;
  border: solid var(--az-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.access-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--az-border);
}

.access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* ---------- token modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 1%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--az-modal-backdrop);
  border: 1px solid var(--az-modal-border);
  border-radius: .15em;
  backdrop-filter: blur(15px);
}

.token-modal {
  position: relative;
  width: 520px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 26px;
  overflow: auto;
}

.token-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--az-text);
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 18px;
  line-height: 20px;
  cursor: pointer;
}

.token-close:hover { color: var(--az-accent); }

.ai-modal { width: 560px; }
.ai-modal .field { margin-bottom: 0; }

.token-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--az-accent);
}

.token-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--az-placeholder);
}

.token-value {
  width: 100%;
  height: 32px;
  padding: 0 6px;
  font-family: 'Liberation Mono', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  font-style: normal;
  text-indent: 4px;
}

.token-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- empty ---------- */

.empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 10px;
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  color: var(--az-accent);
}

.empty-text {
  max-width: 360px;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--az-text-soft);
}

/* ---------- scrollbars ---------- */

/* Firefox 只能近似原生滚动条；一旦声明 scrollbar-width/color，Chromium 会忽略
   全部 ::-webkit-scrollbar 规则，所以用 -moz-appearance 把回退限制在 Firefox。 */
@supports (-moz-appearance: none) {
  html,
  html * {
    scrollbar-width: thin;
    scrollbar-color: var(--az-accent-alpha) transparent;
  }
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.az-ui *::-webkit-scrollbar {
  width: 14px;
  height: 14px;
  border-radius: .15em;
}

.az-ui *::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 5px;
  transition: .2s;
}

.az-ui *::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  display: block;
  background-color: var(--az-accent-alpha);
  background-clip: padding-box;
  border: 5px solid transparent;
  border-radius: .15em;
  transition: .2s;
}

.az-ui *::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  border: 4px solid transparent;
  background-color: var(--az-accent-alpha);
}

.az-ui *::-webkit-scrollbar-button,
html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button { display: none; }

.az-ui *::-webkit-scrollbar-corner,
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner { background: transparent; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .view {
    display: block;
    overflow: visible;
    padding: 0 0 40px;
  }

  .workspace {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .main-panel {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-height: 0;
    overflow: visible;
    padding: 14px 14px 24px;
  }

  .side-panel, .mini-panel { max-height: none; }

  .article-panel { overflow: visible; }
  .article-head { padding: 10px 14px 8px; }
  .reader-shell { height: 70vh; min-height: 420px; }

  .admin-main { overflow: visible; }
  .admin-bottom { grid-template-columns: 1fr; }
  .editor { min-height: 0; }
  .editor-pane { height: 58vh; min-height: 300px; }
  .editor-preview { height: 58vh; min-height: 300px; }
  .editor-textarea { min-height: 0; }

  .statusbar {
    position: static;
    margin-top: 10px;
  }

  .login-screen { padding: 10px 14px 20px; }
  .login-panel { width: 100%; max-width: 500px; height: auto; min-height: 540px; padding: 20px 24px; }
}

@media (max-width: 620px) {
  .topbar { align-items: center; gap: 10px; padding: 10px 14px 0; flex-wrap: wrap; }
  .brand-cn { font-size: 24px; }
  .brand-en { display: none; }
  .top-tools { padding-top: 0; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .search-input { width: 110px; }
  .panel-title { font-size: 24px; }
  .login-title { font-size: 48px; }
  .article-title { font-size: 26px; }
  .statusbar { font-size: 14px; padding: 0 14px; }
  .reader-shell { height: 66vh; min-height: 380px; }
}

/* ---------- contribution wall ---------- */

.contrib-intro {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--az-muted);
}

.contrib-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 18px;
}

.contrib-chip-count {
  margin-left: 2px;
  font-size: 10px;
  color: var(--az-placeholder);
}

.contrib-scroll {
  overflow-x: auto;
  padding: 2px 0 8px;
}

.contrib-grid-wrap {
  --contrib-cell: 12px;
  --contrib-gap: 3px;
  --contrib-gutter: 16px;
  display: inline-block;
  min-width: 100%;
}

.contrib-topline {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.contrib-gutter {
  flex: 0 0 auto;
  width: var(--contrib-gutter);
}

.contrib-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--contrib-cell);
  gap: var(--contrib-gap);
  font-size: 10px;
  line-height: 1.2;
  color: var(--az-placeholder);
  white-space: nowrap;
}

.contrib-main {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.contrib-weekdays {
  display: grid;
  grid-template-rows: repeat(7, var(--contrib-cell));
  gap: var(--contrib-gap);
  width: var(--contrib-gutter);
  font-size: 9px;
  line-height: var(--contrib-cell);
  color: var(--az-placeholder);
  text-align: center;
}

.contrib-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--contrib-cell));
  gap: var(--contrib-gap);
}

.contrib-cell {
  display: block;
  width: var(--contrib-cell);
  height: var(--contrib-cell);
  border-radius: 2px;
  background: var(--az-hover-tint);
  box-shadow: inset 0 0 0 1px var(--az-border);
}

.contrib-cell.pad {
  background: transparent;
  box-shadow: none;
}

.contrib-cell[data-date] { cursor: pointer; }

.contrib-cell[data-date]:hover {
  box-shadow: inset 0 0 0 1px var(--az-accent);
}

.contrib-cell.is-active {
  box-shadow: inset 0 0 0 2px var(--az-accent);
}

.contrib-scale {
  display: inline-block;
  width: 92px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--az-accent) 16%, transparent),
    color-mix(in srgb, var(--az-accent) 42%, transparent),
    color-mix(in srgb, var(--az-accent) 70%, transparent),
    var(--az-accent)
  );
  box-shadow: inset 0 0 0 1px var(--az-border);
}

.contrib-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--az-muted);
}

.contrib-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.contrib-legend-note {
  font-size: 10px;
  color: var(--az-placeholder);
  letter-spacing: .02em;
}

.contrib-summary { color: var(--az-placeholder); }

.contrib-day {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--az-accent-alpha);
}

.contrib-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--az-text);
}

.contrib-day-posts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
  list-style: none;
}

.contrib-day-posts li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.contrib-day-author {
  font-size: 10px;
  color: var(--az-placeholder);
}

@media (max-width: 620px) {
  .contrib-grid-wrap {
    --contrib-cell: 10px;
    --contrib-gutter: 14px;
  }
}
