:root {
    --ink: #1c1916;
    --paper: #f4efe4;
    --faded: #9a8f7e;
    --muted: #c4bdb0;
    --accent: #2e2a26;
    --line: #d8d0c4;
    --sidebar: 260px;
    --font-serif: "STSong", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "PMingLiU", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-serif);
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; display: flex; }

/* ── 侧边栏 ── */
.sidebar {
    width: var(--sidebar);
    min-height: 100vh;
    border-right: 1px solid var(--line);
    padding: 56px 40px;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #e11d74, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: white;
    margin-bottom: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.sidebar-name {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--ink);
    margin-bottom: 8px;
}

.sidebar-motto {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.25em;
    line-height: 1.8;
    margin-bottom: 40px;
}

/* 菜单 */
nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: auto;
}

.nav-item {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.3em;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    text-decoration: none;
    display: block;
}

.nav-item:hover { color: var(--ink); }

.nav-item.active {
    color: var(--ink);
    background: rgba(28, 25, 22, 0.05);
}

/* 联系我 */
.sidebar-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}

.contact-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--faded);
    letter-spacing: 0.3em;
    border: 1px solid var(--line);
    background: none;
    padding: 8px 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    width: 100%;
}

.contact-btn:hover {
    color: var(--ink);
    border-color: var(--faded);
}

/* ── 主内容 ── */
.main {
    margin-left: var(--sidebar);
    flex: 1;
    min-height: 100vh;
    padding: 64px 72px 100px;
    max-width: 860px;
}

/* 页面过渡 */
.page {
    animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 首页 ── */
.home-intro {
    padding-bottom: 56px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 56px;
}

.home-intro h1 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    line-height: 1.6;
}

.home-intro p {
    font-size: 15px;
    font-weight: 300;
    line-height: 2.4;
    color: var(--accent);
    letter-spacing: 0.05em;
    max-width: 520px;
}

.home-intro p + p { margin-top: 1.2em; }

.products {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.product-link {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--faded);
    letter-spacing: 0.25em;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.product-link:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.home-recent h2 {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.4em;
    margin-bottom: 32px;
}

/* ── 随笔列表 ── */
.essay-list-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.4em;
    margin-bottom: 40px;
}

.essay-item {
    padding: 40px 0;
    border-bottom: 1px solid var(--line);
    transition: opacity 0.2s;
}

.essay-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.essay-item:first-of-type { border-top: 1px solid var(--line); }
.essay-item:hover { opacity: 0.45; }

.essay-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.essay-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.2em;
}

.essay-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.essay-title {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.essay-excerpt {
    font-size: 13px;
    font-weight: 300;
    line-height: 2;
    color: var(--faded);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.04em;
}

/* ── 文章详情 ── */
.back-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.35em;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin-bottom: 56px;
    display: inline-block;
    transition: color 0.2s;
    text-decoration: none;
}

.back-btn:hover { color: var(--ink); }

.article-header {
    margin-bottom: 52px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--line);
}

.article-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.25em;
    margin-bottom: 18px;
}

.article-title {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: 0.1em;
}

.article-body {
    font-size: 15.5px;
    font-weight: 300;
    line-height: 2.6;
    letter-spacing: 0.06em;
    color: var(--accent);
    max-width: 560px;
}

.article-body p { text-indent: 2em; }
.article-body p + p { margin-top: 0.3em; }

/* ── SBTI 结果卡片 ── */
.sbti-card {
    margin: 2.4em 0;
    text-indent: 0;
    max-width: 520px;
}

.sbti-card-top {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.sbti-card-left {
    background: #f7f7f5;
    padding: 24px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 170px;
    border-right: 1px solid #eee;
}

.sbti-card-left-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    color: #999;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.sbti-card-left-type {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #2c2c2c;
    margin-bottom: 2px;
}

.sbti-card-left-name {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: #4a9e5c;
    letter-spacing: 0.2em;
    margin-bottom: 14px;
}

