:root {
    --bg: #f6f8fc;
    --surface: #ffffff;
    --border: #e6ebf2;
    --text: #1b2230;
    --muted: #5a6577;
    --primary: #2762ff;
    --primary-dark: #1c4cd6;
    --accent: #ff5a3d;
    --shadow: 0 10px 28px rgba(20, 40, 90, 0.06);
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { color: var(--text); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #19c4ff);
    color: #fff; display: grid; place-items: center;
    font-weight: 800; font-size: 18px;
    box-shadow: 0 6px 14px rgba(39, 98, 255, 0.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 18px; }
.brand-slogan { font-size: 11px; color: var(--muted); margin-top: 2px; }

.site-nav { display: flex; gap: 22px; margin-left: 20px; }
.site-nav a { color: var(--text); font-size: 15px; padding: 6px 2px; position: relative; }
.site-nav a.active, .site-nav a:hover { color: var(--primary); }
.site-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--primary); border-radius: 2px; }

.site-actions { margin-left: auto; display: flex; gap: 10px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 16px; border-radius: 8px;
    font-size: 14px; cursor: pointer; border: 1px solid transparent;
    transition: all 0.15s ease; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; height: 42px; font-size: 15px; }

.hero {
    background:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.18), transparent 55%),
        radial-gradient(circle at 85% 85%, rgba(255,255,255,0.12), transparent 50%),
        linear-gradient(135deg, #1a4cff 0%, #19c4ff 100%);
    color: #fff;
    padding: 64px 0 56px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
    pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }
.hero-title { font-size: 40px; font-weight: 800; margin: 0 0 12px; color: #fff; }
.hero-sub { font-size: 16px; opacity: 0.9; margin: 0 auto 28px; max-width: 720px; }
.hero-search { max-width: 720px; margin: 0 auto; }
.hero-tags { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; font-size: 14px; }
.hero-tags .tag-label { opacity: 0.85; }
.hero-tags a { color: rgba(255,255,255,0.92); border-bottom: 1px dashed rgba(255,255,255,0.35); padding-bottom: 1px; }
.hero-tags a:hover { color: #fff; border-color: #fff; }

.search-form {
    display: flex; background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 24, 80, 0.25);
    height: 54px;
}
.search-input {
    flex: 1; border: 0; padding: 0 18px;
    font-size: 16px; color: var(--text); outline: none; background: transparent;
}
.search-btn {
    border: 0; background: var(--primary); color: #fff; padding: 0 22px;
    font-size: 15px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: background 0.15s ease;
}
.search-btn:hover { background: var(--primary-dark); }

.subhero { padding: 28px 0 12px; }
.subhero h1 { margin: 0; font-size: 26px; }
.subhero .muted { color: var(--muted); margin: 6px 0 18px; }
.subhero-search { max-width: 640px; }
.subhero-search .search-form { height: 46px; box-shadow: 0 6px 18px rgba(20, 40, 90, 0.08); }

.section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; position: relative; padding-left: 12px; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; background: var(--primary); border-radius: 4px; }
.more-link { color: var(--primary); font-size: 14px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    color: var(--text);
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3deef; color: var(--text); }
.card-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #eef2f8; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; }
.card-title {
    margin: 0 0 8px; font-size: 15px; font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.6em;
}
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.card-meta .dot { opacity: 0.6; }

