﻿:root {
  --bg: #f7f9ff;
  --panel: rgba(255, 255, 255, .84);
  --panel-solid: #fff;
  --text: #172033;
  --muted: #657086;
  --line: rgba(22, 37, 75, .10);
  --blue: #2757d4;
  --blue-2: #4f8cff;
  --navy: #1e2f78;
  --green: #21a55b;
  --orange: #f68a25;
  --pink: #db4d72;
  --gold: #f2b113;
  --shadow: 0 22px 70px rgba(24, 41, 83, .12);
  --soft-shadow: 0 12px 34px rgba(24, 41, 83, .08);
  --radius: 26px;
  --shell: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.72 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(39, 87, 212, .11), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(242, 177, 19, .13), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, var(--bg) 60%, #f5f8ff 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(23, 32, 51, .048) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: .36;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { color: inherit; }
.shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }
.page-glow { position: fixed; width: 360px; height: 360px; border-radius: 50%; filter: blur(65px); opacity: .18; pointer-events: none; }
.page-glow-a { background: var(--blue-2); top: 12%; left: -160px; }
.page-glow-b { background: var(--pink); right: -190px; top: 54%; }
.app-header { position: sticky; top: 0; z-index: 40; background: rgba(247, 249, 255, .78); border-bottom: 1px solid rgba(255,255,255,.9); backdrop-filter: blur(18px); }
.header-row { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 48px; height: 48px; padding: 7px; flex: none; border-radius: 16px; background: rgba(255,255,255,.92); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; min-width: 0; line-height: 1.35; }
.brand-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { color: var(--muted); font-size: .82rem; letter-spacing: .04em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.library-state { color: var(--muted); font-size: .86rem; padding: 7px 11px; border: 1px solid var(--line); background: rgba(255,255,255,.64); border-radius: 999px; }
.library-state.ready { color: #177e45; background: rgba(33,165,91,.09); border-color: rgba(33,165,91,.18); }
.soft-button, .outline-button, .ghost-button, .primary-button, .back-button { border: 0; cursor: pointer; border-radius: 999px; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; transition: .2s ease; }
.soft-button, .outline-button { background: rgba(255,255,255,.86); border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(24,41,83,.05); }
.soft-button:hover, .outline-button:hover, .ghost-button:hover, .back-button:hover { transform: translateY(-1px); background: #fff; box-shadow: var(--soft-shadow); }
.main-layout { position: relative; padding: 34px 0 56px; }
.intro-card { overflow: hidden; position: relative; min-height: 250px; display: grid; grid-template-columns: 1fr 180px; gap: 28px; align-items: center; padding: clamp(26px, 5vw, 50px); border-radius: 34px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.76)), linear-gradient(120deg, rgba(39,87,212,.15), rgba(242,177,19,.12), rgba(219,77,114,.10)); border: 1px solid rgba(255,255,255,.94); box-shadow: var(--shadow); }
.intro-card::after { content: ""; position: absolute; width: 300px; height: 300px; right: -100px; bottom: -190px; border-radius: 50%; background: rgba(39,87,212,.10); }
.eyebrow, .panel-kicker { color: var(--blue); font-size: .78rem; font-weight: 900; letter-spacing: .12em; }
.intro-card h1 { margin: 12px 0; line-height: 1.12; font-size: clamp(2.1rem, 5vw, 4rem); letter-spacing: -.045em; }
.intro-card h1 span { background: linear-gradient(90deg, var(--blue), var(--green), var(--orange), var(--pink)); color: transparent; background-clip: text; -webkit-background-clip: text; }
.intro-card p { max-width: 66ch; margin: 0; color: var(--muted); font-size: 1.04rem; }
.intro-logo { position: relative; z-index: 1; aspect-ratio: 1; padding: 18px; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.95); border-radius: 30px; box-shadow: var(--soft-shadow); }
.intro-logo img { width: 100%; height: 100%; object-fit: contain; }
.section-tabs { position: sticky; top: 88px; z-index: 25; margin: 24px 0; padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-radius: 22px; background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); backdrop-filter: blur(16px); box-shadow: var(--soft-shadow); }
.tab-button { min-height: 48px; border: 0; border-radius: 16px; background: transparent; cursor: pointer; font-weight: 800; color: var(--muted); transition: .2s ease; }
.tab-button:hover { background: rgba(39,87,212,.06); color: var(--text); }
.tab-button.active { color: #fff; background: linear-gradient(90deg, var(--blue), var(--blue-2)); box-shadow: 0 12px 24px rgba(39,87,212,.22); }
.view-panel { display: none; padding: clamp(22px, 4vw, 34px); border-radius: 30px; background: var(--panel); border: 1px solid rgba(255,255,255,.96); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.view-panel.active { display: block; animation: reveal .28s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading h2 { margin: 3px 0 2px; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.2; }
.panel-heading p { margin: 0; color: var(--muted); }
.content-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.content-card { position: relative; overflow: hidden; min-height: 190px; padding: 22px; border-radius: 22px; background: rgba(255,255,255,.9); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(24,41,83,.06); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.content-card:hover { transform: translateY(-3px); border-color: rgba(39,87,212,.22); box-shadow: 0 20px 40px rgba(24,41,83,.11); }
.content-card::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -55px; bottom: -65px; background: linear-gradient(135deg, rgba(39,87,212,.12), rgba(219,77,114,.08)); }
.card-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.type-chip { display: inline-flex; min-height: 30px; align-items: center; padding: 0 11px; border-radius: 999px; font-size: .78rem; font-weight: 900; background: rgba(39,87,212,.09); color: var(--navy); }
.card-date { color: var(--muted); font-size: .82rem; }
.content-card h3 { margin: 18px 0 8px; font-size: 1.22rem; line-height: 1.35; }
.content-card p { color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .86rem; }
.card-open { color: var(--blue); font-weight: 800; }
.empty-state { grid-column: 1 / -1; padding: 44px 24px; text-align: center; color: var(--muted); border: 1px dashed rgba(39,87,212,.22); background: rgba(255,255,255,.62); border-radius: 22px; }
.editor-meta-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; margin-bottom: 16px; }
.field-label { display: grid; gap: 7px; color: var(--text); font-weight: 760; }
.field-label span { font-size: .9rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.94); color: var(--text); outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
input, select { height: 48px; border-radius: 14px; padding: 0 14px; }
textarea { min-height: 560px; resize: vertical; border-radius: 0 0 20px 20px; padding: 18px; line-height: 1.65; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
input:focus, select:focus, textarea:focus { border-color: rgba(39,87,212,.42); box-shadow: 0 0 0 4px rgba(39,87,212,.08); }
.cache-badge { padding: 8px 12px; border-radius: 999px; background: rgba(33,165,91,.09); color: #177e45; border: 1px solid rgba(33,165,91,.16); font-size: .84rem; font-weight: 760; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.editor-pane, .preview-pane { min-width: 0; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.72); overflow: hidden; }
.pane-title { min-height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(247,249,255,.78); }
.pane-title span { color: var(--muted); font-size: .84rem; }
.preview-pane { display: flex; flex-direction: column; }
.preview-paper { flex: 1; border-radius: 0 !important; box-shadow: none !important; min-height: 560px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 18px 0 34px; }
.ghost-button, .back-button { background: rgba(255,255,255,.82); border: 1px solid var(--line); }
.primary-button { color: white; background: linear-gradient(90deg, var(--blue), var(--blue-2)); box-shadow: 0 12px 26px rgba(39,87,212,.22); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(39,87,212,.28); }
.local-section { padding-top: 28px; border-top: 1px solid var(--line); }
.compact-heading { margin-bottom: 18px; }
.review-notice { margin-top: 28px; padding: 20px; display: flex; align-items: flex-start; gap: 16px; border-radius: 22px; background: linear-gradient(135deg, rgba(39,87,212,.08), rgba(242,177,19,.10)); border: 1px solid rgba(39,87,212,.12); }
.review-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(135deg, var(--blue), var(--pink)); }
.review-notice strong { display: block; margin-bottom: 4px; }
.review-notice p { margin: 0; color: var(--muted); }
.review-notice a { color: var(--blue); font-weight: 800; }
.detail-view { padding: 0; background: transparent; box-shadow: none; border: 0; backdrop-filter: none; }
.back-button { margin-bottom: 16px; }
.official-paper { position: relative; overflow: hidden; padding: clamp(24px, 5vw, 54px); padding-bottom: clamp(92px, 12vw, 132px); border-radius: 30px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.paper-watermark { position: absolute; z-index: 0; inset: 50% auto auto 50%; width: min(48vw, 390px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-12deg); opacity: .042; pointer-events: none; }
.paper-watermark img { width: 100%; height: 100%; object-fit: contain; }
.paper-header, .markdown-body, .paper-signature { position: relative; z-index: 1; }
.paper-header { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.paper-header h1 { margin: 10px 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; letter-spacing: -.04em; }
.paper-summary { color: var(--muted); margin: 0; }
.paper-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.paper-meta span { min-height: 32px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 999px; background: #f5f7fc; border: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.paper-signature { position: absolute; right: clamp(18px, 4vw, 44px); bottom: clamp(18px, 4vw, 36px); margin-top: 0; padding-top: 0; border-top: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; text-align: right; }
.paper-wordmark-link { display: block; width: clamp(120px, 13vw, 190px); max-width: min(45vw, 190px); border-radius: 16px; overflow: hidden; background: #fff; transition: transform .18s ease, box-shadow .2s ease; }
.paper-wordmark-link:hover { transform: translateY(-1px); box-shadow: var(--soft-shadow); }
.paper-wordmark-link:focus-visible { outline: 3px solid rgba(39,87,212,.26); outline-offset: 4px; }
.paper-wordmark { width: 100%; height: auto; object-fit: contain; }
.paper-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.tool-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.9); cursor: pointer; font-weight: 760; }
.tool-button.danger { color: #b92b45; border-color: rgba(185,43,69,.18); background: rgba(219,77,114,.06); }
.markdown-body { color: #222b3d; word-break: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { line-height: 1.28; margin: 1.7em 0 .65em; color: #172033; }
.markdown-body h1 { font-size: 2rem; }
.markdown-body h2 { font-size: 1.55rem; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote { margin: 1em 0; }
.markdown-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body blockquote { padding: 12px 16px; color: var(--muted); border-left: 4px solid var(--blue-2); background: #f6f8fd; border-radius: 0 12px 12px 0; }
.markdown-body code { padding: .15em .38em; border-radius: 6px; background: #eef2fa; font: .9em/1.5 "SFMono-Regular", Consolas, monospace; }
.markdown-body pre { overflow: auto; padding: 16px; border-radius: 14px; background: #172033; color: #eef4ff; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 9px 12px; }
.markdown-body th { background: #f4f7fd; }
.markdown-body img { margin: 18px auto; border-radius: 16px; box-shadow: var(--soft-shadow); }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .3em 0; }
.dialog-backdrop { position: fixed; z-index: 100; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(17,29,61,.32); backdrop-filter: blur(10px); }
.dialog-backdrop[hidden] { display: none; }
.dialog-card { position: relative; width: min(100%, 480px); padding: 28px; border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(17,29,61,.25); }
.dialog-card h2 { margin: 4px 0 8px; }
.dialog-card p { margin: 0 0 18px; color: var(--muted); }
.dialog-close { position: absolute; right: 16px; top: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2f4f9; cursor: pointer; font-size: 1.3rem; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 16px 0; color: var(--muted); }
.check-row input { width: 18px; height: 18px; }
.full-button { width: 100%; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; color: #fff; background: rgba(23,32,51,.94); border-radius: 999px; box-shadow: var(--shadow); transition: .24s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { padding: 0 0 34px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; }
.footer-row div { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-row a:hover { color: var(--blue); }
@media (max-width: 900px) {
  .intro-card { grid-template-columns: 1fr 130px; }
  .content-list { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  textarea, .preview-paper { min-height: 470px; }
  .library-state { display: none; }
}
@media (max-width: 680px) {
  .shell { width: min(calc(100% - 20px), var(--shell)); }
  .header-row { min-height: 68px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-copy strong { font-size: .94rem; }
  .brand-copy span { display: none; }
  .soft-button { min-height: 40px; padding-inline: 13px; font-size: .88rem; }
  .main-layout { padding-top: 20px; }
  .intro-card { grid-template-columns: 1fr; min-height: auto; border-radius: 26px; }
  .intro-logo { display: none; }
  .section-tabs { top: 77px; border-radius: 18px; gap: 4px; }
  .tab-button { font-size: .9rem; padding: 0 6px; }
  .view-panel { border-radius: 24px; padding: 20px 16px; }
  .panel-heading, .publish-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading .outline-button { width: 100%; }
  .editor-meta-grid { grid-template-columns: 1fr; }
  textarea { min-height: 420px; }
  .editor-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .official-paper { padding: 24px 18px 86px; border-radius: 22px; }
  .paper-signature { right: 16px; bottom: 16px; }
  .paper-wordmark-link { width: clamp(108px, 38vw, 150px); max-width: min(48vw, 150px); border-radius: 12px; }
  .paper-header h1 { font-size: 2rem; }
  .paper-signature { align-items: flex-end; }
  .footer-row { flex-direction: column; }
}
@media (max-width: 420px) {
  .brand-copy strong { max-width: 170px; }
  .section-tabs { position: relative; top: auto; }
  .tab-button { font-size: .82rem; }
}