.sbti-card-left-figure {
    width: 72px;
    height: 96px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* ── GOGO 行者 低多边形小人 ── */
.gogo {
    position: relative;
    width: 58px;
    height: 88px;
}

/* head — 五边形方块头 */
.gogo-head {
    position: absolute;
    width: 32px;
    height: 32px;
    top: 0;
    left: 13px;
    z-index: 5;
}
/* 头正面 */
.gogo-head::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(170deg, #e8d2b0 0%, #ddc4a0 45%, #d2b690 100%);
    clip-path: polygon(8% 10%, 92% 10%, 98% 48%, 80% 98%, 20% 98%);
}
/* 头顶面（3D 感） */
.gogo-head::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 50%;
    top: 0;
    background: linear-gradient(180deg, rgba(180,155,120,0.25) 0%, transparent 100%);
    clip-path: polygon(8% 10%, 92% 10%, 88% 60%, 12% 60%);
}
/* 左眼 */
.gogo-eye {
    position: absolute;
    width: 4px;
    height: 5px;
    background: #1a1410;
    border-radius: 50%;
    top: 42%;
    z-index: 6;
}
.gogo-eye--l { left: 28%; }
.gogo-eye--r { right: 26%; }
/* 嘴 */
.gogo-mouth {
    position: absolute;
    width: 9px;
    height: 4px;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    border-bottom: 2px solid #b8946c;
    border-radius: 0 0 4px 4px;
}

/* 脖子 */
.gogo-neck {
    position: absolute;
    width: 12px;
    height: 5px;
    top: 30px;
    left: 23px;
    background: #d6b892;
    z-index: 3;
}

