:root {
    --bg: #F7F4FF;
    --bg-2: #FFFFFF;
    --tint: #EEF2FF;
    --card: #FFFFFF;
    --title: #1B1340;
    --text: #2F2A4A;
    --muted: #5B5678;
    --soft: #8B86A3;
    --violet: #7C3AED;
    --lilac: #A78BFA;
    --teal: #14B8A6;
    --coral: #F97316;
    --rose: #E11D48;
    --amber: #F59E0B;
    --indigo: #312E81;
    --line: rgba(124, 58, 237, 0.14);
    --shadow: 0 16px 40px rgba(49, 46, 129, 0.10);
    --footer: #1B1340;
    --footer-text: #F4F0FF;
    --radius: 22px;
    --max: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

body.is-locked {
    overflow: hidden;
}

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

a {
    color: var(--violet);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--lilac);
    outline-offset: 3px;
}

h1, h2, h3, h4 {
    color: var(--title);
    line-height: 1.3;
    margin: 0 0 0.6em;
}

p {
    margin: 0 0 1em;
}

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

.skip-link {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--violet);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    z-index: 80;
}

.skip-link:focus {
    top: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Brand bar */
.brandbar {
    position: sticky;
    top: 10px;
    z-index: 40;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
}

.brandbar-inner {
    pointer-events: auto;
    width: 100%;
    max-width: 1080px;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.icon-btn {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    background: var(--tint);
    color: var(--title);
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-dots,
.icon-search {
    width: 16px;
    height: 16px;
    display: block;
    position: relative;
}

.icon-dots::before {
    content: "";
    position: absolute;
    inset: 2px;
    background:
        radial-gradient(circle at 50% 20%, var(--violet) 2px, transparent 2.5px),
        radial-gradient(circle at 50% 50%, var(--violet) 2px, transparent 2.5px),
        radial-gradient(circle at 50% 80%, var(--violet) 2px, transparent 2.5px);
}

.icon-search::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--violet);
    border-radius: 50%;
    left: 1px;
    top: 1px;
}

.icon-search::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: var(--violet);
    right: -1px;
    bottom: 2px;
    transform: rotate(45deg);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 auto;
}

.mark-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.mark-text {
    font-weight: 800;
    color: var(--title);
    letter-spacing: 0.04em;
}

.capsule-group {
    display: flex;
    gap: 6px;
    flex: 1;
}

.capsule-right {
    justify-content: flex-end;
}

.capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--text);
    font-size: 14px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.capsule:hover {
    background: var(--tint);
    text-decoration: none;
}

.capsule.is-active {
    border-color: var(--violet);
    color: var(--violet);
    background: #F5F3FF;
}

.capsule-app {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #14B8A6 100%);
    color: #fff;
}

.capsule-app:hover,
.capsule-app.is-active {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.05);
}

.mobile-app-link {
    display: none;
    text-decoration: none;
    font-size: 13px;
    color: var(--title);
}

main {
    width: min(var(--max), calc(100% - 32px));
    margin: 28px auto 120px;
}

.page-hero,
.section,
.card,
.article-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

.kicker {
    color: var(--violet);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.lead {
    font-size: 18px;
    color: var(--muted);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #14B8A6 100%);
    color: #fff;
}

.btn-ghost {
    background: var(--tint);
    color: var(--title);
    border: 1px solid var(--line);
}

.btn:hover {
    text-decoration: none;
    filter: brightness(1.04);
}

.img-frame,
.img-slot {
    border-radius: 20px;
    overflow: hidden;
    background: var(--tint);
    min-height: 180px;
}

.img-frame img,
.img-slot {
    width: 100%;
    object-fit: cover;
}

.dock {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: center;
}

.tag-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.tag-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
}

.tag-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.tag-card p {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.dot-violet { background: var(--violet); }
.dot-teal { background: var(--teal); }
.dot-coral { background: var(--coral); }
.dot-rose { background: var(--rose); }

.pulse-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

.num-list a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--title);
    font-weight: 700;
}

.num-list a:hover { text-decoration: none; color: var(--violet); }

.mosaic {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.mosaic article:first-child {
    grid-row: span 2;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.board-grid article:nth-child(1),
.board-grid article:nth-child(4) {
    min-height: 220px;
}

.folder-list a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    color: var(--title);
}

.folder-list small {
    color: var(--soft);
}

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

.score-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px 20px;
}

.score-num {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
}

.c1 { color: var(--violet); }
.c2 { color: var(--teal); }
.c3 { color: var(--coral); }
.c4 { color: var(--rose); }
.c5 { color: var(--amber); }

