:root {
  color-scheme: light;
  --header-height: 68px;
  --nav-width: 246px;
  --ink: #14252d;
  --ink-soft: #33454e;
  --muted: #758188;
  --quiet: #98a2a7;
  --line: #e0e6e6;
  --line-strong: #cfd8d9;
  --wash: #f5f8f7;
  --surface: #ffffff;
  --blue: #356ac3;
  --blue-dark: #27539d;
  --blue-wash: #eaf1fd;
  --cyan: #6ed5c1;
  --green: #3a9d7c;
  --green-wash: #edf8f4;
  --amber: #9a6b16;
  --amber-wash: #fff8e8;
  --red: #b54747;
  --red-wash: #fff0f0;
  --shadow-sm: 0 4px 16px rgba(20, 37, 45, .045);
  --shadow-md: 0 16px 45px rgba(20, 37, 45, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--surface); line-height: 1.55; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(53, 106, 195, .22);
  outline-offset: 2px;
}

.topbar {
  position: fixed; z-index: 50; inset: 0 0 auto; height: var(--header-height);
  display: grid; grid-template-columns: var(--nav-width) minmax(180px, 1fr) auto; align-items: center;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
}
.brand { height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 23px; height: 23px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; position: relative; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; width: 2px; height: 9px; background: var(--blue); transform: rotate(45deg); }
.brand-mark::before { transform: translate(-4px, 1px) rotate(45deg); }
.brand-mark::after { transform: translate(4px, -1px) rotate(45deg); }
.brand-name { font-size: 12px; font-weight: 850; letter-spacing: .15em; }
.brand-divider { width: 1px; height: 18px; margin-left: 2px; background: #cdd5d6; }
.brand-product { color: var(--blue); font-size: 10px; font-weight: 760; letter-spacing: .13em; }
.topbar-center { min-width: 0; padding: 0 24px; display: flex; justify-content: center; }
.search-trigger {
  width: min(520px, 100%); height: 40px; padding: 0 10px 0 14px; display: flex; align-items: center; gap: 10px;
  border: 1px solid #dfe5e5; border-radius: 9px; background: #f7f9f8; color: #7c878d; font-size: 12px; text-align: left;
}
.search-trigger:disabled { opacity: 1; cursor: not-allowed; }
.topbar-search-form {
  width: min(520px, 100%); height: 40px; padding: 0 7px 0 14px; display: flex; align-items: center; gap: 9px;
  border: 1px solid #dfe5e5; border-radius: 9px; background: #f7f9f8;
}
.topbar-search-form:focus-within { border-color: #9bb7e6; box-shadow: 0 0 0 3px #edf3ff; }
.topbar-search-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.topbar-search-form input::placeholder { color: #7c878d; }
.topbar-search-form button { padding: 5px 9px; border: 0; border-radius: 6px; background: var(--ink); color: white; font-size: 9px; cursor: pointer; }
.search-symbol { color: #40535c; font-size: 22px; line-height: 1; transform: rotate(-15deg); }
kbd { min-width: 26px; height: 22px; margin-left: auto; padding: 0 5px; border: 1px solid #d6dede; border-bottom-width: 2px; border-radius: 5px; background: white; color: #6d787e; font-size: 9px; line-height: 19px; text-align: center; }
.topbar-actions { padding-right: 22px; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.text-link, .text-button { border: 0; background: transparent; color: #536168; font-size: 11px; text-decoration: none; cursor: pointer; }
.workspace-button { padding: 9px 14px; border-radius: 7px; background: var(--ink); color: white; font-size: 11px; font-weight: 730; text-decoration: none; transition: transform .15s, background .15s; }
.workspace-button:hover { background: #293b44; transform: translateY(-1px); }
.inline { display: inline; }
.mobile-menu { display: none; }

.sidebar {
  position: fixed; z-index: 30; inset: var(--header-height) auto 0 0; width: var(--nav-width);
  display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--wash);
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 28px 18px 18px; }
.sidebar-eyebrow { margin: 0 0 24px 8px; color: #909a9f; font-size: 9px; font-weight: 820; letter-spacing: .18em; text-transform: uppercase; }
.nav-section { margin-bottom: 28px; }
.nav-section-title { margin: 0 0 8px 9px; color: #59666d; font-size: 10px; font-weight: 780; letter-spacing: .05em; }
.nav-item { width: 100%; min-height: 40px; padding: 9px 10px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 5px; border-radius: 7px; color: #657179; font-size: 12px; text-decoration: none; transition: color .15s, background .15s; }
.nav-item:hover:not(.disabled) { color: var(--ink); background: #ebf0ef; }
.nav-item.active { color: var(--blue-dark); background: var(--blue-wash); font-weight: 720; }
.nav-item.disabled { color: #a3abad; cursor: default; }
.nav-item small { font-size: 8px; }
.nav-icon { font-size: 15px; line-height: 1; text-align: center; }
.sidebar-footer { padding: 14px 14px 18px; border-top: 1px solid var(--line); }
.workspace-card { padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #dde4e3; border-radius: 10px; background: white; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.workspace-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: var(--cyan); }
.workspace-card strong, .workspace-card small { display: block; }
.workspace-card strong { font-size: 11px; }
.workspace-card small { margin-top: 1px; color: #899398; font-size: 9px; }
.workspace-card b { margin-left: auto; color: #8c969b; font-weight: 400; }
.nav-backdrop { display: none; }

.site-main { min-height: 100vh; padding-top: var(--header-height); }
.public-main { background: var(--surface); }
.admin-main { margin-left: var(--nav-width); padding: calc(var(--header-height) + 34px) clamp(24px, 4vw, 58px) 80px; background: #f7f9f8; }
.content-width { width: min(1420px, 100%); margin-inline: auto; }
.content-narrow { width: min(720px, 100%); margin-inline: auto; }

.page-heading { margin: 0 auto 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading-copy { min-width: 0; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 9px; font-weight: 820; letter-spacing: .16em; text-transform: uppercase; }
.page-heading h1, .auth-card h1, .public-hero h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-weight: 500; line-height: 1.12; letter-spacing: -.04em; }
.page-heading h1 { font-size: clamp(30px, 4vw, 43px); }
.page-heading p { max-width: 700px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.breadcrumb { margin-bottom: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--quiet); font-size: 10px; }
.breadcrumb a { color: #77838a; text-decoration: none; }
.breadcrumb span { color: #bec5c7; }

.button, button.button {
  min-height: 39px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--ink); border-radius: 7px; background: var(--ink); color: white; font-size: 11px; font-weight: 730; text-decoration: none; cursor: pointer;
  transition: background .15s, border .15s, transform .15s;
}
.button:hover { background: #2a3c45; transform: translateY(-1px); }
.button.primary-blue { border-color: var(--blue); background: var(--blue); }
.button.primary-blue:hover { background: var(--blue-dark); }
.button.secondary { border-color: #d6dede; background: white; color: #536168; }
.button.secondary:hover { border-color: #bfcaca; background: #fbfcfc; }
.button.danger { border-color: #e7c4c4; background: white; color: var(--red); }
.button.danger:hover { border-color: var(--red); background: var(--red-wash); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }

.panel { padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-flat { box-shadow: none; }
.panel-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-header h2, .panel h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 20px; font-weight: 500; letter-spacing: -.025em; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.stack { display: grid; gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, .75fr); gap: 18px; align-items: start; }
.sidebar-stack { position: sticky; top: calc(var(--header-height) + 28px); }

.field { display: grid; gap: 6px; }
.field label { color: #718087; font-size: 9px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dfe5e5; border-radius: 6px; outline: 0; background: white; color: var(--ink); font-size: 12px;
  transition: border .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #8eafe9; box-shadow: 0 0 0 3px #edf3ff; }
.field input[readonly], .field textarea[readonly] { background: #f7f9f8; color: #6e7a80; }
.hint, .meta { color: var(--muted); font-size: 10px; }
.validation-summary-errors, .field-validation-error { color: var(--red); font-size: 11px; }
.validation-summary-errors { margin-bottom: 16px; padding: 11px 14px; border-left: 3px solid var(--red); border-radius: 0 7px 7px 0; background: var(--red-wash); }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

.notice { width: min(1420px, 100%); margin: 0 auto 18px; padding: 11px 14px; display: flex; align-items: center; gap: 9px; border-left: 3px solid var(--blue); border-radius: 0 7px 7px 0; background: var(--blue-wash); color: #36516e; font-size: 11px; }
.notice-success { border-color: var(--green); background: var(--green-wash); color: #2d6957; }
.notice.warning { border-color: #d5a340; background: var(--amber-wash); color: #76551a; }
.notice.error { border-color: var(--red); background: var(--red-wash); color: #8d3d3d; }

.item-list { margin: 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.item-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.item-card h3 { margin: 0 0 5px; font-family: Georgia, "Noto Serif TC", serif; font-size: 15px; font-weight: 500; }
.item-card h3 a { color: var(--ink); text-decoration: none; }
.item-card h3 a:hover { color: var(--blue); }
.item-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.item-meta { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--quiet); font-size: 9px; }
.item-meta span + span::before { content: "·"; margin-right: 8px; color: #c3c9cb; }
.empty-state { padding: 34px 20px; border: 1px dashed #d4dddd; border-radius: 9px; background: #fbfcfc; text-align: center; }
.empty-icon { width: 42px; height: 42px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-wash); color: var(--blue); font-size: 19px; }
.empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.empty-state p { margin: 6px auto 0; max-width: 440px; color: var(--muted); font-size: 11px; }

.public-hero { padding: clamp(90px, 14vh, 150px) 5vw 78px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, #fbfcfc 100%); }
.public-hero-inner { width: min(920px, 100%); margin-inline: auto; text-align: center; }
.public-hero .eyebrow { margin-bottom: 18px; }
.public-hero h1 { font-size: clamp(48px, 8vw, 82px); }
.public-hero .lead { max-width: 650px; margin: 22px auto 0; color: #68757c; font-family: Georgia, "Noto Serif TC", serif; font-size: 17px; line-height: 1.8; }
.hero-search { width: min(720px, 100%); height: 58px; margin: 38px auto 0; padding: 0 15px 0 20px; display: flex; align-items: center; gap: 13px; border: 1px solid #d8dfdf; border-radius: 11px; background: white; box-shadow: 0 14px 38px rgba(20,37,45,.075); color: #7c878d; text-align: left; }
.hero-search strong { color: var(--blue); font-size: 26px; transform: rotate(-15deg); }
.hero-search:focus-within { border-color: #9bb7e6; box-shadow: 0 14px 38px rgba(20,37,45,.075), 0 0 0 4px #edf3ff; }
.hero-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.hero-search input::placeholder { color: #7c878d; }
.hero-search button { padding: 8px 13px; border: 0; border-radius: 7px; background: var(--blue); color: white; font-size: 10px; font-weight: 730; cursor: pointer; }
.hero-search button:hover { background: var(--blue-dark); }
.public-section { width: min(1120px, 90vw); margin: 0 auto; padding: 58px 0 90px; }
.section-heading { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.03em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.library-placeholder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.library-placeholder { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.library-placeholder .placeholder-number { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.library-placeholder h3 { margin: 28px 0 5px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.library-placeholder p { margin: 0; color: var(--muted); font-size: 10px; }

.public-count { padding: 5px 9px; border-radius: 999px; background: var(--wash); color: var(--muted); font-size: 9px; }
.public-empty-state { padding: 55px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fbfcfc; text-align: center; }
.public-empty-state > span { width: 46px; height: 46px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-wash); color: var(--blue); font-size: 20px; }
.public-empty-state h3 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 20px; font-weight: 500; }
.public-empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.public-library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.public-library-card { min-height: 180px; padding: 20px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .16s, border-color .16s, box-shadow .16s; }
.public-library-card:hover { transform: translateY(-3px); border-color: #bdcfe9; box-shadow: var(--shadow-md); }
.public-library-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-wash); color: var(--blue); font-size: 17px; }
.public-library-copy small, .public-library-copy strong, .public-library-copy > span { display: block; }
.public-library-copy small { color: var(--blue); font-size: 8px; font-weight: 760; letter-spacing: .06em; }
.public-library-copy strong { margin-top: 22px; font-family: Georgia, "Noto Serif TC", serif; font-size: 20px; font-weight: 500; }
.public-library-copy > span { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.public-library-card > b { align-self: end; color: var(--quiet); font-weight: 400; }

.public-search-page { width: min(940px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 90px; }
.public-search-heading { margin: 26px 0 25px; }
.public-search-heading h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(38px, 6vw, 58px); font-weight: 500; letter-spacing: -.045em; }
.public-search-heading > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.public-search-form { height: 58px; padding: 0 9px 0 17px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line-strong); border-radius: 11px; background: white; box-shadow: var(--shadow-sm); }
.public-search-form:focus-within { border-color: #9bb7e6; box-shadow: 0 0 0 4px #edf3ff; }
.public-search-form input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; }
.public-search-form button { padding: 9px 17px; border: 0; border-radius: 7px; background: var(--blue); color: white; font-size: 11px; font-weight: 730; cursor: pointer; }
.public-search-form button:hover { background: var(--blue-dark); }
.public-search-validation.validation-summary-valid { display: none; }
.public-search-validation.validation-summary-errors { margin-top: 12px; }
.public-search-prompt { padding: 72px 20px 55px; text-align: center; }
.public-search-prompt > span { color: #c4cccf; font-size: 42px; }
.public-search-prompt h2, .public-search-empty h2 { margin: 10px 0 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 22px; font-weight: 500; }
.public-search-prompt p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.public-search-empty { margin-top: 24px; }
.public-search-summary { margin: 25px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; }
.public-search-summary p { margin: 0; }
.public-search-summary strong { color: var(--ink); font-size: 13px; }
.public-search-summary span { color: var(--amber); }
.public-search-results { margin: 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.public-search-results > li { padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow-sm); }
.public-search-result-path { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--blue); font-size: 9px; }
.public-search-result-path span + span::before { content: "/"; margin-right: 6px; color: #bec7ca; }
.public-search-results h2 { margin: 7px 0 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 21px; font-weight: 500; }
.public-search-results h2 a { color: var(--ink); text-decoration: none; }
.public-search-results h2 a:hover { color: var(--blue); }
.public-search-result-summary { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; }
.public-search-result-snippet { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.public-search-result-meta { margin-top: 13px; display: flex; align-items: center; gap: 10px; color: var(--quiet); font-size: 9px; }
.public-search-result-meta a { color: #687981; text-decoration: none; }
.public-search-result-meta span::before { content: "·"; margin-right: 10px; color: #c4cbcd; }
.public-search-libraries { margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--line); }
.public-search-libraries h2 { margin: 0 0 12px; font-family: Georgia, "Noto Serif TC", serif; font-size: 19px; font-weight: 500; }
.public-search-libraries > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.public-search-libraries a { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.public-search-libraries a span { color: var(--quiet); font-size: 9px; }
.public-search-libraries a strong { font-family: Georgia, "Noto Serif TC", serif; font-size: 13px; font-weight: 500; }

.public-library-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 90px; }
.public-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--quiet); font-size: 9px; }
.public-breadcrumb a { color: #6e7d85; text-decoration: none; }
.public-breadcrumb strong { color: #536168; font-weight: 650; }
.public-breadcrumb span { color: #c4cbcd; }
.public-library-heading { margin: 25px 0 34px; padding-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.public-library-heading h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(38px, 6vw, 62px); font-weight: 500; letter-spacing: -.045em; }
.public-library-heading p:last-child { max-width: 680px; margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.public-library-heading > span { padding: 6px 10px; border-radius: 999px; background: var(--wash); color: var(--muted); font-size: 9px; white-space: nowrap; }
.public-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.public-category-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.public-category-card header { margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.public-category-card header > span { color: var(--blue); }
.public-category-card h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; font-weight: 500; }
.public-category-children { margin: 14px 0 0 13px; padding-left: 13px; display: grid; gap: 9px; border-left: 1px solid var(--line); }
.public-category-children .public-category-card { padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.public-document-list { display: grid; gap: 6px; }
.public-document-list > a { min-width: 0; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 7px; background: var(--wash); color: var(--ink); text-decoration: none; }
.public-document-list > a:hover { background: var(--blue-wash); }
.public-document-list strong, .public-document-list small { display: block; }
.public-document-list strong { font-size: 10px; }
.public-document-list small { max-width: 460px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.public-document-list b { color: var(--quiet); font-weight: 400; }
.uncategorized-documents { margin-top: 28px; }
.uncategorized-documents h2 { margin: 0 0 13px; font-family: Georgia, "Noto Serif TC", serif; font-size: 24px; font-weight: 500; }

.public-document-shell { min-height: calc(100vh - var(--header-height)); display: grid; grid-template-columns: 245px minmax(0, 1fr) 210px; background: white; }
.public-doc-sidebar { min-width: 0; padding: 27px 16px 50px; border-right: 1px solid var(--line); background: #f8faf9; }
.public-doc-library { padding: 10px; display: flex; align-items: center; gap: 9px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.public-doc-library:hover { background: #edf2f1; }
.public-doc-library > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: var(--cyan); }
.public-doc-library small, .public-doc-library strong { display: block; }
.public-doc-library small { color: var(--quiet); font-size: 7px; letter-spacing: .08em; }
.public-doc-library strong { margin-top: 1px; font-size: 10px; }
.public-doc-tree { margin-top: 20px; display: grid; gap: 4px; }
.public-nav-category { font-size: 9px; }
.public-nav-category summary { padding: 7px 8px; border-radius: 6px; color: #52636b; font-weight: 720; cursor: pointer; list-style: none; }
.public-nav-category summary::before { content: "›"; margin-right: 7px; color: var(--quiet); }
.public-nav-category[open] > summary::before { content: "⌄"; }
.public-nav-category > div { margin-left: 8px; padding-left: 8px; display: grid; gap: 2px; border-left: 1px solid #dde4e3; }
.public-doc-tree a { padding: 6px 8px; display: block; overflow: hidden; border-radius: 5px; color: #748087; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.public-doc-tree a:hover { color: var(--ink); background: #edf2f1; }
.public-doc-tree a.active { color: var(--blue-dark); background: var(--blue-wash); font-weight: 720; }
.public-document-main { min-width: 0; padding: 34px clamp(28px, 5vw, 76px) 90px; }
.public-article { width: min(820px, 100%); margin: 26px auto 0; }
.public-article-heading { margin-bottom: 42px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.public-article-heading h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(38px, 5vw, 58px); font-weight: 500; line-height: 1.13; letter-spacing: -.045em; }
.public-article-heading > p:last-of-type { max-width: 680px; margin: 17px 0 0; color: #66747b; font-family: Georgia, "Noto Serif TC", serif; font-size: 16px; line-height: 1.8; }
.public-article-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--quiet); font-size: 8px; }
.public-markdown-content { color: #344149; font-family: Georgia, "Noto Serif TC", serif; font-size: 15px; line-height: 1.95; }
.public-markdown-content h2, .public-markdown-content h3 { scroll-margin-top: calc(var(--header-height) + 20px); font-family: ui-sans-serif, -apple-system, sans-serif; }
.public-markdown-content img { margin: 28px auto; border-radius: 9px; }
.public-toc-sidebar { padding: 37px 16px 50px; border-left: 1px solid var(--line); background: #fbfcfc; }
.public-toc-title { margin: 20px 8px 8px; color: #68767c; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.public-toc-sidebar nav { display: grid; gap: 2px; }
.public-toc-sidebar nav a { padding: 5px 8px; border-left: 2px solid transparent; color: #829096; font-size: 8px; line-height: 1.5; text-decoration: none; }
.public-toc-sidebar nav a:hover { border-color: var(--blue); color: var(--blue-dark); }
.public-toc-sidebar nav a.toc-depth-3 { padding-left: 17px; }
.public-toc-sidebar.toc-empty .public-toc-title { display: none; }
.public-edit-link { padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #cddcf4; border-radius: 7px; background: var(--blue-wash); color: var(--blue-dark); font-size: 9px; font-weight: 720; text-decoration: none; }
.public-unavailable { min-height: calc(100vh - var(--header-height)); padding: 90px 20px; display: flex; align-items: center; flex-direction: column; text-align: center; background: var(--wash); }
.public-unavailable > span { width: 52px; height: 52px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 13px; background: white; color: var(--blue); font-size: 23px; box-shadow: var(--shadow-sm); }
.public-unavailable h1 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 40px; font-weight: 500; }
.public-unavailable > p:not(.eyebrow) { margin: 13px 0 23px; color: var(--muted); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.dashboard-primary { min-height: 280px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow-md); }
.dashboard-primary .eyebrow { color: var(--cyan); }
.dashboard-primary h2 { max-width: 560px; margin: 0; font-family: Georgia, serif; font-size: clamp(28px, 4vw, 42px); font-weight: 500; line-height: 1.2; letter-spacing: -.035em; }
.dashboard-primary p { max-width: 590px; color: #b9c5c9; font-size: 12px; }
.dashboard-primary .button { width: fit-content; border-color: white; background: white; color: var(--ink); }
.dashboard-side { display: grid; gap: 18px; }
.phase-list { margin: 0; padding: 0; list-style: none; }
.phase-list li { padding: 12px 0; display: grid; grid-template-columns: 24px 1fr; gap: 8px; border-bottom: 1px solid var(--line); }
.phase-list li:last-child { border-bottom: 0; }
.phase-list b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-wash); color: var(--blue); font-size: 9px; }
.phase-list strong, .phase-list small { display: block; }
.phase-list strong { font-size: 11px; }
.phase-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.auth-page { min-height: calc(100vh - var(--header-height)); padding: 70px 20px; display: grid; place-items: center; background: var(--wash); }
.auth-card { width: min(560px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-md); }
.auth-symbol { width: 46px; height: 46px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--cyan); font-size: 21px; }
.auth-card h1 { font-size: 34px; }
.auth-card > p { margin: 15px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.8; }

.library-workspace-heading { margin-bottom: 22px; }
.workspace-tabs { margin-bottom: 16px; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.workspace-tabs a { padding: 11px 14px; display: inline-flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workspace-tabs a:hover { color: var(--ink); }
.workspace-tabs a.active { border-color: var(--blue); color: var(--blue-dark); }
.workspace-tabs span { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #e8eeee; color: #607078; font-size: 8px; text-align: center; }
.workspace-tabs a.active span { background: var(--blue-wash); color: var(--blue-dark); }
.workspace-panel { min-height: 380px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-sm); }
.workspace-panel-heading { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.workspace-panel-heading h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 25px; font-weight: 500; }
.workspace-panel-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.workspace-empty .button { margin-top: 16px; }
.workspace-document-list { display: grid; gap: 8px; }
.workspace-document-row { min-width: 0; padding: 13px 14px; display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(180px, .75fr) minmax(120px, .45fr) 34px; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.workspace-document-row:hover { border-color: #c9d8ec; box-shadow: var(--shadow-sm); }
.workspace-document-row.inactive { grid-template-columns: minmax(260px, 1fr) minmax(160px, .45fr) minmax(300px, .9fr); }
.workspace-document-main { min-width: 0; display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.workspace-document-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--blue-wash); color: var(--blue); }
.workspace-document-main strong, .workspace-document-main small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-document-main strong { font-family: Georgia, "Noto Serif TC", serif; font-size: 14px; font-weight: 500; }
.workspace-document-main small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.workspace-category-paths { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.category-chip { max-width: 100%; padding: 3px 7px; overflow: hidden; border-radius: 999px; background: var(--green-wash); color: #2d6957; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.category-chip.unassigned { background: var(--wash); color: var(--quiet); }
.workspace-document-state strong, .workspace-document-state small { display: block; }
.workspace-document-state strong { color: var(--ink-soft); font-size: 9px; }
.workspace-document-state small { margin-top: 2px; color: var(--quiet); font-size: 8px; }
.row-actions { position: relative; }
.row-actions > summary { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); cursor: pointer; list-style: none; }
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions > summary:hover { background: var(--wash); }
.row-actions > div { position: absolute; z-index: 10; top: 37px; right: 0; width: 280px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow-md); }
.inactive-restore-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.navigation-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.navigation-tree-panel, .category-settings-panel { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.category-settings-panel > h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 19px; font-weight: 500; }
.navigation-tree, .navigation-tree ul { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.navigation-tree .navigation-tree { margin: 7px 0 0 25px; padding-left: 13px; border-left: 1px solid var(--line); }
.navigation-tree-category { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.navigation-tree-category > details > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 7px; cursor: pointer; list-style: none; }
.navigation-tree-category > details > summary::-webkit-details-marker { display: none; }
.navigation-tree-category > details > summary strong { font-size: 11px; }
.navigation-tree-category > details > summary small, .navigation-tree-category > details > summary span:last-child { color: var(--quiet); font-size: 8px; }
.navigation-folder { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: var(--green-wash); color: var(--green); }
.navigation-tree-children { margin-top: 8px; }
.navigation-document-list { display: grid; gap: 4px; }
.navigation-document-list a { padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 6px; background: var(--blue-wash); color: var(--blue-dark); text-decoration: none; }
.navigation-document-list strong { font-size: 9px; }
.navigation-document-list small { color: var(--muted); font-size: 8px; }
.uncategorized-workspace { margin-top: 18px; padding-top: 15px; border-top: 1px dashed var(--line-strong); }
.uncategorized-workspace h3 { margin: 0; font-size: 11px; }
.uncategorized-workspace h3 span { color: var(--quiet); font-size: 9px; }
.uncategorized-workspace > p { color: var(--muted); font-size: 9px; }
.uncategorized-workspace > div { margin-top: 8px; display: grid; gap: 5px; }
.uncategorized-workspace a { padding: 7px 9px; display: flex; justify-content: space-between; border-radius: 7px; background: white; color: var(--ink-soft); font-size: 9px; text-decoration: none; }
.uncategorized-workspace a span { color: var(--blue); }
.workspace-dialog { width: min(620px, calc(100% - 30px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); box-shadow: 0 24px 80px rgba(20,37,45,.24); }
.workspace-dialog::backdrop { background: rgba(18,34,41,.48); backdrop-filter: blur(3px); }
.workspace-dialog > form, .workspace-dialog > .creation-mode-tabs { margin-inline: 24px; }
.workspace-dialog > form { margin-bottom: 24px; }
.workspace-dialog > .validation-summary-errors { margin: 0 24px 18px; }
.workspace-dialog.compact-dialog { width: min(480px, calc(100% - 30px)); }
.dialog-heading { padding: 22px 24px 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 25px; font-weight: 500; }
.dialog-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.dialog-heading > button { width: 31px; height: 31px; border: 0; border-radius: 7px; background: var(--wash); color: var(--muted); font-size: 20px; cursor: pointer; }
.creation-mode-tabs { margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 8px; background: var(--wash); }
.creation-mode-tabs button { padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 720; cursor: pointer; }
.creation-mode-tabs button.active { background: white; color: var(--blue-dark); box-shadow: var(--shadow-sm); }
.creation-form[hidden] { display: none; }
.markdown-dropzone { min-height: 145px; padding: 22px; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed #aebfcf; border-radius: 10px; background: #f8fbff; color: var(--ink-soft); text-align: center; cursor: pointer; }
.markdown-dropzone:hover { border-color: var(--blue); background: var(--blue-wash); }
.markdown-dropzone.is-dragging { border-color: var(--blue); background: var(--blue-wash); box-shadow: inset 0 0 0 2px rgba(53,106,195,.12); color: var(--blue-dark); }
.markdown-dropzone > span { color: var(--blue); font-size: 24px; }
.markdown-dropzone strong { font-size: 12px; }
.markdown-dropzone small { color: var(--muted); font-size: 9px; }
.markdown-dropzone input { width: 1px; height: 1px; position: absolute; opacity: 0; }
.creation-file-summary { padding: 8px 10px; border-radius: 7px; background: var(--green-wash); color: #2d6957; font-size: 9px; }
.creation-file-summary.is-error { background: var(--red-wash); color: var(--red); }

.category-tree { display: grid; gap: 8px; }
.category-node { border: 1px solid var(--line); border-radius: 8px; background: white; }
.category-node > summary { padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.category-node > summary::-webkit-details-marker { display: none; }
.category-node > summary::before { content: "›"; color: var(--quiet); font-size: 17px; transition: transform .15s; }
.category-node[open] > summary::before { transform: rotate(90deg); }
.category-node-title { font-size: 12px; font-weight: 720; }
.category-node-slug { color: var(--quiet); font: 9px/1.4 ui-monospace, monospace; }
.category-node-depth { margin-left: auto; color: var(--quiet); font-size: 9px; }
.category-node-form { padding: 15px; border-top: 1px solid var(--line); background: #fbfcfc; }
.compact-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 90px; gap: 10px; }

.editor-page { width: min(1540px, 100%); margin-inline: auto; }
.editor-page .page-heading { margin-bottom: 18px; }
.editor-status-row { margin-bottom: 14px; }
.document-fields { margin-bottom: 14px; padding: 17px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.document-title-field input { font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; }
.editor-onboarding { margin-bottom: 14px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px dashed #aebfcf; border-radius: 10px; background: #f8fbff; }
.editor-onboarding h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 20px; font-weight: 500; }
.editor-onboarding p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.editor-workspace { min-width: 0; }
.editor-tabs { height: 41px; display: flex; align-items: flex-end; justify-content: space-between; }
.editor-tab-group { display: flex; }
.editor-tab { padding: 9px 14px; border: 0; border-radius: 7px 7px 0 0; background: transparent; color: #849095; font-size: 10px; cursor: pointer; }
.editor-tab.active { background: white; color: var(--blue); font-weight: 720; }
.editor-save-state { padding-bottom: 9px; color: var(--quiet); font: 9px/1 ui-monospace, monospace; }
.editor-shell { height: calc(100vh - 345px); min-height: 540px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #dfe4e4; border-radius: 0 10px 10px 10px; background: white; box-shadow: 0 12px 35px rgba(24,42,48,.06); }
.editor-pane, .preview-pane { min-width: 0; display: flex; flex-direction: column; }
.editor-pane { border-right: 1px solid var(--line); }
.editor-toolbar { min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.editor-toolbar button { min-width: 29px; height: 28px; padding: 0 7px; border: 0; border-radius: 5px; background: transparent; color: #607078; font-size: 10px; font-weight: 760; cursor: pointer; }
.editor-toolbar button:hover { background: #edf1f1; color: var(--ink); }
.editor-toolbar .toolbar-separator { width: 1px; height: 18px; margin: 0 5px; background: #dce2e2; }
.editor-toolbar .save-button { margin-left: auto; min-width: 72px; border: 1px solid #dbe2e2; background: white; color: var(--blue); }
.editor-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.editor-textarea { flex: 1; width: 100%; resize: none; border: 0; outline: 0; padding: 24px 26px; color: #26363f; background: #fbfcfc; font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.preview-label { height: 46px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #8c979b; font-size: 9px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.preview-label i { color: var(--green); font-size: 7px; }
.editor-preview { flex: 1; overflow: auto; padding: 28px 38px 60px; }
.editor-preview-empty { color: var(--quiet); font-family: Georgia, serif; font-size: 14px; }
.editor-shell.view-write { grid-template-columns: 1fr; }
.editor-shell.view-write .preview-pane { display: none; }
.editor-shell.view-preview { grid-template-columns: 1fr; }
.editor-shell.view-preview .editor-pane { display: none; }
.editor-aside { position: sticky; top: calc(var(--header-height) + 20px); display: grid; gap: 12px; }
.editor-aside-tabs { padding: 3px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 9px; background: #edf1f1; }
.editor-aside-tabs button { min-width: 0; padding: 7px 3px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 8px; font-weight: 730; cursor: pointer; }
.editor-aside-tabs button.active { background: white; color: var(--blue-dark); box-shadow: var(--shadow-sm); }
.aside-tab-panel[hidden] { display: none; }
.editor-aside .panel { padding: 17px; box-shadow: none; }
.editor-aside .panel h2 { font-size: 16px; }
.editor-aside .panel > h2 + form, .editor-aside .panel > h2 + p { margin-top: 12px; }
.editor-category-list { margin: 14px 0; }
.editor-category-add { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.editor-settings-fields { margin-top: 14px; }
.compact-form { margin: 11px 0 7px; }
.preview-label .has-warning { color: var(--amber); }
.editor-shell.is-dragging-media { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(53,106,195,.12); }
.media-upload-state { margin: 12px 0; padding: 9px 10px; border-radius: 6px; background: var(--wash); color: var(--muted); font-size: 9px; }
.media-upload-state.is-uploading { background: var(--blue-wash); color: var(--blue-dark); }
.media-upload-state.is-success { background: var(--green-wash); color: #2d6957; }
.media-upload-state.is-warning { background: #fff8e6; color: var(--amber); }
.media-upload-state.is-error { background: var(--red-wash); color: var(--red); }
.media-reference-list { max-height: 210px; margin: 0; padding: 0; display: grid; gap: 7px; overflow-y: auto; list-style: none; }
.media-reference-list:empty::after { content: "尚未上傳媒體。"; padding: 8px 0; color: var(--quiet); font-size: 9px; }
.media-reference-list li { padding: 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfc; }
.media-reference-list strong, .media-reference-list small { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-reference-list strong { font-size: 9px; }
.media-reference-list small { margin-top: 2px; color: var(--quiet); font-size: 8px; }
.media-kind { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--blue-wash); color: var(--blue); font-size: 12px; }
.revision-summary-field { margin-top: 12px; }
.revision-save-button { width: 100%; margin-top: 9px; }
.revision-list { max-height: 220px; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; overflow-y: auto; list-style: none; }
.revision-list:empty::after { content: "尚未建立 Revision。"; color: var(--quiet); font-size: 9px; }
.revision-list li { padding: 9px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfc; }
.revision-list-heading, .revision-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.revision-list strong { font-size: 9px; }
.revision-list small { color: var(--quiet); font-size: 8px; }
.revision-list span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.revision-preview-button { justify-self: start; margin-top: 3px; }
.revision-list-actions { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 10px; }
.revision-list-actions form { display: inline; }
.revision-preview-card { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.revision-preview-card[hidden] { display: none; }
.revision-preview-heading strong, .revision-preview-heading small { display: block; }
.revision-preview-heading strong { font-size: 10px; }
.revision-preview-heading small { margin-top: 2px; color: var(--quiet); font-size: 8px; }
.revision-preview-content { max-height: 260px; margin: 9px 0; padding: 10px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 10px; }
.revision-preview-content + .button { width: 100%; }
.markdown-content .media-unavailable { opacity: .55; }
.review-active-card { margin-top: 12px; padding: 12px; border: 1px solid #cddcf4; border-radius: 8px; background: var(--blue-wash); }
.review-active-card > strong { margin-top: 9px; display: block; font-size: 11px; }
.review-active-card .button { width: 100%; }
.review-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.review-card-heading small { color: var(--quiet); font-size: 9px; white-space: nowrap; }
.review-status { width: fit-content; padding: 3px 7px; display: inline-flex; border-radius: 999px; font-size: 8px; font-weight: 780; letter-spacing: .05em; }
.review-status.in-review { background: var(--blue-wash); color: var(--blue-dark); }
.review-history, .review-queue { margin: 14px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.review-history { padding-top: 13px; border-top: 1px solid var(--line); }
.review-history li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-history li:last-child { border-bottom: 0; }
.review-history strong { font-size: 9px; }
.review-history p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.review-queue { margin-top: 0; }
.review-queue .item-card { padding: 20px; }
.review-queue h2 { margin: 9px 0 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 20px; font-weight: 500; }
.review-queue p { margin: 8px 0 0; }
.review-queue .actions { margin-top: 15px; }
.review-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.review-document { min-width: 0; padding: clamp(24px, 4vw, 56px); }
.review-document-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--quiet); font-size: 9px; }
.review-document-summary { margin: 22px 0 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: Georgia, "Noto Serif TC", serif; font-size: 16px; line-height: 1.8; }
.review-content { color: #344149; font-family: Georgia, "Noto Serif TC", serif; font-size: 14px; line-height: 1.9; }
.review-publish-form { margin-top: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.review-publish-form .button, .review-decision-form .button { width: 100%; }
.review-decision-form { margin-top: 15px; }
.review-metadata { margin: 14px 0 0; display: grid; gap: 12px; }
.review-metadata div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.review-metadata div:last-child { padding-bottom: 0; border-bottom: 0; }
.review-metadata dt { color: var(--quiet); font-size: 8px; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.review-metadata dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 10px; overflow-wrap: anywhere; }

.access-layout { display: grid; grid-template-columns: minmax(250px, .56fr) minmax(0, 1.44fr); gap: 18px; align-items: start; }
.account-picker-panel { position: sticky; top: calc(var(--header-height) + 28px); padding: 17px; }
.account-search-field { margin-bottom: 12px; }
.account-picker-list { display: grid; gap: 5px; }
.account-picker-item { min-width: 0; padding: 10px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); text-decoration: none; }
.account-picker-item:hover { border-color: var(--line); background: var(--wash); }
.account-picker-item.active { border-color: #cddcf4; background: var(--blue-wash); }
.account-picker-item[hidden] { display: none; }
.account-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #e8eeee; color: #53656d; font-size: 11px; font-weight: 800; }
.account-picker-item.active .account-avatar { background: var(--blue); color: white; }
.account-picker-item strong, .account-picker-item small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-picker-item strong { font-size: 10px; }
.account-picker-item small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.account-picker-item b { color: var(--quiet); font-weight: 400; }
.role-editor-panel { min-width: 0; }
.role-editor-heading { margin-bottom: 20px; padding-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.role-editor-heading h2 { overflow-wrap: anywhere; }
.role-editor-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.security-boundary { padding: 5px 9px; border-radius: 999px; background: var(--green-wash); color: #2d6957; font-size: 8px; font-weight: 760; white-space: nowrap; }
.role-assignment-list { display: grid; gap: 12px; }
.role-assignment-card { margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; }
.role-assignment-card legend { padding: 0 5px; color: var(--ink); font-family: Georgia, "Noto Serif TC", serif; font-size: 17px; }
.role-assignment-card > p { margin: 0 0 13px; color: var(--muted); font-size: 9px; }
.scope-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scope-options > label { min-width: 0; padding: 10px; display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; }
.scope-options > label:has(input:checked) { border-color: #8eafe9; background: var(--blue-wash); box-shadow: 0 0 0 2px rgba(53,106,195,.08); }
.scope-options input { margin-top: 2px; accent-color: var(--blue); }
.scope-options strong, .scope-options small { display: block; }
.scope-options strong { font-size: 10px; }
.scope-options small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.library-scope-picker { margin-top: 10px; padding: 11px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 7px; border: 1px solid #dce5f2; border-radius: 7px; background: white; }
.library-scope-picker[hidden] { display: none; }
.library-scope-picker > label { padding: 8px; display: flex; align-items: flex-start; gap: 8px; border-radius: 6px; cursor: pointer; }
.library-scope-picker > label:hover { background: var(--wash); }
.library-scope-picker input { margin-top: 2px; accent-color: var(--blue); }
.library-scope-picker strong, .library-scope-picker small { display: block; }
.library-scope-picker strong { font-size: 9px; }
.library-scope-picker small { color: var(--quiet); font-size: 8px; }
.role-editor-actions { margin-top: 18px; padding-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.role-editor-actions p { margin: 0; color: var(--muted); font-size: 9px; }
.role-editor-actions .button { flex: 0 0 auto; }

.editor-preview.markdown-content { color: #344149; font-family: Georgia, "Noto Serif TC", serif; font-size: 14px; line-height: 1.9; }
.editor-preview.markdown-content h1 { margin: 0 0 24px; color: var(--ink); font-size: 34px; font-weight: 500; letter-spacing: -.035em; }
.editor-preview.markdown-content h2 { margin: 38px 0 12px; color: var(--ink); font-family: ui-sans-serif, sans-serif; font-size: 20px; line-height: 1.35; }
.editor-preview.markdown-content h3 { margin: 28px 0 10px; color: var(--ink); font-family: ui-sans-serif, sans-serif; font-size: 15px; }
.editor-preview.markdown-content p { margin: 0 0 18px; }
.editor-preview.markdown-content blockquote { margin: 24px 0; padding: 16px 20px; border-left: 3px solid var(--cyan); border-radius: 0 7px 7px 0; background: #f1faf8; }
.editor-preview.markdown-content code { padding: 2px 5px; border-radius: 4px; background: #edf1f1; font: 11px/1.5 ui-monospace, monospace; }
.editor-preview.markdown-content pre { padding: 18px; overflow-x: auto; border-radius: 9px; background: #152229; color: #d6eee9; }
.editor-preview.markdown-content pre code { padding: 0; background: transparent; color: inherit; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: var(--nav-width) 1fr auto; }
  .topbar-actions .text-link { display: none; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-aside { position: static; grid-template-columns: 1fr; }
  .editor-shell { height: 620px; }
  .navigation-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .public-document-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .public-toc-sidebar { display: none; }
}

@media (max-width: 820px) {
  :root { --header-height: 60px; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .admin-shell .topbar { grid-template-columns: auto auto 1fr auto; }
  .mobile-menu { width: 34px; height: 34px; margin-left: 10px; display: block; border: 0; border-radius: 7px; background: #f1f4f3; font-size: 16px; }
  .admin-shell .brand { padding-left: 9px; }
  .brand { padding: 0 12px; }
  .brand-divider, .brand-product { display: none; }
  .topbar-center { padding: 0 6px; justify-content: flex-end; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .search-trigger > span:not(.search-symbol), .search-trigger kbd { display: none; }
  .topbar-search-form { width: 38px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .topbar-search-form > .search-symbol, .topbar-search-form input { display: none; }
  .topbar-search-form button { width: 38px; height: 38px; padding: 0; background: transparent; color: #40535c; font-size: 0; }
  .topbar-search-form button::after { content: "⌕"; font-size: 22px; }
  .topbar-actions { padding-right: 9px; gap: 7px; }
  .workspace-button { padding: 9px 10px; }
  .topbar-actions .text-button { display: none; }
  .sidebar { transform: translateX(-103%); transition: transform .22s ease; box-shadow: 14px 0 45px rgba(15,33,40,.15); }
  .sidebar.is-open { transform: translateX(0); }
  .nav-backdrop { position: fixed; z-index: 20; inset: var(--header-height) 0 0; border: 0; background: rgba(15,28,33,.36); }
  .nav-backdrop.is-open { display: block; }
  .admin-main { margin-left: 0; padding: calc(var(--header-height) + 22px) 15px 55px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .split, .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar-stack { position: static; }
  .library-placeholder-grid { grid-template-columns: 1fr; }
  .public-library-grid, .public-category-grid { grid-template-columns: 1fr; }
  .public-search-libraries > div { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr 1fr; }
  .editor-aside { grid-template-columns: 1fr; }
  .review-detail-layout { grid-template-columns: 1fr; }
  .access-layout { grid-template-columns: 1fr; }
  .account-picker-panel { position: static; }
  .account-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-fields { grid-template-columns: 1fr; }
  .document-fields .field:first-child { grid-column: auto; }
  .workspace-panel { padding: 18px; }
  .workspace-document-row, .workspace-document-row.inactive { grid-template-columns: minmax(0, 1fr) minmax(130px, .4fr) auto; }
  .workspace-document-row .workspace-category-paths { grid-column: 1 / -1; grid-row: 2; }
  .workspace-document-row.inactive .inactive-restore-form { grid-column: 1 / -1; }
  .navigation-workspace { grid-template-columns: 1fr; }
  .editor-shell { height: auto; min-height: 700px; grid-template-columns: 1fr; border-radius: 0 9px 9px 9px; }
  .editor-pane { min-height: 520px; border-right: 0; }
  .preview-pane { min-height: 520px; border-top: 1px solid var(--line); }
  .editor-shell.view-split .preview-pane { display: none; }
  .editor-tab[data-editor-view="split"] { display: none; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 10px; }
  .workspace-button { font-size: 0; }
  .workspace-button::after { content: "後台"; font-size: 10px; }
  .public-hero { padding-inline: 18px; }
  .public-hero h1 { font-size: 45px; }
  .public-hero .lead { font-size: 15px; }
  .hero-search { height: 54px; }
  .public-search-page { width: min(100% - 30px, 940px); padding-top: 28px; }
  .public-search-results > li { padding: 17px; }
  .public-search-summary { align-items: flex-start; flex-direction: column; }
  .public-section { width: min(100% - 30px, 1120px); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .panel, .auth-card { padding: 18px; }
  .compact-grid { grid-template-columns: 1fr; }
  .account-picker-list, .scope-options { grid-template-columns: 1fr; }
  .role-editor-actions { align-items: stretch; flex-direction: column; }
  .public-document-shell { display: block; }
  .public-doc-sidebar { padding: 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .public-doc-tree { max-height: 270px; overflow-y: auto; }
  .public-document-main { padding: 24px 18px 65px; }
  .public-library-heading { align-items: flex-start; flex-direction: column; }
  .category-node-depth { display: none; }
  .workspace-panel-heading, .editor-onboarding { align-items: flex-start; flex-direction: column; }
  .workspace-document-row, .workspace-document-row.inactive { grid-template-columns: minmax(0, 1fr) auto; }
  .workspace-document-state { grid-column: 1; }
  .inactive-restore-form { grid-template-columns: 1fr; }
  .row-actions { grid-column: 2; grid-row: 1; }
  .row-actions > div { position: fixed; inset: auto 15px 15px; width: auto; }
  .workspace-dialog > form, .workspace-dialog > .creation-mode-tabs { margin-inline: 17px; }
  .dialog-heading { padding-inline: 17px; }
  .editor-aside-tabs { overflow-x: auto; }
  .editor-aside-tabs button { min-width: 74px; }
  .editor-preview { padding: 24px 21px 50px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
