:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #64706b;
  --paper: #f7f3ec;
  --surface: #fffdf8;
  --line: #dfd6c8;
  --accent: #8f3f2b;
  --accent-strong: #5d291d;
  --moss: #48685b;
  --gold: #b78b3b;
  --shadow: 0 18px 45px rgba(32, 29, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, 'Microsoft YaHei', 'PingFang SC', sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 64px);
  background: rgba(247, 243, 236, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 30px);
  color: #33413b;
  font-size: 14px;
  font-weight: 600;
}

.main-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.hero {
  position: relative;
  min-height: min(720px, 88vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(16, 22, 20, 0.86),
    rgba(16, 22, 20, 0.42) 48%,
    rgba(16, 22, 20, 0.12)
  );
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin: 0 clamp(18px, 6vw, 80px) clamp(42px, 10vh, 88px);
  color: #fffaf2;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  line-height: 1.16;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(38px, 7vw, 76px);
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 18px 0 0;
  color: rgba(255, 250, 242, 0.9);
  font-size: clamp(16px, 2.2vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-action,
.secondary-action,
.secondary-action {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-action {
  background: var(--gold);
  color: #201914;
}

.secondary-action {
  border-color: rgba(255, 250, 242, 0.5);
  color: #fffaf2;
}

.section {
  padding: clamp(56px, 8vw, 96px) clamp(18px, 5vw, 64px);
}

.section-heading {
  width: min(1120px, 100%);
  margin: 0 auto 28px;
}

.section h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.topic-grid,
.article-grid,
.workflow {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.topic-card {
  min-height: 220px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.topic-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}

.topic-card span {
  color: var(--accent);
  font-weight: 800;
}

.topic-card h3,
.article-card h3 {
  margin: 18px 0 8px;
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
}

.topic-card p,
.article-card p,
.workflow-step p {
  margin: 0;
  color: var(--muted);
}

/* 文章卡片摘要最多两行，超出省略 */
.article-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-section {
  background: #ebe5da;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid #cfc3b4;
  background: transparent;
  color: #3a443f;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 14px;
}

.filter-button.active,
.filter-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* 通用规则：任何元素带 hidden 属性一律隐藏。
   项目里 .btn / .alert / .card 等组件样式自带 display，
   会覆盖浏览器对 [hidden] 的默认规则，导致"移除封面"按钮、
   错误提示条等带 hidden 的元素始终显示。 */
[hidden] {
  display: none !important;
}

.article-card {
  display: grid;
  grid-template-columns: minmax(150px, 36%) 1fr;
  min-height: 180px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article-card[hidden] {
  display: none;
}

.article-card img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.article-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: linear-gradient(135deg, #e8e2d4, #d8d0bd);
  color: rgba(58, 68, 63, 0.32);
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 700;
}

.article-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.article-card div {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

/* 紧凑卡片：标题略小、间距收紧，控制卡片整体高度 */
.article-card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.45;
}
.article-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card a {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent-strong);
  font-size: 0.9rem;
}

/* 精选文章分页控件 */
.article-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.article-pager-btn {
  min-height: 36px;
  padding: 7px 18px;
  border: 1px solid #cfc3b4;
  background: transparent;
  color: #3a443f;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}
.article-pager-btn:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.article-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.article-pager-info {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.tag {
  align-self: flex-start;
  background: #eef1e6;
  color: var(--moss);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.article-card a {
  margin-top: auto;
  color: var(--accent-strong);
  font-weight: 800;
}

.workflow-section {
  background: var(--surface);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  counter-reset: steps;
}

.workflow-step {
  position: relative;
  min-height: 190px;
  padding: 52px 20px 20px;
  border: 1px solid var(--line);
  background: #fbf7ef;
}

.workflow-step::before {
  counter-increment: steps;
  content: '0' counter(steps);
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--accent);
  font-weight: 900;
}

.workflow-step strong {
  display: block;
  margin-bottom: 8px;
  font-family: 'Noto Serif SC', serif;
  font-size: 21px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 5vw, 64px);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.article-page {
  background: var(--surface);
}

.article-detail {
  width: min(820px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 82px) 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--accent-strong);
  font-weight: 800;
}

.article-detail h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.16;
}

.article-lead {
  margin: 18px 0 28px;
  color: #3f4a44;
  font-size: clamp(17px, 2vw, 21px);
}

.article-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 0 0 34px;
  box-shadow: var(--shadow);
}

.article-detail section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.article-detail h2 {
  margin: 0 0 10px;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.25;
}

.article-detail p {
  margin: 0;
  color: #4d5852;
  font-size: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .site-header,
  .section-heading.split,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topic-grid,
  .article-grid,
  .workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 760px;
  }

  .hero-overlay {
    background: linear-gradient(
      0deg,
      rgba(16, 22, 20, 0.9),
      rgba(16, 22, 20, 0.24)
    );
  }

  .topic-grid,
  .article-grid,
  .workflow {
    grid-template-columns: 1fr;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-card img {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

.auth-page {
  min-height: 100vh;
  background: #e9e1d4;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  min-height: 100vh;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(rgba(20, 29, 26, 0.84), rgba(20, 29, 26, 0.92)),
    url('https://www.canada-spirit.com/images/guides/canadian-museums-guide.jpg')
      center/cover;
  color: #fffaf2;
}

.auth-brand {
  color: #fffaf2;
}

.auth-brand .brand-mark {
  background: var(--gold);
  color: #201914;
}

.auth-brand small,
.auth-intro > div > p,
.auth-footnote {
  color: rgba(255, 250, 242, 0.72);
}

.auth-intro h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 1.1;
}

.auth-intro > div > p {
  max-width: 520px;
  font-size: 18px;
}

.auth-footnote {
  margin: 0;
  font-size: 13px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 88px);
  background: var(--surface);
}

.login-form {
  width: min(440px, 100%);
}

.form-heading {
  margin-bottom: 34px;
}

.form-heading h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(30px, 4vw, 42px);
}

.form-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.form-field {
  margin-bottom: 22px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #cfc3b4;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 63, 43, 0.13);
}

.form-field small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 66px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transform: translateY(-50%);
}

.form-error {
  margin: -4px 0 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f7e9e4;
  color: #7b2f20;
  font-size: 14px;
}

.login-button,
.logout-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.login-button {
  width: 100%;
  min-height: 52px;
  background: var(--ink);
  color: var(--paper);
}

.login-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.login-button:disabled,
.logout-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.back-home {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.dashboard-page {
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.logout-button {
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
}

.dashboard-main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(60px, 10vw, 120px) 0;
}

.dashboard-main h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(38px, 6vw, 68px);
}

.dashboard-main > p:last-child {
  color: var(--muted);
  font-size: 18px;
}
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  background: #18201d;
  color: #fffaf2;
}
.admin-brand {
  padding: 0 8px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.admin-brand .brand-mark {
  background: var(--gold);
  color: #201914;
}
.admin-brand small {
  color: rgba(255, 255, 255, 0.56);
}
.admin-nav {
  margin-top: 24px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.68);
}
.admin-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.admin-nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--accent);
  font-family: 'Noto Serif SC', serif;
}
.admin-nav strong,
.admin-nav small {
  display: block;
}
.admin-nav small {
  color: rgba(255, 255, 255, 0.44);
  font-size: 11px;
}
.admin-account {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #201914;
  font-weight: 800;
}
.admin-account strong,
.admin-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-account small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}
.admin-account button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  cursor: pointer;
}
.admin-main {
  min-width: 0;
  padding: clamp(28px, 4vw, 56px);
}
.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1380px;
  margin: 0 auto 28px;
}
.admin-page-header h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(36px, 5vw, 56px);
}
.admin-page-header > div > p:last-child,
.post-panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}
.post-count {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.post-panel {
  max-width: 1380px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.post-panel-heading {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.post-panel-heading h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
}
.post-table-wrap {
  overflow-x: auto;
}
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.post-table th,
.post-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.post-table th {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.post-table td:first-child {
  min-width: 260px;
}
.post-title,
.post-table td:first-child small {
  display: block;
}
.post-table td:first-child small {
  max-width: 380px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-badge.published {
  background: #e4efe7;
  color: #315f43;
}
.status-badge.draft {
  background: #eee9df;
  color: #6b6153;
}
.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.post-actions button,
.dialog-actions button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.post-actions button:hover {
  border-color: var(--ink);
}
.post-actions button.danger {
  color: #9b3425;
}
.post-actions button.danger:hover:not(:disabled) {
  background: #fbeee8;
  border-color: var(--accent);
  color: #7b2f20;
}
.empty-state {
  padding: 72px 24px;
  color: var(--muted);
  text-align: center;
}
.empty-state span {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
}
.empty-state h3 {
  margin: 16px 0 4px;
  color: var(--ink);
}
.empty-state p {
  margin: 0;
}
.edit-dialog {
  width: min(720px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(20, 25, 23, 0.32);
}
.edit-dialog::backdrop {
  background: rgba(16, 22, 20, 0.62);
  backdrop-filter: blur(3px);
}
.edit-dialog form {
  padding: 28px;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 30px;
}
.dialog-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}
.edit-dialog textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfc3b4;
  resize: vertical;
  font: inherit;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.dialog-actions button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.admin-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}
@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    height: auto;
  }
  .admin-nav {
    margin: 16px 0;
  }
  .admin-account {
    margin-top: 0;
  }
  .admin-page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.create-post-button,
.back-list-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.create-post-button {
  background: var(--ink);
  color: #fff;
}
.back-list-button {
  background: var(--surface);
  color: var(--ink);
}
.post-editor-panel {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.post-create-form .form-field {
  display: block;
  font-weight: 700;
}
.post-create-form textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #cfc3b4;
  resize: vertical;
  font: inherit;
  font-weight: 400;
}

.attachment-uploader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0;
  padding: 16px;
  border: 1px dashed #b9aa97;
  background: #fbf7ef;
}
.attachment-uploader strong,
.attachment-uploader small {
  display: block;
}
.attachment-uploader small {
  max-width: 520px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.attachment-button {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

/* ----- 新的独立附件管理组件 ----- */
.attachment-manager {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.attachment-manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.attachment-manager-header > div {
  flex: 1 1 auto;
  min-width: 0;
}
.attachment-manager-header strong {
  display: block;
  font-size: 15px;
}
.attachment-manager-header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.attachment-manager-header .attachment-button {
  flex: 0 0 auto;
}
.attachment-manager .attachment-list {
  flex-basis: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.attachment-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  background: #fbf7ef;
  border: 1px dashed #cfc3b4;
  font-size: 13px;
}
.attachment-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
  padding: 12px 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
}
.attachment-item.pending {
  background: #f4ecde;
  border-style: dashed;
}
.attachment-item.error {
  background: #fbeee8;
  border-color: var(--accent);
}
.attachment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.attachment-type {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--moss);
  white-space: nowrap;
}
.attachment-type-image { color: #315f43; background: #e4efe7; border-color: #cad9cf; }
.attachment-type-audio { color: #5d291d; background: #f1ddd3; border-color: #e1c1b1; }
.attachment-type-video { color: #5d291d; background: #f1ddd3; border-color: #e1c1b1; }
.attachment-type-pdf { color: #6b3a14; background: #f5e2cf; border-color: #e2c8ad; }
.attachment-type-document { color: #315f43; background: #e4efe7; border-color: #cad9cf; }
.attachment-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-name:hover { color: var(--accent); }
.attachment-size {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.attachment-replace {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.attachment-replace:hover { border-color: var(--ink); }
.attachment-replace input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}
.attachment-delete {
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #9b3425;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.attachment-delete:hover:not(:disabled) {
  border-color: var(--accent);
}
.attachment-delete:disabled,
.attachment-replace input:disabled + span,
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.attachment-status,
.attachment-status-inline {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--moss);
}
.attachment-status.error,
.attachment-status-inline.error {
  color: var(--accent);
}
.attachment-status-inline {
  font-weight: 700;
}
@media (max-width: 680px) {
  .attachment-manager-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ----- UEditor 容器 ----- */
.editor-shell {
  margin: 22px 0;
}
.editor-shell > label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}
.editor-shell > small {
  display: block;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.editor-mount {
  background: var(--surface);
  border: 1px solid var(--line);
}
.attachment-list {
  flex-basis: 100%;
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--moss);
  font-size: 13px;
}
.attachment-list:empty {
  display: none;
}
.attachment-list .error {
  color: var(--accent);
}
@media (max-width: 680px) {
  .attachment-uploader {
    align-items: stretch;
    flex-direction: column;
  }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  background: var(--surface);
}
.pager-summary {
  font-size: 13px;
  color: var(--moss);
}
.pager-summary strong {
  color: var(--ink);
  font-weight: 800;
  margin: 0 2px;
}
.pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pager-controls button,
.pager-controls .pager-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.pager-controls button:hover:not(:disabled) {
  background: var(--moss);
  color: var(--surface);
}
.pager-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.pager-controls .pager-current {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
  cursor: default;
}
.pager-controls .pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--moss);
}
.pager-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--moss);
}
.pager-page-size select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

/* =====================================================================
   Bootstrap 风格确认弹窗（confirm-dialog.js 配套样式）
   - 渐入背景 + 轻微缩放动画
   - 危险操作图标徽标 / 三段式布局（header / body / footer）
   - 与现有暖色主题共存的 Bootstrap 色板
   ===================================================================== */
.bs-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}
.bs-modal.show {
  display: flex;
}
.bs-modal-open {
  overflow: hidden;
}

.bs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 25, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: bs-modal-fade 0.18s ease-out;
}

.bs-modal-dialog {
  position: relative;
  width: auto;
  max-width: 480px;
  margin: 1.75rem auto;
  pointer-events: none;
}
.bs-modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.bs-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  border: 1px solid rgba(15, 23, 25, 0.08);
  border-radius: 0.65rem;
  box-shadow: 0 1.5rem 4rem rgba(15, 23, 25, 0.35);
  pointer-events: auto;
  outline: 0;
  animation: bs-modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid #e9ecef;
  border-top-left-radius: 0.65rem;
  border-top-right-radius: 0.65rem;
}
.bs-modal-title {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.bs-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -8px -8px -8px auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  border-radius: 0.4rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bs-modal-close:hover {
  background: rgba(15, 23, 25, 0.06);
  color: var(--ink);
}
.bs-modal-close:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

.bs-modal-body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem;
  color: #3a443f;
  font-size: 0.95rem;
  line-height: 1.6;
}
.bs-modal-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}
.bs-modal-icon[data-variant='danger'] {
  background: #fbe6e1;
  color: #b02a37;
}
.bs-modal-icon[data-variant='warning'] {
  background: #fff3cd;
  color: #997404;
}
.bs-modal-icon[data-variant='info'] {
  background: #e0eaff;
  color: #0a58ca;
}
.bs-modal-message {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 4px;
}
.bs-modal-message strong,
.bs-modal-message b {
  color: var(--ink);
  font-weight: 700;
}
.bs-modal-message .bs-modal-target {
  color: var(--accent-strong);
  font-weight: 700;
  word-break: break-all;
}

