:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --text-main: #1f2937;
    --text-sub: #65748a;
    --line: #e4eaf3;
    --brand: #3b82f6;
    --brand-deep: #2f6edb;
    --ok: #5f8d66;
    --shadow: 0 12px 30px rgba(30, 64, 175, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at 10% 10%, rgba(30, 64, 175, 0.28) 0, transparent 38%),
        radial-gradient(circle at 90% 20%, rgba(14, 165, 233, 0.2) 0, transparent 45%),
        linear-gradient(160deg, #060b1b 0%, #0b1327 45%, #0b1b33 100%);
    font-size: 15px;
    line-height: 1.7;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    isolation: isolate;
}

.bg-fx-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.9;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all .2s ease;
}

a:hover {
    color: var(--brand-deep);
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
    display: block;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.container {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.muted {
    color: var(--text-sub);
}

.btn-soft,
.btn-main,
.btn-text {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
}

.btn-main {
    background: linear-gradient(120deg, var(--brand), #5b8def);
    color: #fff;
    border: 1px solid transparent;
}

.btn-main:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn-soft {
    background: #edf4ff;
    color: var(--brand-deep);
    border: 1px solid #cfe0ff;
}

.btn-text {
    padding: 8px 12px;
    color: var(--text-sub);
    border: 1px solid transparent;
}

.page-shell {
    padding-top: 88px;
    padding-bottom: 28px;
    position: relative;
    z-index: 2;
}

/* header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(9, 16, 34, 0.68);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    z-index: 9;
}

.site-topbar {
    height: 74px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 58px;
}

.site-brand img {
    width: auto;
    height: 58px;
    max-width: 180px;
    object-fit: contain;
}

.site-brand span {
    font-size: 17px;
    font-weight: 600;
    color: #ecf3ff;
}

.site-nav {
    flex: 1;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav li {
    position: relative;
}

.site-nav li.mobile-auth {
    display: none;
}

.site-nav li > a {
    display: inline-flex;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 14px;
    color: #c8d6eb;
}

.site-nav li.active > a,
.site-nav li > a:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #eaf2ff;
}

.site-nav .has-sub > a {
    padding-right: 40px;
}

.nav-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 0;
    background: transparent;
    color: #9fb0c8;
    cursor: pointer;
    padding: 0;
}

.nav-arrow::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.site-nav .has-sub:hover > .nav-arrow,
.site-nav .has-sub.is-open > .nav-arrow,
.site-nav .has-sub.active > .nav-arrow {
    color: #eaf2ff;
}

.site-nav .has-sub:hover > .nav-arrow::before,
.site-nav .has-sub.is-open > .nav-arrow::before {
    transform: rotate(225deg);
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s ease;
}

.nav-submenu a {
    display: block;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-sub);
}

.nav-submenu a:hover {
    background: #f6f8fb;
    color: var(--brand-deep);
}

.site-nav .has-sub:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav .has-sub.is-open .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-text {
    color: #d4e1f5;
}

.site-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user {
    position: relative;
}

.nav-avatar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #dce6f4;
    background: #f8fbff;
}

.nav-avatar-link img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.nav-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 150px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s ease;
}

.nav-user:hover .nav-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-user-menu a {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-sub);
    border-radius: 8px;
}

.nav-user-menu a:hover {
    background: #f6f8fb;
    color: var(--brand-deep);
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #d8e2ef;
    background: #fff;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: #65758b;
    margin: 4px 0;
}

/* footer */
.site-footer {
    margin-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    background: linear-gradient(180deg, rgba(10, 18, 35, 0.6), rgba(9, 17, 33, 0.88));
    position: relative;
    z-index: 2;
}

.footer-main {
    padding: 26px 0 10px;
    display: grid;
    grid-template-columns: 1.1fr 1.6fr 1fr;
    gap: 16px;
}

.footer-card {
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.footer-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #e4edfb;
}

.footer-card p {
    margin: 0;
    color: #9db1cc;
    font-size: 13px;
    line-height: 1.8;
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-links a {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(30, 41, 59, 0.62);
    font-size: 12px;
    color: #c8d7ee;
}

.footer-bottom {
    border-top: 1px dashed rgba(148, 163, 184, 0.25);
    margin-top: 10px;
    padding: 14px 0 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #93a8c5;
    font-size: 12px;
}

.footer-bottom a {
    margin-left: 10px;
    color: inherit;
}

/* home */
.home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.hero-main,
.hero-side {
    padding: 24px;
}

.hero-main {
    background: linear-gradient(135deg, rgba(18, 31, 58, 0.92), rgba(23, 45, 79, 0.88));
    border: 1px solid rgba(147, 197, 253, 0.28);
}

.hero-main h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.25;
    color: #eef5ff;
}

.hero-main p {
    margin: 14px 0 0;
    color: #c7d7ee;
    font-size: 15px;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hero-stat {
    background: #f4f8ff;
    border: 1px solid #d5e1f2;
    border-radius: 12px;
    padding: 14px;
}

.hero-stat strong {
    display: block;
    font-size: 24px;
    line-height: 1;
    color: var(--brand-deep);
}

.hero-stat span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-sub);
}

.content-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.main-column,
.sidebar {
    min-width: 0;
}

.section-card {
    padding: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.26);
    backdrop-filter: blur(2px);
}

.section-title {
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
}

.section-title small {
    color: var(--text-sub);
    font-size: 12px;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.post-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
}

.post-cover {
    height: 100%;
    background: linear-gradient(120deg, #eef4ff, #e4eeff);
    overflow: hidden;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.post-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.post-title a {
    color: #0f172a;
    display: block;
}

.post-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #475569;
    min-height: 22px;
}

.post-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #6c7d95;
    font-size: 12px;
}

.mini-list li {
    border-bottom: 1px dashed #dfe7f3;
}

.mini-list li:last-child {
    border-bottom: none;
}

.mini-list a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
    color: #5a6a80;
}