/* 躯干 */
.gogo-torso {
    position: absolute;
    width: 26px;
    height: 20px;
    top: 33px;
    left: 16px;
    background: linear-gradient(150deg, #e4ccaa 15%, #d8be98 45%, #ccae88 85%);
    clip-path: polygon(4% 0%, 96% 0%, 86% 100%, 14% 100%);
    z-index: 3;
}

/* 手臂 */
.gogo-arm {
    position: absolute;
    width: 9px;
    height: 22px;
    top: 34px;
    border-radius: 4px;
    transform-origin: 50% 3px;
}
.gogo-arm--back {
    left: 7px;
    background: linear-gradient(160deg, #d4b08a 20%, #c4a07a 80%);
    transform: rotate(-38deg);
    z-index: 2;
}
.gogo-arm--front {
    right: 7px;
    background: linear-gradient(160deg, #dfc49e 20%, #d2b690 80%);
    transform: rotate(32deg);
    z-index: 6;
}
/* 手掌 */
.gogo-arm--back::after,
.gogo-arm--front::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    border-radius: 3px;
}
.gogo-arm--back::after { background: #ccaa82; }
.gogo-arm--front::after { background: #d8be98; }

/* 腿 */
.gogo-leg {
    position: absolute;
    width: 10px;
    height: 26px;
    top: 51px;
    border-radius: 4px 4px 3px 3px;
    transform-origin: 50% 3px;
}
.gogo-leg--back {
    left: 16px;
    background: linear-gradient(160deg, #d0ac88 20%, #c4a07a 80%);
    transform: rotate(24deg);
    z-index: 1;
}
.gogo-leg--front {
    right: 16px;
    background: linear-gradient(160deg, #dcbfa0 20%, #d0b08a 80%);
    transform: rotate(-20deg);
    z-index: 2;
}

/* 脚 */
.gogo-leg--back::after,
.gogo-leg--front::after {
    content: '';
    position: absolute;
    bottom: -3px;
    width: 13px;
    height: 6px;
    border-radius: 3px 5px 2px 2px;
}
.gogo-leg--back::after {
    left: -2px;
    background: #c09a76;
}
.gogo-leg--front::after {
    right: -2px;
    background: #ccaa88;
}

/* 地面投影 */
.gogo-shadow {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 6px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.12) 0%, transparent 70%);
    z-index: 0;
}

.sbti-card-left-motto {
    font-family: var(--font-sans);
    font-size: 10px;
    color: #aaa;
    letter-spacing: 0.05em;
}

.sbti-card-right {
    background: #fff;
    padding: 24px 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sbti-card-right-label {
    font-family: var(--font-sans);
    font-size: 10px;
    color: #4a9e5c;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.sbti-card-right-title {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    color: #2c2c2c;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.sbti-card-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: #4a9e5c;
    background: #edf7ef;
    border-radius: 20px;
    padding: 4px 14px;
    letter-spacing: 0.03em;
    margin-bottom: 14px;
}

.sbti-card-right-desc {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 300;
    color: #999;
    line-height: 1.7;
    letter-spacing: 0.03em;
}

.sbti-card-bottom {
    margin-top: 10px;
    background: #fdfcfa;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.sbti-card-bottom-title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.sbti-card-bottom-text {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 300;
    color: #666;
    line-height: 2;
    letter-spacing: 0.02em;
    text-indent: 0;
}

@media (max-width: 640px) {
    .sbti-card-top { flex-direction: column; }
    .sbti-card-left {
        border-right: none;
        border-bottom: 1px solid #eee;
        min-width: unset;
        padding: 20px 16px 14px;
    }
    .sbti-card-right { padding: 18px 16px; }
}

/* ── 内嵌图片（通用） ── */
.article-body figure {
    margin: 2.8em 0;
    text-indent: 0;
    max-width: 320px;
}

.article-body figure img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.article-body figcaption {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.15em;
    margin-top: 10px;
}

.article-body hr {
    border: none;
    margin: 2.8em auto;
    width: 1px;
    height: 22px;
    background: var(--muted);
    display: block;
}

.article-signature {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.signature-name {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.35em;
}

.signature-motto {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.25em;
}

/* ── 关于 ── */
.about-body {
    font-size: 15px;
    font-weight: 300;
    line-height: 2.6;
    letter-spacing: 0.06em;
    color: var(--accent);
    max-width: 520px;
}

.about-body p + p { margin-top: 1.6em; }

.about-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.4em;
    margin-bottom: 40px;
}

/* ── 动态 ── */
.updates-title {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.4em;
    margin-bottom: 40px;
}

.update-item {
    display: flex;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
}

.update-item:first-of-type { border-top: 1px solid var(--line); }

.update-date {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.15em;
    white-space: nowrap;
    padding-top: 3px;
    min-width: 88px;
}

.update-content {
    font-size: 14px;
    font-weight: 300;
    line-height: 2.2;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.update-tag {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.2em;
    border: 1px solid var(--line);
    padding: 2px 8px;
    margin-bottom: 10px;
}

/* ── 弹窗 ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(244, 239, 228, 0.88);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 52px 48px;
    max-width: 340px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-question {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--ink);
    margin-bottom: 10px;
    text-align: center;
}

.modal-hint {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.25em;
    margin-bottom: 36px;
    text-align: center;
}

.modal-input {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.4em;
    color: var(--ink);
    background: none;
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    width: 120px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}

.modal-input:focus { border-color: var(--faded); }

.modal-error {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--faded);
    letter-spacing: 0.2em;
    height: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.modal-submit {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--faded);
    letter-spacing: 0.35em;
    border: 1px solid var(--line);
    background: none;
    padding: 10px 32px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.modal-submit:hover { color: var(--ink); border-color: var(--faded); }

.modal-result {
    display: none;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    width: 100%;
}

.modal-result.show { display: flex; }

.result-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.2em;
}

.result-label { color: var(--muted); }
.result-value { color: var(--ink); }

.result-link {
    color: var(--ink);
    text-decoration: none;
}

.result-link:hover { color: var(--faded); }

/* ── 语言切换 ── */
.lang-switch {
    display: inline-flex;
    margin-top: 24px;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.lang-switch a {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-decoration: none;
    padding: 6px 14px;
    transition: color 0.2s, background 0.2s;
    position: relative;
}

.lang-switch a + a { border-left: 1px solid var(--line); }

.lang-switch a:hover {
    color: var(--ink);
    background: rgba(28, 25, 22, 0.03);
}

.lang-switch a.active {
    color: var(--ink);
    background: rgba(28, 25, 22, 0.06);
    font-weight: 400;
}

/* ── 响应式 ── */
@media (max-width: 860px) {
    :root { --sidebar: 220px; }
    .main { padding: 48px 40px 80px; }
}

@media (max-width: 640px) {
    body { flex-direction: column; }

    .sidebar {
        position: relative;
        width: 100%;
        min-height: unset;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 40px 24px 32px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px;
    }

    .avatar { width: 52px; height: 52px; font-size: 16px; margin-bottom: 0; }

    .sidebar-info { flex: 1; }
    .sidebar-name { font-size: 16px; margin-bottom: 4px; }
    .sidebar-motto { margin-bottom: 0; }

    nav {
        width: 100%;
        flex-direction: row;
        gap: 0;
        margin-bottom: 0;
    }

    .nav-item { padding: 8px 10px; font-size: 11px; }

    .sidebar-footer { display: none; }

    .main {
        margin-left: 0;
        padding: 40px 24px 80px;
    }
}
