:root {
  color-scheme: light;
  --ink: #17324d;
  --text: #425466;
  --blue: #1266c5;
  --teal: #0b6f75;
  --line: #dce5ee;
  --surface: #ffffff;
  --page: #f7f9fc;
}

* { box-sizing: border-box; }
html { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--page); }
body { margin: 0; min-width: 320px; line-height: 1.7; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #63a9ef; outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.98); border-bottom: 1px solid #e6e9ed; box-shadow: 0 2px 8px rgba(20,42,68,.04); }
.site-nav { position: relative; width: min(1180px, calc(100% - 32px)); min-height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; color: var(--ink); }
.brand img { width: 166px; height: 50px; object-fit: contain; }
.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 27px; min-width: 0; white-space: nowrap; }
.nav-links a { color: #122033; font-size: 14px; font-weight: 400; text-decoration: none; }
.nav-links a:first-child { color: #1565d8; }
.nav-links a.is-current:not(:first-child) { color: #122033; }
.nav-links a:hover { color: #1565d8; text-decoration: none; }
.header-search-toggle { position: relative; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.header-search-toggle span { position: absolute; width: 14px; height: 14px; left: 10px; top: 9px; border: 2px solid #26323c; border-radius: 50%; }
.header-search-toggle span::after { content: ""; position: absolute; width: 7px; height: 2px; right: -6px; bottom: -4px; background: #26323c; transform: rotate(45deg); border-radius: 2px; }
.header-search { position: absolute; z-index: 2; right: 0; top: calc(100% - 6px); display: grid; grid-template-columns: minmax(220px, 360px) auto; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 12px 30px rgba(23,50,77,.14); }
.header-search[hidden] { display: none; }
.header-search input { min-height: 42px; border: 1px solid #9caebe; border-radius: 7px; padding: 8px 12px; font: inherit; }
.header-search button { border: 0; border-radius: 7px; padding: 0 18px; background: var(--blue); color: white; font: inherit; font-weight: 700; }
.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; }
.site-main { width: min(1180px, calc(100% - 32px)); margin: 32px auto 64px; }

.hero, .blog-profile, .page-heading { padding: clamp(24px, 3.5vw, 42px); border-radius: 16px; background: linear-gradient(135deg, #eef6ff, #f4fbfb); border: 1px solid #d8e7f4; margin-bottom: 28px; }
.hero h1, .blog-profile h1, .page-heading h1 { color: var(--ink); margin: 0 0 10px; line-height: 1.2; font-size: clamp(2rem, 4vw, 3.25rem); }
.hero p, .blog-profile p, .page-heading p { max-width: 760px; margin: 0; }
.hero h1 { font-size: clamp(1.8rem, 3.2vw, 2.65rem); }
.hero { min-height: 0; }
.compact-profile { padding-block: clamp(22px, 3vw, 34px); }
.compact-profile h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.hero-label, .article-kicker { color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.content-grid, .user-blog-layout, .article-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); gap: 28px; align-items: start; }
.content-grid > *, .user-blog-layout > *, .article-layout > *, .blog-content-column { min-width: 0; max-width: 100%; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2, .author-panel h2, .blog-nav h2 { color: var(--ink); margin: 0; }
.section-heading span { color: #6d7f90; font-size: .9rem; }
.post-list { display: grid; gap: 14px; }
.post-card, .author-panel, .blog-nav, .author-directory article, .comments, .password-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(23,50,77,.05); }
.post-card { min-width: 0; max-width: 100%; padding: 22px 24px; overflow: hidden; overflow-wrap: anywhere; }
.post-card h3 { margin: 0 0 8px; line-height: 1.45; font-size: 1.18rem; }
.post-card p { margin: 0 0 10px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 16px; color: #6d7f90; font-size: .9rem; }
.author-panel, .blog-nav { width: 100%; min-width: 0; max-width: 100%; padding: 22px; position: sticky; top: 98px; overflow-wrap: anywhere; }
.author-panel ol { list-style: none; padding: 0; margin: 14px 0; }
.author-panel li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1f5; }
.author-panel span { white-space: nowrap; color: #718294; font-size: .88rem; }
.more-link { display: inline-block; margin-top: 8px; font-weight: 700; }
.blog-owner { color: var(--teal); font-weight: 700; }
.blog-nav { display: grid; gap: 10px; }
.blog-nav h2:not(:first-child) { margin-top: 12px; }
.sidebar-link-list { display: grid; gap: 8px; min-width: 0; }
.sidebar-link-list a { display: block; min-width: 0; overflow-wrap: anywhere; }
.author-login { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-bottom: 20px; border-radius: 8px; background: var(--blue); color: white; font-weight: 700; }
.author-login:hover { color: white; }
.pager { display: grid; grid-template-columns: minmax(90px,1fr) auto minmax(90px,1fr); align-items: center; gap: 14px; min-height: 44px; margin-top: 18px; }
.pager > span:last-child { justify-self: end; }
.pager-status { color: #6d7f90; font-size: .92rem; white-space: nowrap; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; background: var(--blue); color: white; border-radius: 8px; font-weight: 700; }
.empty-state { padding: 60px 24px; text-align: center; border: 1px dashed #b9c8d6; border-radius: 12px; background: white; }

.author-directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.author-directory article { padding: 22px; }
.author-directory h2 { margin: 0; font-size: 1.15rem; }
.author-directory p { margin: 6px 0; }

.article-page { min-width: 0; max-width: 100%; margin: 0; }
.article-page > header { padding: clamp(28px, 5vw, 52px); background: linear-gradient(135deg, #edf5fd, #f7fbff); border: 1px solid var(--line); border-radius: 16px 16px 0 0; }
.article-page h1 { color: var(--ink); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.3; margin: 6px 0 18px; }
.legacy-content { padding: clamp(24px, 5vw, 48px); background: white; border: 1px solid var(--line); border-top: 0; overflow-wrap: anywhere; }
.legacy-content img { max-width: 100%; height: auto; }
.legacy-content table { display: block; max-width: 100%; overflow-x: auto; }
.comments { margin-top: 24px; padding: clamp(20px, 4vw, 32px); }
.comments > article { padding: 16px 0; border-top: 1px solid var(--line); }
.comments header { display: flex; justify-content: space-between; gap: 16px; }
.comments p { white-space: pre-wrap; }
.readonly-note { color: #6d7f90; font-size: .9rem; }
.password-panel { margin-top: 24px; padding: 28px; }
.password-panel form { display: grid; gap: 10px; max-width: 420px; }
.password-panel input { min-height: 46px; border: 1px solid #9caebe; border-radius: 7px; padding: 8px 12px; font: inherit; }
.password-panel button { min-height: 46px; border: 0; border-radius: 7px; background: var(--blue); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.captcha-row { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 10px; align-items: center; }
.captcha-row img { width: 150px; height: 48px; border: 1px solid #b8c7d6; border-radius: 7px; background: #eef4fa; cursor: pointer; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 620px; margin-top: 20px; }
.search-form label { grid-column: 1 / -1; color: var(--ink); font-weight: 700; }
.search-form input { min-height: 46px; border: 1px solid #9caebe; border-radius: 8px; padding: 8px 12px; font: inherit; }
.search-form button { min-height: 46px; border: 0; border-radius: 8px; padding: 0 22px; background: var(--blue); color: white; font: inherit; font-weight: 700; }
.editor-form { display: grid; gap: 10px; padding: clamp(20px, 4vw, 34px); background: white; border: 1px solid var(--line); border-radius: 12px; }
.editor-form > label, .editor-form legend { color: var(--ink); font-weight: 700; }
.editor-form input[type="text"], .editor-form input[type="password"], .editor-form textarea { width: 100%; min-height: 46px; border: 1px solid #9caebe; border-radius: 7px; padding: 10px 12px; font: inherit; }
.editor-form textarea { resize: vertical; font-family: Consolas, "Microsoft YaHei", monospace; }
.editor-form fieldset { display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.editor-form > button, .manage-list button, .post-card button, .page-heading button { min-height: 44px; border: 0; border-radius: 7px; padding: 0 18px; background: var(--blue); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 9px; }
.success-message { padding: 12px 16px; border-radius: 8px; background: #e7f7ef; color: #16613c; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 18px auto -12px; }
.admin-shell-nav { display: flex; gap: 4px; overflow-x: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(23,50,77,.05); scrollbar-width: thin; }
.admin-shell-nav a { flex: 0 0 auto; padding: 8px 12px; border-radius: 7px; color: var(--ink); font-size: .88rem; white-space: nowrap; }
.admin-shell-nav a:hover { color: var(--blue); background: #edf5ff; text-decoration: none; }
.admin-page .site-main { margin-top: 20px; }
.admin-page .page-heading { padding: 18px 22px; margin-bottom: 14px; border-radius: 12px; }
.admin-page .page-heading .hero-label, .admin-page .page-heading > p { display: none; }
.admin-page .page-heading h1 { margin: 0; font-size: clamp(1.65rem, 2.5vw, 2.15rem); font-weight: 700; line-height: 1.2; }
.admin-page .validation-summary-valid, .admin-page .validation-summary-valid ul,
.admin-page .validation-summary-valid li { display: none !important; }
.admin-page .validation-summary-errors { margin: 0 0 14px; padding: 10px 14px; border: 1px solid #efb3ae; border-radius: 8px; background: #fff0ef; color: #922b25; }
.admin-page .validation-summary-errors ul { margin: 0; padding-left: 20px; }
.admin-heading { margin-bottom: 14px; }
.admin-section { margin-top: 18px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(23,50,77,.04); }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-section-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 1.35rem; }
.admin-section-heading > span { color: #6d7f90; font-size: .9rem; }
.admin-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-card-grid, .admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.admin-card, .admin-cards a, .admin-cards > article { display: grid; gap: 6px; padding: 20px; background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; }
.admin-cards a:hover { border-color: #93bce6; box-shadow: 0 8px 20px rgba(18,102,197,.08); text-decoration: none; }
.admin-cards strong { color: var(--ink); font-size: 2rem; }
.admin-cards span, .admin-card strong { color: var(--ink); font-weight: 700; }
.admin-cards small, .admin-table-wrap small { display: block; color: #718294; font-size: .8rem; }
.admin-form { display: grid; gap: 9px; }
.admin-form > label:not(.check-row), .compact-form label { color: var(--ink); font-weight: 700; }
.admin-form input:not([type="checkbox"]), .admin-form select, .admin-form textarea, .compact-form input { width: 100%; min-height: 42px; border: 1px solid #9caebe; border-radius: 7px; padding: 8px 10px; background: white; color: var(--text); font: inherit; }
.admin-form button, .compact-form button, .admin-actions button { min-height: 40px; border: 0; border-radius: 7px; padding: 0 16px; background: var(--blue); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 6px; color: var(--ink); font-weight: 700; }
.form-help { margin: 2px 0 8px; color: #6d7f90; font-size: .88rem; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-pill { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: #edf1f5; color: #607184; font-size: .78rem; font-weight: 700; }
.status-pill.is-success { background: #def5e8; color: #17613d; }
.status-pill.is-danger { background: #fee8e7; color: #a02722; }
.compact-list { display: grid; gap: 6px; margin: 8px 0; }
.compact-list > div { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 8px; }
.compact-list dt { color: #718294; }
.compact-list dd { margin: 0; overflow-wrap: anywhere; }
.static-status-list > div { grid-template-columns: 92px minmax(0,1fr); }
.break-all { word-break: break-all; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.inline-form { display: inline-flex; }
.admin-actions .button-secondary { background: #e8f1fb; color: #175a9e; }
.admin-actions .button-danger { background: #b52a24; }
.compact-details { min-width: 210px; }
.compact-details summary { color: var(--blue); cursor: pointer; font-weight: 700; }
.compact-form { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfe; }
.compact-form label { display: grid; gap: 4px; font-size: .86rem; }
.workflow-list { margin: 0; padding-left: 22px; }
.workflow-list code { padding: 2px 5px; border-radius: 4px; background: #edf1f5; }
.admin-table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 12px; }
.admin-table-wrap table { width: 100%; border-collapse: collapse; }
.admin-table-wrap th, .admin-table-wrap td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table-wrap th { color: var(--ink); background: #edf4fb; white-space: nowrap; }
.navigation-editor { display: grid; gap: 18px; }
.navigation-editor input[type="text"], .navigation-editor input[type="url"], .navigation-editor input[type="number"] { width: 100%; min-width: 90px; min-height: 40px; border: 1px solid #9caebe; border-radius: 6px; padding: 7px 9px; font: inherit; }
.navigation-editor > button { justify-self: start; min-height: 44px; border: 0; border-radius: 7px; padding: 0 20px; background: var(--blue); color: white; font: inherit; font-weight: 700; }
.navigation-add { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.navigation-add[open] { display: grid; }
.navigation-add summary { color: var(--ink); font-weight: 700; cursor: pointer; }
.navigation-add input[type="text"], .navigation-add input[type="number"] { width: 100%; min-height: 42px; border: 1px solid #9caebe; border-radius: 6px; padding: 8px 10px; font: inherit; }
.footer-settings-fields { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 10px 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.footer-settings-fields label { color: var(--ink); font-weight: 700; }
.footer-settings-fields input { width: 100%; min-height: 42px; border: 1px solid #9caebe; border-radius: 6px; padding: 8px 10px; font: inherit; }
.ad-slot { display: grid; place-items: center; gap: 8px; overflow: hidden; margin-top: 18px; padding: 12px; border-radius: 10px; background: #f3f7fb; text-align: center; }
.ad-slot[hidden] { display: none; }
.ad-slot a { display: grid; gap: 6px; place-items: center; }
.ad-slot img { display: block; max-width: 100%; height: auto; }
.ad-slot-banner { margin: 0 0 24px; }

.site-footer { min-height: 0; padding: 30px 16px; background: #0c2444; color: #b9c9dd; text-align: center; }
.footer-legacy { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; font-size: 13px; }
.footer-links a { color: #cdddf0; }
.footer-links a:hover { color: white; text-decoration: none; }
.footer-links a:not(:last-child)::after { content: "|"; margin-left: 10px; color: #3f5f86; }
.footer-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 12px; line-height: 1.7; }
.footer-copy a { color: #b9c9dd; }
.footer-copy a:hover { color: white; text-decoration: none; }

@media (max-width: 767px) {
  .site-nav { min-height: 104px; align-items: flex-start; padding: 8px 0 46px; }
  .brand img { width: 142px; height: 44px; }
  .nav-links { position: absolute; left: 0; right: 0; bottom: 0; justify-content: flex-start; gap: 22px; overflow-x: auto; padding: 0 44px 9px 0; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .header-search-toggle { position: sticky; right: 0; flex: 0 0 40px; background: white; }
  .header-search { left: 0; right: 0; top: 53px; grid-template-columns: minmax(0,1fr) auto; }
  .content-grid, .user-blog-layout, .article-layout { grid-template-columns: 1fr; }
  .author-panel, .blog-nav { position: static; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .admin-two-column, .form-grid { grid-template-columns: 1fr; }
  .admin-shell { margin-top: 12px; }
}

@media (min-width: 768px) and (max-width: 920px) {
  .content-grid, .user-blog-layout, .article-layout { grid-template-columns: 1fr; }
  .author-panel, .blog-nav { position: static; }
}

@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-status { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .pager > span:first-child { grid-column: 1; grid-row: 2; }
  .pager > span:last-child { grid-column: 2; grid-row: 2; }
  .footer-settings-fields { grid-template-columns: 1fr; }
  .captcha-row { grid-template-columns: 1fr; }
}