.mini-list a span:last-child {
    color: #90a1b5;
    white-space: nowrap;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list a {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid #dde6f2;
    background: #f8fbff;
    color: #5f6b7a;
}

.tag-list a i {
    margin-left: 6px;
    color: #8597ad;
    font-style: normal;
}

.empty-tip {
    color: var(--text-sub);
    font-size: 13px;
    padding: 8px 0;
}

/* list */
.list-header {
    padding: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.26);
    backdrop-filter: blur(2px);
}

.list-header h1 {
    margin: 0;
    font-size: 26px;
}

.list-search {
    display: flex;
    gap: 8px;
}

.list-search input {
    width: 220px;
    border: 1px solid #d8e2ef;
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    color: var(--text-main);
}

.list-search button {
    border: 0;
}

.article-list {
    display: grid;
    gap: 12px;
}

.article-list-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 14px;
}

.article-list-card h2 {
    margin: 0;
    font-size: 18px;
}

.article-list-card p {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--text-sub);
}

.pagebox {
    padding-top: 14px;
    text-align: center;
}

.pagebox a,
.pagebox span {
    display: inline-block;
    margin: 0 4px;
    min-width: 32px;
    border: 1px solid #d0ddee;
    border-radius: 8px;
    background: #fff;
    color: #607189;
    padding: 6px 10px;
    font-size: 13px;
}

.pagebox span,
.pagebox a:hover {
    background: #e7f0ff;
    border-color: #d2deef;
    color: var(--brand-deep);
}

/* detail */
.detail-shell {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.detail-main {
    padding: 24px;
}

.detail-title {
    margin: 0;
    font-size: 32px;
    line-height: 1.35;
}

.detail-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #71839a;
    font-size: 13px;
}

.detail-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tags a {
    font-size: 12px;
    color: #617086;
    border: 1px solid #dce5f2;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f8fbff;
}

.detail-content {
    margin-top: 18px;
    border-top: 1px solid #dfe8f3;
    padding-top: 18px;
    font-size: 16px;
    line-height: 1.9;
    color: #2d3748;
    word-break: break-word;
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6 {
    margin: 18px 0 10px;
}

.detail-content p,
.detail-content li {
    margin: 10px 0;
}

.detail-content ol,
.detail-content ul {
    margin: 10px 0 10px 22px;
    list-style: initial;
}

.detail-content img {
    margin: 16px auto;
    border-radius: 10px;
    border: 1px solid #dce6f3;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.10);
}

.detail-content a {
    color: var(--brand-deep);
    text-decoration: underline;
}

.detail-content code {
    background: #eef3fb;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 14px;
}

.detail-content pre {
    margin: 14px 0;
    background: #eef3fb;
    border-radius: 10px;
    padding: 12px;
    overflow-x: auto;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}

.detail-content table td,
.detail-content table th {
    border: 1px solid #d6e0ee;
    padding: 8px;
    font-size: 14px;
}

.detail-content table th {
    background: #f4f8ff;
}

/* user center */
.user-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
}

.user-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.user-menu h3 {
    margin: 0;
    padding: 16px;
    font-size: 18px;
    background: linear-gradient(120deg, #e7effc, #e9f1ff);
}

.user-menu li a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: #5d6f86;
    border-top: 1px solid #e4edf8;
}

.user-menu li.on a,
.user-menu li a:hover {
    background: #edf5ff;
    color: var(--brand-deep);
}

.user-main {
    display: grid;
    gap: 16px;
}

.user-profile,
.user-panel {
    padding: 18px;
}

.user-profile {
    display: flex;
    gap: 14px;
    align-items: center;
}

.user-profile img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #edf4ff;
}

.user-profile h2 {
    margin: 0;
    font-size: 22px;
}

.user-profile p {
    margin: 6px 0 0;
    color: var(--text-sub);
    font-size: 13px;
}

.user-panel h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.user-table td {
    border: 1px solid #dfe8f4;
    padding: 10px;
    font-size: 14px;
}