.bs-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid #e9ecef;
  border-bottom-right-radius: 0.65rem;
  border-bottom-left-radius: 0.65rem;
  background: #fafbfc;
}

/* 通用按钮（Bootstrap 风格） */
.bs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 40px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.bs-btn:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}
.bs-btn:active {
  transform: translateY(1px);
}
.bs-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.bs-btn-secondary {
  color: #36404a;
  background: #fff;
  border-color: #d6dbe0;
}
.bs-btn-secondary:hover:not(:disabled) {
  background: #f3f5f7;
  border-color: #b9c0c7;
  color: #1a2128;
}

.bs-btn-primary {
  color: #fff;
  background: #0d6efd;
  border-color: #0d6efd;
}
.bs-btn-primary:hover:not(:disabled) {
  background: #0b5ed7;
  border-color: #0a58ca;
}

.bs-btn-danger {
  color: #fff;
  background: #dc3545;
  border-color: #dc3545;
}
.bs-btn-danger:hover:not(:disabled) {
  background: #bb2d3b;
  border-color: #b02a37;
}

.bs-btn-warning {
  color: #1a2128;
  background: #ffc107;
  border-color: #ffc107;
}
.bs-btn-warning:hover:not(:disabled) {
  background: #ffca2c;
  border-color: #ffc720;
}