.hot-list {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px 28px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 22px;
}
.hot-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); overflow: hidden; }
.hot-list li:last-child, .hot-list li:nth-last-child(2) { border-bottom: 0; }
.hot-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.hot-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.feature-section { padding-top: 12px; padding-bottom: 56px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature-ico { font-size: 26px; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.article-table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.article-table th, .article-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.article-table th { background: #f3f6fb; color: var(--muted); font-weight: 600; font-size: 13px; }
.article-table tbody tr:last-child td { border-bottom: 0; }
.article-table tr:hover td { background: #f8fafd; }
.article-table .row-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.article-table .empty { text-align: center; color: var(--muted); padding: 28px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 28px 0 8px; flex-wrap: wrap; }
.pager-btn, .pager-num {
    min-width: 38px; height: 36px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: #fff;
    border-radius: 8px; color: var(--text); font-size: 14px;
}
.pager-btn:hover, .pager-num:hover { border-color: var(--primary); color: var(--primary); }
.pager-num.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.disabled { color: #b6bccb; cursor: not-allowed; background: #f7f9fc; }

.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 20px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.article-wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px; padding: 24px 20px 48px;
}
.article-wrap.single { grid-template-columns: minmax(0, 1fr); max-width: 880px; }
.article-main {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 32px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.article-head h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.35; }
.article-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.article-meta .dot { opacity: 0.6; }
.article-cover { margin: 22px 0; }
.article-cover img { border-radius: 8px; width: 100%; height: auto; }
.article-cover figcaption { color: var(--muted); font-size: 13px; text-align: center; margin-top: 8px; }
.article-content { font-size: 15px; line-height: 1.85; word-break: break-word; }
.article-content p { margin: 0 0 14px; }
.article-content h2, .article-content h3 { margin: 22px 0 10px; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; }
.article-content ol, .article-content ul { padding-left: 22px; margin: 0 0 14px; }
.article-content ol { list-style: decimal; }
.article-content ul { list-style: disc; }

.resource-panel {
    margin-top: 28px; border: 1px solid var(--border);
    border-radius: var(--radius); background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 60%);
    padding: 22px 24px;
    min-width: 0;
    overflow: hidden;
}
.resource-head h3 { margin: 0; font-size: 18px; }
.resource-head p { margin: 4px 0 16px; color: var(--muted); font-size: 13px; }
.resource-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}
.resource-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 12px 14px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 0;
}
.resource-badge {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 8px;
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.resource-info {
    flex: 1 1 160px;
    min-width: 0;
}
.resource-name {
    font-weight: 600; font-size: 15px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resource-url {
    font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resource-cta {
    background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px;
    font-size: 13px; white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}
.resource-cta:hover { background: var(--primary-dark); color: #fff; }
.resource-tip { margin: 14px 0 0; color: var(--muted); font-size: 12px; }

.related { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 18px; min-width: 0; }
.related h3 { margin: 0 0 10px; font-size: 17px; }
.related ul {
    display: grid; gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.related li {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; padding: 6px 0; min-width: 0;
}
.related li a {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1 1 auto; min-width: 0;
}
.related li time {
    color: var(--muted); font-size: 12px;
    white-space: nowrap; flex: 0 0 auto;
}

.article-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.side-card h4 { margin: 0 0 8px; font-size: 15px; }
.side-card p { margin: 0; color: var(--muted); font-size: 13px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 4px 10px; background: #eef3ff; color: var(--primary); border-radius: 999px; font-size: 12px; }
.tag:hover { background: var(--primary); color: #fff; }

.link-list { display: grid; gap: 6px; padding: 4px 0; }
.link-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.link-list time { color: var(--muted); font-size: 12px; }

.auth-wrap { padding: 60px 20px; display: grid; place-items: center; min-height: 60vh; }
.auth-card {
    width: 100%; max-width: 420px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px;
    padding: 32px 30px; box-shadow: var(--shadow);
}
.auth-title { margin: 0 0 6px; font-size: 24px; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.auth-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input {
    height: 42px; border: 1px solid var(--border); border-radius: 8px;
    padding: 0 12px; font-size: 14px; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(39, 98, 255, 0.12); }
.field-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.link { color: var(--primary); }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--primary); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 4px; }
.alert-error { background: #fff1f0; color: #b8332f; border: 1px solid #ffd6d4; }
.alert-warn { background: #fffaeb; color: #946200; border: 1px solid #ffe7a6; }

.error-wrap { padding: 60px 20px; display: grid; place-items: center; min-height: 60vh; }
.error-card { text-align: center; max-width: 460px; }
.error-code { font-size: 92px; font-weight: 900; background: linear-gradient(135deg, var(--primary), #19c4ff); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-card h1 { margin: 8px 0 8px; font-size: 24px; }
.error-card p { color: var(--muted); margin: 0 0 18px; }
.error-actions { display: flex; gap: 10px; justify-content: center; }

.site-footer {
    margin-top: 32px; border-top: 1px solid var(--border);
    background: #0e1830; color: rgba(255,255,255,0.78);
}
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.site-footer a { color: rgba(255,255,255,0.78); }
.site-footer a:hover { color: #fff; }
.footer-inner {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px;
    padding: 36px 20px 24px;
}
.footer-col ul { display: grid; gap: 6px; font-size: 13px; }
.footer-col p { color: rgba(255,255,255,0.6); font-size: 13px; margin: 0; line-height: 1.7; }
.footer-bottom {
    padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px; color: rgba(255,255,255,0.55);
}

@media (max-width: 960px) {
    .header-inner { gap: 12px; }
    .site-nav { display: none; }
    .hero-title { font-size: 30px; }
    .article-wrap { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 18px; }
    .related ul, .hot-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .article-main { padding: 20px 18px; }
    .footer-inner { grid-template-columns: 1fr; }
    .hero { padding: 44px 0 40px; }
    .hero-title { font-size: 24px; }
    .hero-sub { font-size: 14px; }
    .site-actions .btn-ghost { display: none; }
}
