:root {
    --bg: #080808;
    --surface: #111111;
    --surface-2: #171717;
    --line: #343434;
    --line-soft: #222222;
    --text: #f1f0eb;
    --muted: #969692;
    --accent: #d7ff3f;
    --accent-dark: #121500;
    --white: #ffffff;
    --max-width: 1440px;
    --pad: clamp(20px, 4vw, 64px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background: var(--bg);
    font-family: "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.noise {
    position: fixed;
    z-index: 20;
    inset: 0;
    opacity: 0.025;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
    width: min(100%, var(--max-width));
    margin-inline: auto;
}

.site-header {
    min-height: 74px;
    padding: 14px var(--pad);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border: 1px solid var(--text);
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 900;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(215, 255, 63, 0.55);
}

.edition {
    margin-left: 22px;
    color: var(--text);
}

.intro {
    padding: 54px var(--pad) 62px;
    border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-number {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
}

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    align-items: end;
    gap: clamp(36px, 8vw, 120px);
    margin-top: 56px;
}

h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(46px, 6.8vw, 104px);
    line-height: 0.96;
    font-weight: 700;
    letter-spacing: 0;
}

.intro-copy > p {
    margin: 0;
    color: #c6c6c1;
    font-size: 14px;
    line-height: 1.75;
}

.intro-index {
    margin-top: 36px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    color: var(--muted);
    font-size: 11px;
}

.workspace,
.results {
    padding: 58px var(--pad) 80px;
}

.workspace-heading,
.results-header {
    margin-bottom: 26px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.workspace-heading h2,
.results-header h2 {
    margin: 8px 0 0;
    font-size: 29px;
    line-height: 1.1;
    font-weight: 600;
}

.workspace-heading > p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.55fr);
    min-height: 540px;
    border: 1px solid var(--line);
}

.upload-panel {
    position: relative;
    min-height: 540px;
    border-right: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
    background-color: #0c0c0c;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 40px 40px;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.upload-panel.is-dragging {
    background-color: #15170b;
    box-shadow: inset 0 0 0 1px var(--accent);
}

.upload-empty {
    width: 100%;
    padding: 54px 24px;
    text-align: center;
}

.upload-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 32px;
    border: 1px solid var(--line);
    background: var(--bg);
    display: grid;
    place-items: center;
}

.upload-icon svg {
    width: 25px;
    height: 25px;
}

.upload-title {
    margin: 0;
    font-size: 25px;
    font-weight: 600;
}

.upload-hint {
    margin: 9px 0 26px;
    color: var(--muted);
    font-size: 12px;
}

.button {
    min-height: 45px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.button-light {
    color: var(--bg);
    background: var(--text);
}

.button-light:hover {
    background: var(--accent);
}

.button-accent {
    width: 100%;
    color: var(--accent-dark);
    background: var(--accent);
}

.button-accent:hover:not(:disabled) {
    color: var(--bg);
    background: var(--white);
}

.button svg {
    width: 18px;
    height: 18px;
}

.button-outline {
    background: transparent;
    border-color: var(--line);
}

.button-outline:hover {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
}

.preview-wrap {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #050505;
}

.preview-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(8, 8, 8, 0.92);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.analysis-brief {
    padding: 34px 28px 28px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brief-label {
    color: var(--muted);
    font-size: 10px;
}

.analysis-brief strong {
    display: block;
    margin-top: 16px;
    font-size: clamp(25px, 2.4vw, 35px);
    line-height: 1.15;
    font-weight: 500;
}

.analysis-brief ol {
    margin: 42px 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.analysis-brief li {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    color: #d0d0ca;
    font-size: 12px;
}

.analysis-brief li span {
    color: var(--accent);
    font-size: 10px;
}

.message {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #784343;
    color: #ffb4aa;
    background: #201010;
    font-size: 12px;
    line-height: 1.6;
}

.loading-section {
    min-height: 240px;
    margin: 0 var(--pad);
    padding: 44px;
    border: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) 1fr;
    align-items: end;
    gap: 40px;
    background: var(--surface);
}

.loading-index {
    color: var(--accent);
    font-size: clamp(55px, 8vw, 110px);
    line-height: 0.75;
    font-weight: 300;
}

.loading-index span {
    font-variant-numeric: tabular-nums;
}

.loading-copy p {
    margin: 0 0 18px;
    font-size: 14px;
}

.loading-track {
    height: 2px;
    background: var(--line);
    overflow: hidden;
}

.loading-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 450ms ease;
}

.results {
    padding-top: 100px;
}

.results-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.result-module {
    border-bottom: 1px solid var(--line);
}

.module-header {
    min-height: 145px;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 24px;
}

.module-index {
    color: var(--accent);
    font-size: 48px;
    line-height: 1;
    font-weight: 300;
}

.module-header p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 10px;
}

.module-header h3 {
    margin: 0;
    font-size: clamp(25px, 3vw, 39px);
    line-height: 1.1;
    font-weight: 500;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.result-item {
    position: relative;
    min-height: 245px;
    padding: 28px 64px 30px 28px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.result-item-wide {
    grid-column: 1 / -1;
    min-height: 205px;
}

.item-number {
    color: var(--accent);
    font-size: 10px;
}

.result-item h4 {
    margin: 22px 0 12px;
    font-size: 15px;
    font-weight: 600;
}

.result-item p {
    max-width: 1100px;
    margin: 0;
    color: #b8b8b4;
    font-size: 13px;
    line-height: 1.85;
    white-space: pre-wrap;
}

.copy-item {
    position: absolute;
    top: 24px;
    right: 22px;
    padding: 2px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
}

.copy-item:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.toast {
    position: fixed;
    z-index: 50;
    right: 24px;
    bottom: 24px;
    padding: 13px 18px;
    color: var(--accent-dark);
    background: var(--accent);
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

footer {
    min-height: 100px;
    padding: 26px var(--pad);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 9px;
}

@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: 1fr;
        align-items: start;
        margin-top: 40px;
    }

    .intro-copy {
        max-width: 600px;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .upload-panel {
        min-height: 500px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .analysis-brief {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .site-header {
        min-height: 64px;
    }

    .header-meta > span:not(.status-dot) {
        display: none;
    }

    .intro {
        padding-top: 40px;
        padding-bottom: 44px;
    }

    h1 {
        font-size: 43px;
        line-height: 1.01;
    }

    .workspace,
    .results {
        padding-top: 42px;
        padding-bottom: 56px;
    }

    .workspace-heading,
    .results-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .copy-all {
        width: 100%;
    }

    .upload-panel {
        min-height: 390px;
    }

    .analysis-brief {
        min-height: 360px;
        padding: 28px 22px 22px;
    }

    .loading-section {
        min-height: 220px;
        padding: 30px 22px;
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .module-header {
        min-height: 125px;
        grid-template-columns: 64px 1fr auto;
        gap: 14px;
    }

    .module-index {
        font-size: 34px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .result-item,
    .result-item-wide {
        grid-column: auto;
        min-height: 220px;
        padding: 24px 52px 26px 22px;
    }

    .result-item p {
        font-size: 12px;
    }

    footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}