@keyframes bs-modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes bs-modal-pop {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 576px) {
  .bs-modal-dialog {
    margin: 0.5rem;
    max-width: none;
  }
  .bs-modal-dialog-centered {
    min-height: calc(100% - 1rem);
  }
  .bs-modal-header,
  .bs-modal-body,
  .bs-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .bs-btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* =====================================================================
   Bootstrap 5 风格设计系统（管理后台通用）
   - 颜色 / 间距 / 圆角 / 阴影 全部用 CSS 变量集中管理
   - 保留品牌色（暖红/金/墨色）作为 primary；其余语义色贴近 BS 5
   - 所有类名沿用 Bootstrap 习惯（.btn / .card / .form-control …）
   ===================================================================== */
:root {
  --bs-primary: #8f3f2b;
  --bs-primary-rgb: 143, 63, 43;
  --bs-primary-hover: #5d291d;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: #198754;
  --bs-success-rgb: 25, 135, 84;
  --bs-info: #0dcaf0;
  --bs-info-rgb: 13, 202, 240;
  --bs-warning: #ffc107;
  --bs-warning-rgb: 255, 193, 7;
  --bs-danger: #dc3545;
  --bs-danger-rgb: 220, 53, 69;
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-dark: #212529;
  --bs-dark-rgb: 33, 37, 41;

  --bs-body-color: #18201d;
  --bs-body-bg: #f5f3ef;
  --bs-border-color: #dfd6c8;
  --bs-emphasis-color: #000;

  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.35rem;
  --bs-border-radius-lg: 0.65rem;
  --bs-border-radius-xl: 1rem;
  --bs-border-radius-pill: 50rem;

  --bs-box-shadow-sm: 0 0.125rem 0.35rem rgba(15, 23, 25, 0.07);
  --bs-box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 25, 0.1);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(15, 23, 25, 0.14);
  --bs-box-shadow-inset: inset 0 1px 2px rgba(15, 23, 25, 0.075);

  --bs-font-sans-serif: Inter, 'Microsoft YaHei', 'PingFang SC', system-ui,
    -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-font-monospace: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    monospace;

  --bs-link-color: var(--accent-strong);
  --bs-link-hover-color: #3b180f;
  --bs-focus-ring-color: rgba(143, 63, 43, 0.22);
  --bs-focus-ring-width: 0.2rem;

  --bs-transition: all 0.18s ease;
}