.timeline {
    border-left: 3px solid var(--line);
    margin-left: 12px;
    padding-left: 22px;
}

.timeline li {
    position: relative;
    margin-bottom: 22px;
}

.timeline li::before {
    content: "";
    width: 14px;
    height: 14px;
    background: var(--violet);
    border-radius: 50%;
    position: absolute;
    left: -30px;
    top: 8px;
}

.status {
    display: inline-block;
    min-height: 32px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--indigo);
    font-size: 13px;
}

.app-stage {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: center;
}

.badge-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.badge-row img {
    width: 56px;
    height: 56px;
}

.type-index,
.ep-nav,
.reel-index,
.job-grid,
.discover-grid,
.clause,
.qa {
    display: grid;
    gap: 14px;
}

.type-index,
.job-grid,
.discover-grid {
    grid-template-columns: repeat(3, 1fr);
}

.ep-nav {
    grid-template-columns: repeat(3, 1fr);
}

.chip {
    display: block;
    background: var(--tint);
    border-radius: 18px;
    padding: 16px;
    color: var(--title);
}

.chip:hover { text-decoration: none; }

.qa article,
.clause article,
.note-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px 20px;
}

.media-wide {
    margin-bottom: 18px;
}

/* Footer */
.site-footer {
    background: var(--footer);
    color: var(--footer-text);
    padding: 48px 16px 120px;
}

.footer-inner {
    width: min(var(--max), 100%);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.footer-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.footer-name {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
}

.footer-en {
    margin: 0;
    color: #C4B5FD;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.site-footer h2 {
    color: #fff;
    font-size: 15px;
}

.site-footer a {
    color: #EDE9FE;
    display: inline-block;
    min-height: 32px;
}

.footer-note,
.footer-copy {
    color: #C4B5FD;
    margin-top: 24px;
}

/* Drawer from bottom */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 19, 64, 0.35);
    z-index: 50;
    pointer-events: none;
}

.overlay.is-on {
    pointer-events: auto;
}

.overlay[hidden],
.drawer[hidden],
.search-layer[hidden] {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
}

.drawer,
.search-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.drawer-panel {
    width: min(720px, 100%);
    max-height: 78vh;
    overflow: auto;
    background: #fff;
    border-radius: 28px 28px 0 0;
    box-shadow: var(--shadow);
    padding: 16px 18px 28px;
}

.drawer-head,
.search-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-body section {
    margin-bottom: 18px;
}

.drawer-body a {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--title);
    min-height: 44px;
}

.drawer-body small {
    color: var(--muted);
}

.search-layer {
    align-items: flex-start;
    padding-top: 88px;
}

.search-card {
    width: min(720px, calc(100% - 24px));
    background: #fff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.search-field input {
    width: 100%;
    min-height: 48px;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0 18px;
    font-size: 16px;
    background: var(--tint);
    color: var(--title);
}

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

.search-presets a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--title);
}

/* Island nav mobile */
.island-nav {
    display: none;
}

@media (max-width: 980px) {
    .capsule-group {
        display: none;
    }
    .mobile-app-link {
        display: inline-flex;
        margin-left: auto;
    }
    .dock,
    .pulse-grid,
    .mosaic,
    .split,
    .app-stage,
    .type-index,
    .job-grid,
    .discover-grid,
    .ep-nav,
    .board-grid,
    .tag-track,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .mosaic article:first-child {
        grid-row: auto;
    }
    .search-layer {
        padding-top: 0;
        align-items: stretch;
    }
    .search-card {
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        background: #F7F4FF;
    }
    .island-nav {
        display: flex;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: min(520px, calc(100% - 32px));
        height: 52px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--line);
        border-radius: 999px;
        box-shadow: var(--shadow);
        z-index: 35;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
    }
    .island-item {
        color: var(--muted);
        font-size: 13px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    .island-item.is-active {
        color: var(--violet);
        font-weight: 700;
        text-decoration: none;
    }
    .island-item.is-active::after {
        content: "";
        width: 6px;
        height: 6px;
        background: var(--violet);
        border-radius: 50%;
        position: absolute;
        bottom: 6px;
    }
    main {
        margin-bottom: 140px;
    }
}

@media (max-width: 640px) {
    .page-hero, .section, .card, .article-block {
        padding: 20px 16px;
    }
    h1 { font-size: 28px; }
    .score-item { grid-template-columns: 64px 1fr; }
    .score-num { font-size: 32px; }
}
