* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #24303f;
    background: #f6f8fb;
    line-height: 1.75;
    font-size: 16px;
}
a { color: #2f6fed; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1080px, 92%); margin: 0 auto; }

.site-header { background: #ffffff; border-bottom: 1px solid #e6ebf2; position: relative; z-index: 20; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; }
.header-brand-group { display: flex; align-items: center; gap: 0; flex: none; }
.brand-banner-brand { display: inline-flex; align-items: center; gap: 12px; color: #1c2b3a; }
.brand-banner-brand:hover { text-decoration: none; }
.brand-banner-mark { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, #2f6fed, #4a8cff); color: #fff; font-size: 24px; font-weight: 700; flex: none; }
.brand-banner-logo { width: 46px; height: 46px; object-fit: contain; flex: none; }
.brand-banner-text strong { display: block; font-size: 24px; line-height: 1.2; color: #1c2b3a; letter-spacing: .5px; }
.brand-banner-text small { display: block; font-size: 13px; color: #8a97a6; letter-spacing: .3px; }
.brand-banner-slogan { color: #9aa6b4; font-size: 17px; font-style: italic; letter-spacing: 1px; margin-left: 22px; padding-left: 22px; border-left: 1px solid #e6ebf2; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 0 12px; gap: 20px; border-top: 1px solid #f0f3f8; padding-top: 8px; }
.brand { font-size: 21px; font-weight: 700; color: #1c2b3a; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2f6fed, #4a8cff); color: #fff; font-size: 16px; font-weight: 700; }
.brand-logo { max-height: 36px; max-width: 180px; height: auto; width: auto; object-fit: contain; }
.site-logo-preview { max-height: 48px; max-width: 220px; height: auto; border: 1px solid #e6ebf2; border-radius: 8px; padding: 4px; background: #fff; }
.nav-menu-textarea { min-height: 130px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.nav-link { color: #4a5a6a; font-size: 15px; padding: 8px 11px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: #2f6fed; background: #f0f5ff; text-decoration: none; }
.nav-search { display: inline-flex; align-items: center; margin-left: 8px; border: 1px solid #d6dfe9; background: #fff; border-radius: 9px; overflow: hidden; height: 36px; }
.nav-search:focus-within { border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.nav-search-input { border: 0; outline: 0; background: transparent; height: 100%; width: 130px; min-width: 0; padding: 0 10px; font-size: 14px; color: #24303f; }
.nav-search-input::placeholder { color: #9aa6b4; }
.nav-search-btn { flex: none; white-space: nowrap; border: 0; background: #2f6fed; color: #fff; height: 100%; padding: 0 13px; font-size: 14px; cursor: pointer; }
.nav-search-btn:hover { background: #1f5ed6; }
.nav-ico { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.ico-home { background: #2f6fed; }
.ico-office { background: #e5a23c; }
.ico-ai { background: #8b5cf6; }
.ico-dev { background: #18a999; }
.ico-other { background: #7b8898; }
.ico-about { background: #e0607e; }

.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > .nav-link.active { color: #2f6fed; background: #f0f5ff; }
.sub-toggle { border: 0; background: transparent; color: #9aa6b4; font-size: 11px; line-height: 1; padding: 6px 5px; cursor: pointer; margin-left: -7px; transition: transform .18s ease; }
.sub-toggle:hover { color: #2f6fed; }
.nav-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; box-shadow: 0 14px 34px rgba(31, 53, 80, .14); padding: 8px; margin-top: 6px; z-index: 30; }
.nav-sub-right .nav-sub { left: auto; right: 0; }
.has-sub:hover .nav-sub, .has-sub:focus-within .nav-sub, .has-sub.sub-open .nav-sub { display: block; }
.has-sub:hover .sub-toggle, .has-sub.sub-open .sub-toggle { transform: rotate(180deg); color: #2f6fed; }
.nav-sub-title { color: #9aa6b4; font-size: 12px; padding: 6px 10px 8px; border-bottom: 1px solid #edf1f6; margin-bottom: 5px; }
.nav-sub a { display: block; color: #4a5a6a; font-size: 14px; padding: 8px 10px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub a:hover { background: #f2f6ff; color: #2f6fed; text-decoration: none; }
.nav-sub-empty { display: block; color: #9aa6b4; font-size: 13px; padding: 8px 10px; }
.nav-sub-all { margin-top: 5px; border-top: 1px solid #edf1f6; color: #2f6fed !important; font-weight: 600; }
.nav-toggle { display: none; border: 1px solid #d6dfe9; background: #fff; border-radius: 9px; width: 40px; height: 38px; padding: 10px 9px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: #4a5a6a; border-radius: 2px; margin: 3px 0; }

.main-content { padding: 32px 0 60px; min-height: 60vh; }

.hero { background: linear-gradient(135deg, #eaf2ff, #f7fbff); border: 1px solid #dce8fb; border-radius: 14px; padding: 15px 28px; margin: 0 auto 24px; max-width: 100%; }
.hero h1 { margin: 0 0 5px; font-size: 25px; color: #1d2c3d; }
.hero p { margin: 0; color: #56677a; }
.hero-banner { padding: 0; border: 0; background: transparent; max-width: 100%; }
.hero-banner-img { display: block; width: 100%; height: auto; border-radius: 14px; }
.banner-preview { max-width: 320px; height: auto; border: 1px solid #e6ebf2; border-radius: 8px; padding: 4px; background: #fff; }

.section { margin-bottom: 38px; }
.section-title { font-size: 21px; margin: 0 0 18px; color: #1d2c3d; border-left: 4px solid #2f6fed; padding-left: 10px; }
.page-title { font-size: 28px; margin: 0 0 10px; color: #1d2c3d; }
.page-desc { color: #607085; margin: 0 0 24px; }

.card { background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 22px; box-shadow: 0 2px 10px rgba(31, 53, 80, .04); }
.article-list { display: grid; gap: 16px; }
.article-card h3 { margin: 10px 0 8px; font-size: 20px; }
.article-card h3 a { color: #1d2c3d; }
.article-card p { color: #5b6b7d; margin: 0 0 12px; }
.article-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: #8a97a6; font-size: 13px; }
.tag { background: #edf3ff; color: #2f6fed; border-radius: 20px; padding: 2px 10px; font-size: 12px; }
.read-more { font-size: 14px; font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-3 h3 { margin: 0 0 8px; font-size: 18px; color: #1d2c3d; }
.grid-3 p { margin: 0; color: #5b6b7d; }

.article-detail h1 { font-size: 30px; margin: 16px 0 10px; color: #182534; }
.article-summary { color: #617287; border-left: 3px solid #9dbcf7; padding-left: 14px; margin: 0 0 24px; }
.article-body { font-size: 15.5px; line-height: 1.9; color: #33445a; word-break: break-word; }
.article-body h2 { font-size: 24px; margin: 30px 0 14px; color: #182534; }
.article-body h3 { font-size: 20px; margin: 28px 0 10px; color: #1d2c3d; }
.article-body h4, .article-body h5 { font-size: 17px; margin: 22px 0 10px; color: #1d2c3d; }
.article-body p { margin: 0 0 16px; color: #33445a; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 0 0 18px; }
.article-body li { margin: 5px 0; }
.article-body strong, .article-body b { color: #1d2c3d; }
.article-body a { color: #2f6fed; text-decoration: underline; }
.article-body img {
    display: block; max-width: 100%; height: auto; margin: 18px auto;
    border-radius: 10px; box-shadow: 0 2px 10px rgba(30, 50, 90, .08);
}
.article-body blockquote {
    margin: 20px 0; padding: 12px 18px; border-left: 4px solid #9dbcf7;
    background: #f5f8ff; color: #4a5b72; border-radius: 0 8px 8px 0;
}
.article-body pre {
    margin: 20px 0; padding: 16px 18px; background: #1f2a3a; color: #e8eef8;
    border-radius: 10px; overflow-x: auto; white-space: pre-wrap;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.75;
}
.article-body code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: #f1f4f9; padding: 1px 5px; border-radius: 4px; font-size: 13px;
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body hr { border: 0; border-top: 1px solid #e2e8f0; margin: 26px 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 18px 0; }
.article-body td, .article-body th { border: 1px solid #d9e1ec; padding: 8px 11px; }
.article-body th { background: #f5f8ff; color: #1d2c3d; }
.article-body sup, .article-body sub { font-size: 12px; }
@media (max-width: 720px) {
    .article-body img { margin: 14px auto; }
    .article-body pre { padding: 12px; }
}
.article-footer { display: flex; justify-content: space-between; border-top: 1px solid #edf1f6; padding-top: 16px; margin-top: 30px; color: #8a97a6; font-size: 14px; }
.article-note { margin-top: 14px; text-align: center; }

.prose h2 { font-size: 20px; margin: 26px 0 10px; color: #1d2c3d; }
.prose p, .prose li { color: #415268; }
.prose ul { padding-left: 22px; }

.empty { padding: 40px; text-align: center; color: #8a97a6; background: #fff; border: 1px dashed #d7e0eb; border-radius: 12px; }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 26px; color: #718096; }

.site-footer { background: #fff; border-top: 1px solid #e6ebf2; padding: 30px 0; color: #7b8898; font-size: 14px; }
.footer-inner p { margin: 4px 0; }
.footer-links a { margin-right: 14px; }
.footer-note { color: #9aa6b4; font-size: 13px; }

/* 后台 */
.admin-wrap { max-width: 960px; margin: 0 auto; }
.admin-header { background: #1f2d3d; color: #fff; padding: 14px 0; }
.admin-header .container { display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: #cfe0ff; margin-left: 14px; }
.admin-title { font-size: 18px; font-weight: 600; }
.admin-body { padding: 28px 0; }
.admin-card { background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #edf1f6; font-size: 14px; }
.table th { color: #6b7a8c; font-weight: 600; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 600; color: #38485c; }
.input, .textarea, .select { width: 100%; padding: 10px 12px; border: 1px solid #d6dfe9; border-radius: 8px; font: inherit; color: #24303f; background: #fff; }
.textarea { min-height: 220px; resize: vertical; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 10px 18px; background: #2f6fed; color: #fff; cursor: pointer; font: inherit; }
.btn:hover { background: #255dcc; text-decoration: none; }
.btn-light { background: #edf3ff; color: #2f6fed; }
.btn-danger { background: #e55353; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fff0f0; color: #b42318; border: 1px solid #ffd6d6; }
.alert-success { background: #eefaf1; color: #18794e; border: 1px solid #cdefd8; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #e6ebf2; margin: 0 0 22px; padding-bottom: 0; }
.admin-tab { display: inline-block; padding: 9px 14px; color: #5b6b7d; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tab:hover { color: #2f6fed; text-decoration: none; }
.admin-tab.active { color: #2f6fed; font-weight: 600; border-bottom-color: #2f6fed; }
.admin-card h3 { font-size: 17px; margin: 26px 0 14px; padding-left: 10px; border-left: 3px solid #2f6fed; color: #1d2c3d; }
.admin-card h3:first-of-type { margin-top: 0; }
.form-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf1f6; }
.captcha-question { display: inline-block; background: #eef4ff; color: #2f6fed; border: 1px solid #dce7fa; border-radius: 6px; padding: 2px 10px; font-size: 15px; letter-spacing: 1px; user-select: none; }
.login-box { max-width: 420px; margin: 60px auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: #f7faff; border: 1px solid #e1eaf7; border-radius: 10px; padding: 18px; }
.stat strong { display: block; font-size: 26px; color: #1d2c3d; }
.stat span { color: #7b8898; font-size: 14px; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.home-main { min-width: 0; }
.home-sidebar { min-width: 0; }
.home-sidebar .calendar-layout { grid-template-columns: 1fr; gap: 14px; }
.home-sidebar .section-title { font-size: 18px; margin-bottom: 14px; }
.home-sidebar .calendar-card, .home-sidebar .category-card { padding: 16px; }
.home-sidebar .calendar-table th, .home-sidebar .calendar-table td { padding: 5px 1px; font-size: 12px; }
.home-sidebar .calendar-head { font-size: 13px; margin-bottom: 10px; }
.home-sidebar .calendar-head a { font-size: 12px; }
.home-sidebar .category-list li { font-size: 13px; padding: 7px 0; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 18px; align-items: start; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 15px; }
.calendar-head a { font-size: 13px; }
.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-table th, .calendar-table td { text-align: center; padding: 7px 2px; border: 1px solid #edf1f6; font-size: 13px; }
.calendar-table th { color: #7b8898; background: #f7faff; font-weight: 600; }
.calendar-day { color: #6b7a8c; }
.calendar-day.has-post a { display: block; background: #2f6fed; color: #fff; border-radius: 6px; padding: 3px 0; font-weight: 600; }
.calendar-day.has-post a:hover { background: #255dcc; text-decoration: none; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px #ffb020; }
.calendar-empty { background: #fafbfd; }
.category-card h3 { margin: 0 0 12px; font-size: 17px; color: #1d2c3d; }
.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #edf1f6; font-size: 14px; }
.category-list li span { color: #8a97a6; }
.qr-image { max-width: 180px; height: auto; border: 1px solid #e6ebf2; border-radius: 10px; padding: 8px; background: #fff; }
.site-icon-preview { max-width: 48px; height: 48px; vertical-align: middle; border: 1px solid #e6ebf2; border-radius: 8px; padding: 4px; background: #fff; }

@media (max-width: 980px) {
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar .calendar-layout { grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); }
    .home-sidebar .calendar-table th, .home-sidebar .calendar-table td { padding: 7px 2px; font-size: 13px; }
}
@media (max-width: 720px) {
    .calendar-layout, .home-sidebar .calendar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .header-bar { flex-wrap: wrap; gap: 10px; }
    .nav-toggle { display: block; order: 2; margin-left: auto; }
    .site-nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding-top: 8px; }
    .site-nav.nav-open { display: flex; }
    .nav-link { padding: 11px 12px; font-size: 15px; }
    .nav-item { flex-direction: row; align-items: center; }
    .nav-item > .nav-link { flex: 1; }
    .sub-toggle { margin-left: 0; padding: 10px 14px; font-size: 13px; }
    .nav-sub, .nav-sub-right .nav-sub { display: none; position: static; box-shadow: none; border: 0; border-left: 2px solid #e6ebf2; border-radius: 0; margin: 0 0 6px 12px; padding: 4px 0 4px 8px; min-width: 0; }
    .has-sub:hover .nav-sub, .has-sub:focus-within .nav-sub { display: none; }
    .has-sub.sub-open .nav-sub { display: block; }
    .nav-sub a { font-size: 14px; padding: 8px 10px; }
    .nav-link-last { display: none; }
    .nav-search { margin: 8px 0 0; height: 42px; width: 100%; }
    .nav-search-input { width: 100%; font-size: 15px; }
    .nav-search-btn { padding: 0 16px; }
}
@media (max-width: 640px) {
    .header-bar { padding: 14px 0 10px; gap: 10px; }
    .brand-banner-mark, .brand-banner-logo { width: 38px; height: 38px; }
    .brand-banner-text strong { font-size: 19px; }
    .brand-banner-text small { font-size: 11px; }
    .brand-banner-slogan { font-size: 12px; padding-left: 10px; letter-spacing: 0; }
    .hero { padding: 13px 18px; }
    .hero h1 { font-size: 22px; }
    .article-detail h1 { font-size: 24px; }
    .header-bar { align-items: center; }
}

/* 仅给搜索引擎/AI 读取的信息，页面上完全不可见（不用 display:none，保证爬虫可读） */
.seo-machine-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