/* 通用工具类（少量 Bootstrap 习惯的简写） */
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--bs-primary) !important; }
.text-success { color: var(--bs-success) !important; }
.text-danger { color: var(--bs-danger) !important; }
.text-warning { color: #b8860b !important; }
.text-info { color: #0a8aa5 !important; }
.text-body { color: var(--ink) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-start { text-align: left !important; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.small { font-size: 0.85em; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 0.75rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-auto { margin-left: auto !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.shadow-sm { box-shadow: var(--bs-box-shadow-sm) !important; }
.shadow { box-shadow: var(--bs-box-shadow) !important; }
.shadow-lg { box-shadow: var(--bs-box-shadow-lg) !important; }
.rounded { border-radius: var(--bs-border-radius) !important; }
.rounded-sm { border-radius: var(--bs-border-radius-sm) !important; }
.rounded-lg { border-radius: var(--bs-border-radius-lg) !important; }
.rounded-pill { border-radius: var(--bs-border-radius-pill) !important; }
.border { border: 1px solid var(--bs-border-color) !important; }
.border-top { border-top: 1px solid var(--bs-border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--bs-border-color) !important; }
.border-0 { border: 0 !important; }
.bg-light { background-color: var(--bs-light) !important; }
.bg-white { background-color: #fff !important; }
.bg-body { background-color: var(--bs-body-bg) !important; }

/* 通用过渡 */
.btn,
.form-control,
.form-select,
.nav-link,
.page-link,
.badge,
.alert,
.card,
.list-group-item,
.dropdown-item {
  transition: var(--bs-transition);
}

/* ----- Buttons (Bootstrap 5 风格) ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
  background-color: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  user-select: none;
  transition: var(--bs-transition);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 var(--bs-focus-ring-width) var(--bs-focus-ring-color);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.65;
  pointer-events: none;
  transform: none;
}
.btn-sm {
  min-height: 30px;
  padding: 0.25rem 0.6rem;
  font-size: 0.825rem;
  border-radius: var(--bs-border-radius-sm);
}
.btn-lg {
  min-height: 46px;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  border-radius: var(--bs-border-radius-lg);
}
.btn-icon {
  padding: 0.4rem 0.55rem;
  min-height: 34px;
  font-size: 0.85rem;
}

.btn-primary {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--bs-primary-hover);
  border-color: var(--bs-primary-hover);
  color: #fff;
}
.btn-primary:focus-visible {
  color: #fff;
  background-color: var(--bs-primary-hover);
  border-color: var(--bs-primary-hover);
}

.btn-secondary {
  color: var(--ink);
  background-color: #fff;
  border-color: var(--bs-border-color);
}
.btn-secondary:hover:not(:disabled) {
  background-color: #f1ede5;
  border-color: #b9aa97;
  color: var(--ink);
}

.btn-success {
  color: #fff;
  background-color: var(--bs-success);
  border-color: var(--bs-success);
}
.btn-success:hover:not(:disabled) {
  background-color: #146c43;
  border-color: #13623d;
  color: #fff;
}

.btn-danger {
  color: #fff;
  background-color: var(--bs-danger);
  border-color: var(--bs-danger);
}
.btn-danger:hover:not(:disabled) {
  background-color: #bb2d3b;
  border-color: #b02a37;
  color: #fff;
}

.btn-warning {
  color: var(--bs-dark);
  background-color: var(--bs-warning);
  border-color: var(--bs-warning);
}
.btn-warning:hover:not(:disabled) {
  background-color: #ffca2c;
  border-color: #ffc720;
  color: var(--bs-dark);
}

.btn-info {
  color: var(--bs-dark);
  background-color: var(--bs-info);
  border-color: var(--bs-info);
}
.btn-info:hover:not(:disabled) {
  background-color: #31d2f2;
  border-color: #25cff2;
  color: var(--bs-dark);
}

.btn-light {
  color: var(--bs-dark);
  background-color: var(--bs-light);
  border-color: var(--bs-light);
}
.btn-light:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #dde0e3;
  color: var(--bs-dark);
}

.btn-dark {
  color: #fff;
  background-color: var(--bs-dark);
  border-color: var(--bs-dark);
}
.btn-dark:hover:not(:disabled) {
  background-color: #1c1f23;
  border-color: #1a1d20;
  color: #fff;
}

.btn-link {
  color: var(--bs-link-color);
  background-color: transparent;
  border-color: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover:not(:disabled) {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
}

/* 轮廓按钮 */
.btn-outline-primary {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
  background-color: transparent;
}
.btn-outline-primary:hover:not(:disabled) {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-outline-secondary {
  color: var(--ink);
  border-color: var(--bs-border-color);
  background-color: transparent;
}
.btn-outline-secondary:hover:not(:disabled) {
  color: var(--ink);
  background-color: #f1ede5;
  border-color: #b9aa97;
}
.btn-outline-danger {
  color: var(--bs-danger);
  border-color: var(--bs-danger);
  background-color: transparent;
}
.btn-outline-danger:hover:not(:disabled) {
  color: #fff;
  background-color: var(--bs-danger);
  border-color: var(--bs-danger);
}

.btn-group {
  display: inline-flex;
  vertical-align: middle;
}
.btn-group > .btn {
  position: relative;
  margin-left: -1px;
  border-radius: 0;
}
.btn-group > .btn:first-child {
  margin-left: 0;
  border-top-left-radius: var(--bs-border-radius);
  border-bottom-left-radius: var(--bs-border-radius);
}
.btn-group > .btn:last-child {
  border-top-right-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}
.btn-group > .btn:hover,
.btn-group > .btn:focus,
.btn-group > .btn:active {
  z-index: 1;
}

/* ----- Forms ----- */
.form-label,
label.form-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.form-text {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.form-control,
.form-select,
textarea.form-control,
input.form-control {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  border: 1px solid #cfc3b4;
  border-radius: var(--bs-border-radius);
  background-color: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.form-control {
  min-height: 96px;
  resize: vertical;
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}
.form-control::placeholder {
  color: #a59b8a;
}
.form-control:disabled,
.form-control[readonly] {
  background-color: var(--bs-light);
  opacity: 1;
}
.form-control.is-invalid {
  border-color: var(--bs-danger);
  padding-right: calc(1.5em + 0.75rem);
  background-image: none;
}
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.22);
}

.form-select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 10px;
}
.form-check {
  display: block;
  min-height: 1.4rem;
  padding-left: 1.5em;
  margin-bottom: 0.4rem;
}
.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  margin-left: -1.5em;
  vertical-align: top;
  background-color: #fff;
  border: 1px solid #b9aa97;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0.25em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.form-check-input:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}
.form-check-label {
  cursor: pointer;
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}
.input-group > .form-control,
.input-group > .form-select {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid #cfc3b4;
  background-color: var(--bs-light);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.input-group > .input-group-text:first-child {
  border-right: 0;
  border-top-left-radius: var(--bs-border-radius);
  border-bottom-left-radius: var(--bs-border-radius);
}
.input-group > .input-group-text:last-child {
  border-left: 0;
  border-top-right-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}

.form-field {
  display: block;
  margin-bottom: 1.1rem;
}
.form-field > .form-label,
.form-field > label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.form-field > .form-text {
  margin-top: 0.4rem;
}

/* 文章封面上传控件 */
.cover-picker {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.cover-preview {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-light);
  overflow: hidden;
}
.cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.cover-upload {
  cursor: pointer;
  margin-bottom: 0;
}

/* flatpickr 日期选择器：卡片式日历，融入管理后台主题 */
.flatpickr-calendar {
  width: 326px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 27, 22, 0.18);
  background: #fff;
  font-family: inherit;
}
.flatpickr-calendar::before,
.flatpickr-calendar::after {
  display: none; /* 去掉默认小箭头，保持卡片干净 */
}
.flatpickr-months {
  margin-bottom: 12px;
}
.flatpickr-current-month {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.flatpickr-current-month .cur-month {
  font-weight: 700;
}
.flatpickr-current-month .numInputWrapper {
  height: 1.5rem;
}
.flatpickr-current-month input.cur-year {
  font-weight: 700;
  color: var(--ink);
}
.flatpickr-prev-month,
.flatpickr-next-month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
}
.flatpickr-weekdays {
  margin-bottom: 6px;
}
.flatpickr-weekday {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.flatpickr-days {
  width: 100%;
}
.dayContainer {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}
.flatpickr-day {
  height: 38px;
  line-height: 38px;
  border: 0;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.flatpickr-day:hover:not(.selected):not(.disabled) {
  background: rgba(var(--bs-primary-rgb), 0.1);
  border: 0;
  color: var(--bs-primary);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--bs-primary);
  border: 0;
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), 0.35);
}
.flatpickr-day.today:not(.selected) {
  border: 0;
  position: relative;
  color: var(--bs-primary);
  font-weight: 700;
}
.flatpickr-day.today:not(.selected)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bs-primary);
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #c9c0b2;
}
.flatpickr-day.disabled {
  color: #e0d9cc;
}

/* 文章标签多选下拉组件 */
.tag-select {
  position: relative;
}
.tag-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  padding: 0.4rem 0.85rem;
  border: 1px solid #cfc3b4;
  border-radius: var(--bs-border-radius);
  background-color: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tag-select-trigger:hover {
  border-color: #b3a48f;
}
.tag-select-trigger::after {
  content: '';
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-left: 0.4rem;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.15s ease;
}
.tag-select.open .tag-select-trigger::after {
  transform: rotate(180deg);
}
.tag-select.open .tag-select-trigger,
.tag-select-trigger:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
  outline: none;
}
.tag-select-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}
.tag-select-label.placeholder {
  color: #a59b8a;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.3rem 0.15rem 0.6rem;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}
.tag-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.tag-chip button:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.18);
}
.tag-select-menu {
  position: absolute;
  z-index: 1060;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(31, 27, 22, 0.16);
}
.tag-select-search {
  padding: 0.15rem 0.15rem 0.5rem;
}
.tag-select-search input {
  width: 100%;
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid #cfc3b4;
  border-radius: var(--bs-border-radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tag-select-search input:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.18rem var(--bs-focus-ring-color);
}
.tag-select-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 208px;
  overflow-y: auto;
}
.tag-select-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tag-select-option:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}
.tag-select-option:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.5);
  outline-offset: -2px;
}
.tag-select-option.selected {
  color: var(--bs-primary);
  font-weight: 600;
}
.tag-select-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #cfc3b4;
  border-radius: 4px;
  background: #fff;
  color: #fff;
  font-size: 0.7rem;
}
.tag-select-option.selected .tag-select-check {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}
.tag-select-option.selected .tag-select-check::after {
  content: '✓';
}
.tag-select-empty {
  padding: 0.7rem 0.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ----- Cards ----- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  word-wrap: break-word;
}
.card-body {
  flex: 1 1 auto;
  padding: 1.25rem 1.4rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.95rem 1.4rem;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: #fff;
  border-top-left-radius: calc(var(--bs-border-radius-lg) - 1px);
  border-top-right-radius: calc(var(--bs-border-radius-lg) - 1px);
}
.card-header h2,
.card-header h3 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.825rem;
}
.card-footer {
  padding: 0.85rem 1.4rem;
  border-top: 1px solid var(--bs-border-color);
  background-color: var(--bs-light);
  border-bottom-left-radius: calc(var(--bs-border-radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--bs-border-radius-lg) - 1px);
}