.user-table td.label {
    width: 15%;
    color: #6c7d95;
    background: #f6f9ff;
    text-align: right;
    white-space: nowrap;
}

.user-input,
.user-textarea,
.user-select {
    width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    color: #2d3748;
    font-size: 14px;
}

.user-textarea {
    min-height: 96px;
    resize: vertical;
}

.user-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

/* auth */
.auth-page {
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px 16px;
    background: radial-gradient(circle at 20% 20%, #f4f8ff 0, transparent 35%), #f3f8ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-wrap {
    width: min(980px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #dde6f2;
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.12);
    background: #fff;
}

.auth-cover {
    background: linear-gradient(140deg, #eaf1ff, #f5f9ff);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-cover h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.3;
}

.auth-cover p {
    margin-top: 12px;
    color: #5f6b7a;
}

.auth-form {
    padding: 34px;
}

.auth-form h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.auth-item {
    margin-bottom: 12px;
}

.auth-item input {
    width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fcfdff;
}

.auth-captcha {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
}

.auth-captcha .captcha-img {
    border: 1px solid #dce5f2;
    border-radius: 10px;
    overflow: hidden;
    height: 46px;
}

.auth-captcha .captcha-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-btn {
    width: 100%;
    border: 0;
    margin-top: 4px;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    background: linear-gradient(120deg, var(--brand), #5b8def);
    color: #fff;
    cursor: pointer;
}

.auth-note {
    margin-top: 14px;
    color: #6a7b90;
    font-size: 13px;
    text-align: center;
}

.auth-note a {
    color: var(--brand-deep);
}

.auth-foot {
    margin-top: 14px;
    text-align: center;
    color: #7f90a5;
    font-size: 12px;
}

/* responsive */
@media (max-width: 1080px) {
    .home-hero,
    .content-grid,
    .detail-shell,
    .user-shell {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .site-topbar {
        height: 66px;
    }

    .site-brand {
        min-width: 48px;
    }

    .site-brand img {
        height: 48px;
        max-width: 150px;
    }

    .site-brand span {
        font-size: 16px;
    }

    .nav-toggle {
        display: inline-block;
        margin-left: auto;
    }

    .site-nav {
        position: absolute;
        top: 66px;
        left: 0;
        right: 0;
        background: rgba(10, 18, 35, 0.96);
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
        padding: 10px 16px 14px;
        display: none;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-nav ul {
        display: block;
    }

    .site-nav li {
        margin-bottom: 8px;
    }

    .site-nav li.mobile-auth {
        display: block;
    }

    .site-nav li > a {
        display: block;
        border-radius: 10px;
    }

    .site-nav .has-sub > a {
        padding-right: 44px;
    }

    .nav-arrow {
        right: 14px;
        top: 14px;
        transform: none;
        width: 20px;
        height: 20px;
    }

    .site-nav .has-sub:hover .nav-submenu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-submenu {
        position: static;
        margin-top: 6px;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        border: 1px solid rgba(148, 163, 184, 0.22);
        background: rgba(13, 23, 42, 0.92);
        box-shadow: none;
    }

    .nav-submenu a {
        color: #b9cae5;
    }

    .nav-submenu a:hover {
        background: rgba(59, 130, 246, 0.18);
        color: #eef5ff;
    }

    .has-sub:hover .nav-submenu {
        display: none;
    }

    .has-sub.is-open .nav-submenu,
    .has-sub.is-open:hover .nav-submenu {
        display: block;
    }

    .site-auth {
        display: none;
    }

    .post-card {
        grid-template-columns: 1fr;
    }

    .post-cover {
        height: 180px;
    }

    .page-shell {
        padding-top: 82px;
    }

    .hero-main h1 {
        font-size: 28px;
    }

    .list-search input {
        width: 160px;
    }

    .auth-wrap {
        grid-template-columns: 1fr;
    }

    .auth-cover {
        padding: 26px;
    }

    .auth-cover h1 {
        font-size: 26px;
    }

    .auth-form {
        padding: 24px;
    }

    .auth-captcha {
        grid-template-columns: 1fr;
    }

    .auth-page {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .container {
        width: calc(100% - 20px);
    }

    .page-shell {
        padding-top: 78px;
    }

    .hero-main,
    .hero-side,
    .section-card,
    .detail-main {
        padding: 16px;
    }

    .detail-title {
        font-size: 24px;
    }

    .list-header {
        padding: 14px;
    }

    .list-header h1 {
        font-size: 22px;
    }

    .list-search {
        width: 100%;
    }

    .list-search input {
        width: 100%;
    }

    .user-table td,
    .user-table td.label {
        display: block;
        width: 100%;
        text-align: left;
    }

    .user-table td.label {
        border-bottom: 0;
    }

    .footer-bottom {
        display: block;
        line-height: 1.9;
    }

    .footer-bottom a {
        margin-left: 0;
        margin-right: 10px;
    }
}
