:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-soft: #f6f6f7;
    --ink: #111111;
    --text: #2f3337;
    --muted: #8b9098;
    --line: #e9eaee;
    --black: #111111;
    --blue: #e7f0ff;
    --aqua: #e7f7fb;
    --peach: #fff0e2;
    --lilac: #f1eaff;
    --pink: #ffeaf0;
    --warn: #9a5b12;
    --danger: #c2410c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 max(24px, calc((100vw - 1160px) / 2));
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand {
    color: var(--ink);
    font-size: 21px;
    font-weight: 900;
}
.brand span { color: var(--ink); }
.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar nav a,
.inline button {
    border: 0;
    background: transparent;
    color: #525760;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}
.topbar nav a:hover,
.inline button:hover { background: var(--surface-soft); color: var(--ink); }

.container {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto 76px;
}
.hero {
    min-height: 460px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: center;
    gap: 52px;
    padding: 54px 0 34px;
}
.hero-copy { min-width: 0; }
.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.hero h1 {
    max-width: 760px;
    margin: 14px 0 18px;
    color: var(--ink);
    font-size: clamp(42px, 5.6vw, 70px);
    line-height: 1.08;
    font-weight: 900;
}
.hero p {
    max-width: 660px;
    margin: 0;
    color: #747a83;
    font-size: 18px;
    line-height: 1.8;
}
.hero-search {
    width: min(760px, 100%);
    margin: 34px 0 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.hero-search input {
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 18px;
    color: var(--ink);
}
.hero-search input::placeholder { color: #b3b7be; }

.mascot-stage {
    width: 100%;
    min-width: 0;
}
.mascot-card {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #f7f8fb);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 24px;
}
.mascot-bubble {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    background: var(--ink);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
}
.mascot-squad {
    --look-x: 0px;
    --look-y: 0px;
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 58px;
    height: 168px;
}
.mascot {
    position: absolute;
    bottom: 0;
    display: block;
    transition: transform .2s ease, border-radius .2s ease;
    border: 2px solid rgba(17, 17, 17, .08);
}
.mascot-blue { background: #dcecff; left: 8px; }
.mascot-ink { background: #22242a; left: 92px; }
.mascot-peach { background: #ffe3bd; left: 180px; }
.mascot-lilac { background: #eadfff; right: 10px; }
.mascot-tall {
    width: 68px;
    height: 136px;
    border-radius: 24px;
}
.mascot-dome {
    width: 76px;
    height: 96px;
    border-radius: 44px 44px 22px 22px;
}
.mascot-wide {
    width: 96px;
    height: 76px;
    border-radius: 24px;
}
.eye {
    position: absolute;
    top: 34%;
    width: 9px;
    height: 9px;
    background: #111;
    border-radius: 50%;
    transform: translate(var(--look-x), var(--look-y));
    transition: transform .12s ease, height .12s ease;
}
.mascot-ink .eye { background: #fff; }
.eye.left { left: 28%; }
.eye.right { right: 28%; }
.eye.blink,
.mascot-squad[data-mood="typing"] .eye {
    height: 2px;
    border-radius: 999px;
}
.mascot i {
    position: absolute;
    left: 50%;
    bottom: 25%;
    width: 18px;
    height: 6px;
    border-bottom: 2px solid currentColor;
    border-radius: 50%;
    transform: translateX(-50%);
    color: rgba(17, 17, 17, .52);
}
.mascot-ink i { color: rgba(255,255,255,.65); }
.mascot-squad[data-mood="searching"] .mascot-blue,
.mascot-squad[data-mood="excited"] .mascot-lilac {
    transform: translateY(-10px) rotate(-3deg) !important;
}
.mascot-desk {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 26px;
    height: 18px;
    background: #f0f1f4;
    border-radius: 999px;
}
.mascot-desk span {
    position: absolute;
    top: -8px;
    width: 34px;
    height: 8px;
    border-radius: 999px;
    background: #e1e4ea;
}
.mascot-desk span:nth-child(1) { left: 34px; }
.mascot-desk span:nth-child(2) { left: 50%; transform: translateX(-50%); }
.mascot-desk span:nth-child(3) { right: 42px; }

.button,
button {
    min-height: 38px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    padding: 9px 15px;
    border-radius: 999px;
    font-weight: 800;
}
.button.primary,
button.primary,
.button.dark,
a.button.dark,
.hero-search button {
    background: var(--black);
    border-color: var(--black);
    color: #fff;
}
button:disabled { opacity: .55; cursor: not-allowed; }

.tabs {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 6px auto 38px;
    border-bottom: 1px solid var(--line);
}
.tabs a {
    color: var(--muted);
    padding: 0 2px 14px;
    border-bottom: 2px solid transparent;
    font-weight: 800;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }

.section-head,
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 32px 0 18px;
}
.section-head h2,
.page-head h1 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 32px;
    line-height: 1.18;
}
.section-head a { color: var(--ink); font-weight: 800; }

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.skill-card {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
}
.skill-card:hover { border-color: #d6d8de; }
.skill-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.skill-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--blue);
    color: #283343;
    font-size: 20px;
    font-weight: 900;
}
.skill-card:nth-child(4n+2) .skill-icon { background: var(--aqua); }
.skill-card:nth-child(4n+3) .skill-icon { background: var(--peach); }
.skill-card:nth-child(4n+4) .skill-icon { background: var(--lilac); }
.skill-card h2 {
    margin: 18px 0 8px;
    color: var(--ink);
    font-size: 21px;
    line-height: 1.34;
}
.skill-card p {
    margin: 14px 0 0;
    color: #727882;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}
.key-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: var(--peach);
    color: var(--warn);
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.badge {
    background: var(--surface-soft);
    color: #565c65;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.community-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 28px 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
}
.community-strip h2 { margin: 6px 0 8px; color: var(--ink); font-size: 26px; }
.community-strip p { margin: 0; color: var(--muted); line-height: 1.7; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.bind-code {
    width: fit-content;
    margin: 16px 0 8px;
    padding: 14px 18px;
    border: 1px dashed #c8ccd4;
    border-radius: 16px;
    background: #fbfbfb;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: .12em;
}

.search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 8px;
    width: min(520px, 100%);
}
input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    padding: 12px 14px;
    outline: none;
}
input:focus,
textarea:focus,
select:focus { border-color: #c9ccd3; }

.panel,
.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
}
.panel { padding: 24px; margin-bottom: 18px; }
.form { max-width: 660px; margin: 42px auto; }
.form label {
    display: grid;
    gap: 8px;
    margin: 15px 0;
    color: var(--ink);
    font-weight: 800;
}
.inline { display: inline; }
.alert {
    margin: 18px 0;
    padding: 13px 16px;
    border-radius: 16px;
    font-weight: 700;
}
.alert.success { background: #eef4ff; color: #1f3a8a; }
.alert.error { background: #fff2e9; color: var(--danger); }

table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
small { color: var(--muted); }
.empty {
    background: var(--surface);
    border: 1px dashed #dcdfe5;
    border-radius: 22px;
    color: var(--muted);
    padding: 28px;
}
code {
    background: var(--surface-soft);
    color: #4b5563;
    border-radius: 6px;
    padding: 2px 6px;
}
.content,
.command,
.log-context {
    background: #fbfbfb;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #333;
    overflow: auto;
    padding: 16px;
}
.log-context {
    max-width: 420px;
    max-height: 160px;
    white-space: pre-wrap;
    font-size: 12px;
}

.feed { display: grid; gap: 14px; }
.post-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    align-items: center;
    gap: 18px;
    padding: 20px;
}
.post-card h2 {
    margin: 8px 0;
    color: var(--ink);
    font-size: 21px;
}
.post-card p { color: #727882; line-height: 1.7; }
.post-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.post-detail h1 {
    margin: 12px 0 18px;
    color: var(--ink);
    font-size: clamp(30px, 4vw, 50px);
}
.post-image {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 18px;
    margin: 12px 0 20px;
}
.post-content { color: #30343a; font-size: 17px; line-height: 1.9; }
.comment {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}
.comment span {
    color: var(--muted);
    font-size: 13px;
    margin-left: 8px;
}
.comment-form { display: grid; gap: 10px; margin-top: 16px; }
.muted { color: var(--muted); }
.text-link { color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.skill-page { padding-top: 32px; }
.skill-hero {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin-bottom: 24px;
}
.detail-icon {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    font-size: 30px;
}
.skill-hero h1 {
    margin: 6px 0 10px;
    color: var(--ink);
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1.05;
}
.skill-hero p {
    max-width: 880px;
    color: #68707a;
    font-size: 17px;
    line-height: 1.75;
}
.detail-meta { margin-top: 14px; }
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}
.detail-side {
    display: grid;
    gap: 14px;
    grid-column: 2;
    grid-row: 1;
}
.detail-main {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}
.detail-side .panel { margin-bottom: 0; }
.detail-side h2,
.detail-main h2 {
    margin: 0 0 12px;
    color: var(--ink);
}
.install-type {
    width: fit-content;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.audit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.audit-row:last-of-type { border-bottom: 0; }
.audit-row span { color: var(--muted); }
.audit-row strong {
    background: #f1f5f9;
    border-radius: 999px;
    color: var(--ink);
    padding: 4px 9px;
    font-size: 12px;
}
.detail-tabs {
    display: flex;
    gap: 26px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.detail-tabs a {
    color: var(--muted);
    font-weight: 900;
    padding: 0 0 12px;
    border-bottom: 2px solid transparent;
}
.detail-tabs a.active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.panel-head h2 { margin: 4px 0 0; }
.skill-md {
    max-height: none;
    white-space: pre-wrap;
    line-height: 1.72;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.locked-content {
    max-height: 420px;
    overflow: hidden;
    position: relative;
}
.version-list { display: grid; gap: 12px; }
.version-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.version-item strong { color: var(--ink); }
.version-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}
.version-item p {
    margin: 10px 0 0;
    color: #68707a;
    line-height: 1.7;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.admin-body {
    background: #f4f5f7;
}
.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px 18px;
    background: #fff;
    border-right: 1px solid var(--line);
}
.admin-logo {
    color: var(--ink);
    font-size: 22px;
    font-weight: 900;
    padding: 0 12px 10px;
}
.admin-menu {
    display: grid;
    gap: 6px;
}
.admin-menu a {
    color: #616873;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
}
.admin-menu a:hover,
.admin-menu a.active {
    background: #f0f1f4;
    color: var(--ink);
}
.admin-sidebar-foot {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}
.admin-sidebar-foot a,
.admin-sidebar-foot button {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 0;
    font-weight: 800;
}
.admin-main {
    min-width: 0;
    padding: 28px;
}
.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.admin-top p {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.admin-top h1 {
    margin: 0;
    color: var(--ink);
    font-size: 30px;
}
.admin-top span {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    color: #555b64;
    font-weight: 800;
}
.admin-main .panel {
    border-radius: 18px;
}
.admin-main .tabs {
    justify-content: flex-start;
    gap: 22px;
    margin: 0;
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.stats div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
}
.stats strong {
    display: block;
    color: var(--ink);
    font-size: 38px;
    line-height: 1;
}
.stats span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 800;
}
.row-actions,
.crawler-actions,
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bulk-bar {
    align-items: center;
    margin: 16px 0;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
}
.bulk-bar span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    margin-right: auto;
}
.row-actions button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}
.crawler-actions { margin-top: 18px; }
.admin-settings-form {
    margin: 0;
    max-width: 760px;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        min-height: auto;
    }
    .mascot-card { min-height: 250px; }
    .mascot-squad {
        left: 18px;
        right: 18px;
        bottom: 48px;
        transform: scale(.86);
        transform-origin: center bottom;
    }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .topbar {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }
    .topbar nav {
        width: 100%;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .topbar nav::-webkit-scrollbar { display: none; }
    .topbar nav a,
    .inline button {
        white-space: nowrap;
        padding: 8px 11px;
        font-size: 13px;
    }
    .container { width: min(100% - 20px, 1160px); }
    .hero {
        min-height: auto;
        padding: 34px 0 20px;
        text-align: left;
        place-items: stretch;
    }
    .hero h1 {
        max-width: 100%;
        font-size: clamp(34px, 11vw, 42px);
        line-height: 1.12;
    }
    .hero p { margin-left: 0; }
    .hero-search {
        grid-template-columns: 1fr;
        border-radius: 20px;
        padding: 8px;
    }
    .hero-search input { padding: 10px 12px; }
    .hero-search button { width: 100%; }
    .mascot-card {
        min-height: 220px;
        border-radius: 22px;
        padding: 18px;
    }
    .mascot-bubble {
        margin-left: 0;
        font-size: 12px;
    }
    .mascot-squad {
        left: 8px;
        right: 8px;
        bottom: 42px;
        transform: scale(.72);
    }
    .mascot-desk {
        left: 18px;
        right: 18px;
        bottom: 20px;
    }
    .tabs { justify-content: flex-start; overflow-x: auto; }
    .grid { grid-template-columns: 1fr; }
    .section-head,
    .page-head,
    .community-strip {
        align-items: flex-start;
        flex-direction: column;
    }
    .profile-grid { grid-template-columns: 1fr; }
    .search { grid-template-columns: 1fr; width: 100%; }
    .post-card { grid-template-columns: 1fr; }
    .skill-hero { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side,
    .detail-main {
        grid-column: auto;
        grid-row: auto;
    }
    table { display: block; overflow-x: auto; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .admin-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-main { padding: 18px; }
    .stats { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
    .container { width: min(100% - 14px, 1160px); }
    .hero h1 { font-size: 32px; }
    .skill-card,
    .panel,
    .post-card { border-radius: 18px; padding: 18px; }
    .mascot-card { min-height: 198px; }
    .mascot-squad {
        left: -20px;
        right: -20px;
        transform: scale(.62);
    }
    .admin-menu { grid-template-columns: 1fr; }
}