/* ----- Tables ----- */
.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--ink);
  vertical-align: middle;
  border-color: var(--bs-border-color);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
.table > thead {
  background-color: #faf6ee;
}
.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
  border-bottom-color: var(--bs-border-color);
}
.table > thead > tr > th {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: #faf6ee;
}
.table > tbody > tr > td {
  border-top: 0;
  border-bottom: 1px solid var(--bs-border-color);
  vertical-align: middle;
}
.table > tbody > tr:last-child > td {
  border-bottom: 0;
}
.table-hover > tbody > tr:hover > * {
  background-color: #fbf7ef;
}
.table-sm > :not(caption) > * > * {
  padding: 0.55rem 0.75rem;
}
.table .table-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.35rem;
  white-space: nowrap;
}
.table .table-actions .btn {
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
}
.table td code,
.table .code-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid #efe6d4;
  border-radius: var(--bs-border-radius-sm);
  background-color: #fbf7ef;
  color: var(--accent-strong);
  font-family: var(--bs-font-monospace);
  font-size: 0.78rem;
}

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32em 0.65em;
  border-radius: var(--bs-border-radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}
.badge .dot {
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.4em;
  border-radius: 50%;
  background-color: currentColor;
}
.badge.bg-primary { background-color: rgba(var(--bs-primary-rgb), 0.12) !important; color: var(--bs-primary) !important; }
.badge.bg-secondary { background-color: #e9e5dc !important; color: #5a5246 !important; }
.badge.bg-success { background-color: rgba(var(--bs-success-rgb), 0.12) !important; color: var(--bs-success) !important; }
.badge.bg-danger { background-color: rgba(var(--bs-danger-rgb), 0.12) !important; color: var(--bs-danger) !important; }
.badge.bg-warning { background-color: #fff3cd !important; color: #997404 !important; }
.badge.bg-info { background-color: #cff4fc !important; color: #055160 !important; }
.badge.bg-light { background-color: #f8f9fa !important; color: #495057 !important; border: 1px solid var(--bs-border-color); }
.badge.bg-dark { background-color: #212529 !important; color: #fff !important; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.32em 0.7em;
  border-radius: var(--bs-border-radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  background-color: #e9e5dc;
  color: #5a5246;
}
.status-pill::before {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.45em;
  border-radius: 50%;
  background-color: currentColor;
}
.status-pill.published { background-color: rgba(var(--bs-success-rgb), 0.12); color: var(--bs-success); }
.status-pill.draft { background-color: #f1ede5; color: #6b6153; }
.status-pill.archived { background-color: rgba(var(--bs-secondary-rgb), 0.18); color: var(--bs-secondary); }

/* ----- Alerts ----- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-light);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}
/* 恢复 hidden 属性作用：.alert 的 display:flex 会覆盖 UA 的 [hidden] 规则，
   导致带 hidden 的空错误提示条一直显示。 */
.alert[hidden] {
  display: none;
}
.alert .alert-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  font-weight: 800;
}
.alert-primary { background-color: rgba(var(--bs-primary-rgb), 0.08); border-color: rgba(var(--bs-primary-rgb), 0.18); color: #6a2c1d; }
.alert-success { background-color: rgba(var(--bs-success-rgb), 0.1); border-color: rgba(var(--bs-success-rgb), 0.22); color: #0f5132; }
.alert-danger { background-color: rgba(var(--bs-danger-rgb), 0.1); border-color: rgba(var(--bs-danger-rgb), 0.22); color: #842029; }
.alert-warning { background-color: #fff3cd; border-color: #ffe69c; color: #664d03; }
.alert-info { background-color: #cff4fc; border-color: #b6effb; color: #055160; }
.alert.alert-dismissible {
  padding-right: 2.5rem;
}
.alert .btn-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1rem;
  height: 1rem;
  padding: 0.25rem;
  border: 0;
  background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E") center/0.85em auto no-repeat;
  cursor: pointer;
  opacity: 0.5;
}
.alert .btn-close:hover { opacity: 0.85; }

/* ----- Pagination ----- */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0.85rem 1.4rem;
  background-color: var(--bs-light);
  border-top: 1px solid var(--bs-border-color);
  border-bottom-left-radius: calc(var(--bs-border-radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--bs-border-radius-lg) - 1px);
}
.pagination-info {
  color: var(--muted);
  font-size: 0.85rem;
}
.pagination-info strong { color: var(--ink); font-weight: 700; }
.pagination {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pagination .page-item {
  display: inline-flex;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  background-color: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.page-link:hover:not([aria-disabled='true']):not(.active) {
  background-color: #f1ede5;
  border-color: #b9aa97;
  color: var(--ink);
}
.page-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}
.page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
  cursor: default;
}
.page-item.disabled .page-link,
.page-link[aria-disabled='true'] {
  color: #b9aa97;
  background-color: #fff;
  border-color: var(--bs-border-color);
  cursor: not-allowed;
  opacity: 0.6;
}
.page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.page-size .form-select {
  min-height: 32px;
  padding: 0.2rem 1.85rem 0.2rem 0.6rem;
  font-size: 0.825rem;
  border-radius: var(--bs-border-radius-sm);
}

/* ----- Toast (Bootstrap 风格，保留底部右侧) ----- */
.toast-stack {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 240px;
  max-width: 360px;
  padding: 0.75rem 0.95rem;
  background-color: #1f2624;
  color: #fff;
  border: 0;
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow-lg);
  font-size: 0.875rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast .toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  font-weight: 800;
  margin-top: 0.1rem;
}
.toast.toast-success { background-color: var(--bs-success); }
.toast.toast-danger { background-color: var(--bs-danger); }
.toast.toast-warning { background-color: var(--bs-warning); color: var(--bs-dark); }
.toast.toast-info { background-color: var(--bs-info); color: var(--bs-dark); }
.toast .toast-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.toast .toast-close:hover { opacity: 1; }

/* ----- Spinner ----- */
.spinner-border {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: -0.125em;
  border: 0.18em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.65s linear infinite;
}
.spinner-border-sm {
  width: 0.85rem;
  height: 0.85rem;
  border-width: 0.15em;
}
.spinner-grow {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: -0.125em;
  background-color: currentColor;
  border-radius: 50%;
  opacity: 0;
  animation: spinner-grow 0.75s linear infinite;
}
@keyframes spinner-border {
  to { transform: rotate(360deg); }
}
@keyframes spinner-grow {
  0% { transform: scale(0); opacity: 0.6; }
  50% { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ----- Breadcrumb ----- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: #b9aa97;
  padding-right: 0.35rem;
}
.breadcrumb-item a {
  color: var(--bs-link-color);
  text-decoration: none;
}
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--ink); }

/* ----- Empty state ----- */
.empty-state-bs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.empty-state-bs .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
  border-radius: 50%;
}
.empty-state-bs h3 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.empty-state-bs p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  max-width: 28rem;
}

/* ----- Dropdown ----- */
.dropdown { position: relative; display: inline-block; }
.dropdown-toggle {
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  display: none;
  min-width: 180px;
  padding: 0.4rem 0;
  margin: 0;
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
  list-style: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.95rem;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--bs-light);
  color: var(--ink);
  outline: 0;
}
.dropdown-divider {
  height: 0;
  margin: 0.4rem 0;
  border-top: 1px solid var(--bs-border-color);
  list-style: none;
}

/* ----- List group ----- */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  overflow: hidden;
}
.list-group-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #fff;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 0.9rem;
}
.list-group-item:last-child { border-bottom: 0; }
.list-group-item:hover { background-color: #fbf7ef; }

/* =====================================================================
   Admin Shell / 侧边栏 / Page Header 改造
   ===================================================================== */
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background-color: var(--bs-body-bg);
}
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.4rem 1rem 1rem;
  background: linear-gradient(180deg, #1c2622 0%, #131a17 100%);
  color: #fffaf2;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 4px 0 18px rgba(15, 23, 25, 0.12);
  z-index: 5;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.2rem 0.5rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fffaf2;
  text-decoration: none;
}
.admin-brand .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 19px;
  background: var(--gold);
  color: #201914;
}
.admin-brand strong {
  display: block;
  font-family: 'Noto Serif SC', serif;
  font-size: 1rem;
  line-height: 1.2;
  color: #fffaf2;
}
.admin-brand small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1.1rem;
  flex: 1 1 auto;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--bs-border-radius);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.admin-nav a:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.admin-nav a.active {
  background-color: rgba(var(--bs-primary-rgb), 0.18);
  color: #fff;
  font-weight: 600;
}
.admin-nav a.active .admin-nav-icon {
  background-color: var(--bs-primary);
  color: #fff;
}
.admin-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.95rem;
  border-radius: var(--bs-border-radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.admin-nav strong,
.admin-nav small {
  display: block;
  line-height: 1.25;
}
.admin-nav small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-section-label {
  margin: 1rem 0.75rem 0.4rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-account {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
  padding: 0.8rem 0.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-account .account-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  background-color: var(--gold);
  color: #201914;
}
.admin-account-info {
  min-width: 0;
  flex: 1 1 auto;
}
.admin-account-info strong,
.admin-account-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}
.admin-account-info strong { font-size: 0.875rem; color: #fffaf2; }
.admin-account-info small { color: rgba(255, 255, 255, 0.5); font-size: 0.7rem; }

.admin-main {
  min-width: 0;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background-color: var(--bs-body-bg);
}

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: 1380px;
  margin: 0 auto 1.4rem;
}
.admin-page-header .header-text {
  min-width: 0;
}
.admin-page-header h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.admin-page-header .header-desc {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 60ch;
}
.admin-page-header .eyebrow {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 列表卡片（包装表格 + 分页） */
.admin-card {
  max-width: 1380px;
  margin: 0 auto;
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: #fff;
}
.admin-card-header h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.admin-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.825rem;
}
.admin-card-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
/* 筛选栏内控件使用紧凑尺寸，与 .btn-sm（高 30px）对齐 */
.filter-bar .form-select,
.filter-bar .form-control {
  min-height: 30px;
  padding: 0.25rem 0.6rem;
  font-size: 0.825rem;
  line-height: 1.4;
  border-radius: var(--bs-border-radius-sm);
}
.filter-bar .form-select {
  width: auto;
  min-width: 9rem;
  padding-right: 1.75rem;
  background-position: right 0.55rem center;
}
.filter-bar .form-control {
  width: auto;
  min-width: 14rem;
}

.table-wrap {
  overflow-x: auto;
}

/* 表格单元格内的强标题 + 摘要 */
.cell-title {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.cell-title:hover { color: var(--bs-primary); }
.cell-meta {
  display: block;
  margin-top: 2px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 数字徽标 */
.count-badge {
  display: inline-flex;
  min-width: 28px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  border-radius: var(--bs-border-radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}
.count-badge.zero {
  background-color: #efebe2;
  color: #8c7f6a;
}

/* =====================================================================
   表单页面（创建/编辑）
   ===================================================================== */
.admin-form {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
}
.admin-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--bs-border-color);
}
.admin-form .form-section-title {
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--bs-border-color);
  color: var(--ink);
  font-family: 'Noto Serif SC', serif;
  font-size: 1rem;
  font-weight: 700;
}
.admin-form .form-section {
  margin-bottom: 1.4rem;
}

/* 编辑器挂载点（UEditor 容器） */
.editor-shell {
  margin: 1.1rem 0 0.4rem;
}
.editor-shell > label,
.editor-shell > .form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.editor-shell > .form-text {
  display: block;
  margin: -2px 0 0.6rem;
}
.editor-mount {
  background-color: #fff;
  border: 1px solid #cfc3b4;
  border-radius: var(--bs-border-radius);
  overflow: hidden;
}
.editor-mount:focus-within {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}

/* 附件管理器 */
.attachment-manager {
  margin: 1.2rem 0;
  padding: 1.05rem 1.2rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  background-color: #fbf7ef;
}
.attachment-manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.attachment-manager-header > div {
  flex: 1 1 auto;
  min-width: 0;
}
.attachment-manager-header strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}
.attachment-manager-header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}
.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.attachment-empty {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  background-color: #fff;
  border: 1px dashed #cfc3b4;
  border-radius: var(--bs-border-radius);
  font-size: 0.85rem;
}
.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.attachment-item:hover { border-color: rgba(var(--bs-primary-rgb), 0.4); }
.attachment-item.pending {
  background-color: #fff8eb;
  border-style: dashed;
  border-color: #f0c98a;
}
.attachment-item.error {
  background-color: #fbeee8;
  border-color: rgba(var(--bs-danger-rgb), 0.4);
}
.attachment-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}
.attachment-type {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--bs-border-color);
  background-color: var(--bs-light);
  color: var(--bs-secondary);
  border-radius: var(--bs-border-radius-sm);
  white-space: nowrap;
}
.attachment-type-image { color: var(--bs-success); background-color: rgba(var(--bs-success-rgb), 0.12); border-color: rgba(var(--bs-success-rgb), 0.3); }
.attachment-type-audio { color: #5d291d; background-color: #f1ddd3; border-color: #e1c1b1; }
.attachment-type-video { color: #5d291d; background-color: #f1ddd3; border-color: #e1c1b1; }
.attachment-type-pdf { color: #6b3a14; background-color: #f5e2cf; border-color: #e2c8ad; }
.attachment-type-document { color: var(--bs-success); background-color: rgba(var(--bs-success-rgb), 0.12); border-color: rgba(var(--bs-success-rgb), 0.3); }
.attachment-type-other { color: var(--bs-secondary); }
.attachment-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-name:hover { color: var(--bs-primary); }
.attachment-size {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.attachment-status {
  display: block;
  flex-basis: 100%;
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--bs-success);
}
.attachment-status.error { color: var(--bs-danger); }
.attachment-status-inline {
  font-size: 0.78rem;
  color: var(--bs-success);
  font-weight: 600;
}
.attachment-status-inline.error { color: var(--bs-danger); }

/* 上传 / 替换按钮（带 file input 包装） */
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--bs-primary);
  background-color: var(--bs-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: var(--bs-transition);
}
.upload-button:hover:not([data-disabled='true']) {
  background-color: var(--bs-primary-hover);
  border-color: var(--bs-primary-hover);
}
.upload-button[data-disabled='true'] {
  opacity: 0.65;
  cursor: not-allowed;
}
.upload-button input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.attachment-button,
.attachment-replace,
.attachment-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--bs-border-color);
  background-color: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--bs-border-radius-sm);
  cursor: pointer;
  transition: var(--bs-transition);
  position: relative;
}
.attachment-button:hover,
.attachment-replace:hover {
  background-color: #f1ede5;
  border-color: #b9aa97;
  color: var(--ink);
}
.attachment-delete {
  color: var(--bs-danger);
  border-color: rgba(var(--bs-danger-rgb), 0.4);
  background-color: #fff;
}
.attachment-delete:hover:not(:disabled) {
  background-color: rgba(var(--bs-danger-rgb), 0.08);
  border-color: var(--bs-danger);
  color: var(--bs-danger);
}
.attachment-button input,
.attachment-replace input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
.attachment-button input:disabled + span,
.attachment-replace input:disabled + span {
  pointer-events: none;
  opacity: 0.6;
}

/* =====================================================================
   编辑弹窗（沿用 BS 模态框，与确认弹窗统一）
   ===================================================================== */
.edit-dialog {
  width: min(720px, calc(100% - 32px));
  max-width: 720px;
  padding: 0;
  border: 0;
  border-radius: var(--bs-border-radius-lg);
  background-color: #fff;
  box-shadow: 0 1.5rem 4rem rgba(15, 23, 25, 0.32);
  color: var(--ink);
}
.edit-dialog::backdrop {
  background-color: rgba(15, 23, 25, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.edit-dialog .bs-modal-header,
.edit-dialog form > .dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.edit-dialog .bs-modal-header h2,
.edit-dialog form > .dialog-heading h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.edit-dialog .bs-modal-header .eyebrow,
.edit-dialog form > .dialog-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.edit-dialog .bs-modal-header .dialog-close,
.edit-dialog form > .dialog-heading .dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -8px;
  padding: 0;
  border: 0;
  background-color: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  border-radius: var(--bs-border-radius-sm);
  cursor: pointer;
  transition: var(--bs-transition);
}
.edit-dialog .bs-modal-header .dialog-close:hover,
.edit-dialog form > .dialog-heading .dialog-close:hover {
  background-color: rgba(15, 23, 25, 0.06);
  color: var(--ink);
}
.edit-dialog form {
  padding: 1.2rem 1.4rem 1.4rem;
}
.edit-dialog .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--bs-border-color);
}

/* =====================================================================
   Auth 页面（登录）
   ===================================================================== */
.auth-page {
  min-height: 100vh;
  background-color: #ece5d6;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  min-height: 100vh;
}
.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.8rem, 4vw, 4.5rem);
  background:
    linear-gradient(180deg, rgba(15, 23, 25, 0.7), rgba(15, 23, 25, 0.92)),
    url('https://www.canada-spirit.com/images/guides/canadian-museums-guide.jpg')
      center/cover no-repeat;
  color: #fffaf2;
}
.auth-brand {
  color: #fffaf2;
  text-decoration: none;
}
.auth-brand .brand-mark {
  background-color: var(--gold);
  color: #201914;
}
.auth-brand small {
  color: rgba(255, 250, 242, 0.7);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-intro h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1;
}
.auth-intro p {
  max-width: 32rem;
  margin: 1rem 0 0;
  color: rgba(255, 250, 242, 0.78);
  font-size: 1rem;
  line-height: 1.6;
}
.auth-footnote {
  margin: 0;
  color: rgba(255, 250, 242, 0.55);
  font-size: 0.78rem;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.8rem, 5vw, 4rem);
  background-color: var(--bs-body-bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 2.2rem 2.2rem 1.8rem;
  background-color: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow);
}
.login-card .form-heading {
  margin: 0 0 1.4rem;
}
.login-card .form-heading h2 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.6rem;
  font-weight: 700;
}
.login-card .form-heading p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.password-field {
  position: relative;
}
.password-field .form-control {
  padding-right: 4.5rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(100% - 8px);
  padding: 0 0.65rem;
  border: 0;
  background-color: transparent;
  color: var(--bs-link-color);
  cursor: pointer;
  font: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  transform: translateY(-50%);
  border-radius: var(--bs-border-radius-sm);
}
.password-toggle:hover {
  color: var(--bs-link-hover-color);
  background-color: rgba(15, 23, 25, 0.05);
}
.back-home {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.back-home:hover { color: var(--bs-link-color); }

/* 响应式 */
@media (max-width: 1100px) {
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-sidebar { padding: 1rem 0.7rem; }
  .admin-brand { padding: 0.2rem 0.4rem 1rem; }
}
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0; }
  .admin-nav a { flex: 1 1 30%; }
  .admin-account { border-top: 0; padding-top: 0; }
  .admin-page-header { flex-direction: column; align-items: stretch; }
  .admin-page-header .header-actions { width: 100%; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { min-height: 220px; }
  .login-panel { padding: 1.5rem 1rem; }
}
@media (max-width: 576px) {
  .admin-main { padding: 1rem; }
  .admin-form { padding: 1.2rem 1rem; }
  .table > :not(caption) > * > * { padding: 0.6rem 0.7rem; }
  .table .table-actions { flex-wrap: wrap; }
  .login-card { padding: 1.5rem 1.2rem 1.2rem; }
}

/* ----- 前台文章详情页 ----- */
.post-article {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.post-back {
  margin: 0 0 24px;
  font-size: 0.9rem;
}
.post-preview-banner {
  margin-bottom: 20px;
  padding: 10px 16px;
  border: 1px solid #e3cf9a;
  border-radius: 6px;
  background: #faf3dd;
  color: #7a5c1e;
  font-size: 0.88rem;
  font-weight: 600;
}
.post-back a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.post-back a:hover { color: var(--accent-strong); }
.post-header {
  margin-bottom: 28px;
  text-align: center;
}
.post-category {
  display: inline-block;
  background: #eef1e6;
  color: var(--moss);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 6px 12px;
}
.post-header h1 {
  margin: 0 0 14px;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.3;
  color: var(--ink);
}
.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.post-meta-divider { margin: 0 8px; }
/* 分类与标签统一展示在一行胶囊里 */
.post-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.post-cover {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.post-content {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink);
}
.post-content > :first-child { margin-top: 0; }
.post-content p { margin: 0 0 1.2em; }
.post-content h2 {
  margin: 2em 0 0.8em;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.55rem;
  line-height: 1.4;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line);
}
.post-content h3 {
  margin: 1.8em 0 0.6em;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.25rem;
}
.post-content h4 { margin: 1.6em 0 0.5em; font-size: 1.08rem; }
.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4em auto;
  border-radius: 6px;
}
.post-content a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content strong { font-weight: 700; }
.post-content blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.2em;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
}
.post-content blockquote p { margin: 0.4em 0; }
.post-content ul,
.post-content ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.post-content li { margin-bottom: 0.4em; }
.post-content pre {
  margin: 1.4em 0;
  padding: 1em 1.2em;
  background: #1f2622;
  color: #e8e4d9;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}
.post-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
}
.post-content :not(pre) > code {
  padding: 0.15em 0.4em;
  background: #eae4d6;
  color: var(--accent-strong);
  border-radius: 4px;
}
.post-content table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post-content th,
.post-content td {
  padding: 0.6em 0.9em;
  border: 1px solid var(--line);
  text-align: left;
}
.post-content th { background: var(--surface); font-weight: 700; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.post-content iframe,
.post-content video {
  display: block;
  max-width: 100%;
  margin: 1.4em auto;
}
.post-tag {
  padding: 4px 12px;
  background: #eef1e6;
  color: var(--moss);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
}

/* 文章相关附件 */
.post-attachments {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.post-attachments h2 {
  margin: 0 0 16px;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.3rem;
  color: var(--ink);
}
.post-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.post-attachment:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.post-attachment-type {
  flex: 0 0 auto;
  background: #eef1e6;
  color: var(--moss);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}
.post-attachment-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-attachment-size {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.post-attachment-download {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

@media (max-width: 576px) {
  .post-article { padding: 28px 18px 56px; }
  .post-content { font-size: 1rem; line-height: 1.8; }
}


