/*
 * Vivo Note Export - tool UI styles.
 */

:root {
    color-scheme: light dark;
    --bg: #f3f1ef;
    --bg-soft: #faf9f8;
    --card: rgba(255, 255, 255, 0.92);
    --card-solid: #ffffff;
    --text: #202024;
    --text-soft: #62626a;
    --muted: #8b8b93;
    --border: #e7e3e2;
    --border-strong: #d9d3d1;
    --accent: #e05563;
    --accent-dark: #c83f4d;
    --accent-soft: #fbecee;
    --green: #2f9e6b;
    --green-soft: #e9f7f0;
    --warning-bg: #fff7e4;
    --warning-border: #f0dfb4;
    --warning-text: #7a5b16;
    --shadow: 0 24px 70px rgba(50, 35, 35, 0.10), 0 3px 10px rgba(50, 35, 35, 0.04);
    --shadow-soft: 0 8px 28px rgba(50, 35, 35, 0.07);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --bg-soft: #171719;
        --card: rgba(30, 30, 34, 0.92);
        --card-solid: #1e1e22;
        --text: #f0f0f3;
        --text-soft: #b4b4bd;
        --muted: #8f8f99;
        --border: #333338;
        --border-strong: #424248;
        --accent: #f06b78;
        --accent-dark: #ff8792;
        --accent-soft: #3a2227;
        --green: #61c696;
        --green-soft: #1d3329;
        --warning-bg: #332a16;
        --warning-border: #584923;
        --warning-text: #e8cf91;
        --shadow: 0 28px 80px rgba(0, 0, 0, 0.45), 0 3px 12px rgba(0, 0, 0, 0.25);
        --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.28);
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body.is-busy {
    cursor: progress;
}

[hidden] {
    display: none !important;
}

button,
input {
    font: inherit;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
    opacity: 0.6;
}

.ambient-one {
    top: -240px;
    right: -120px;
    background: radial-gradient(circle, rgba(224, 85, 99, 0.16) 0%, rgba(224, 85, 99, 0) 68%);
}

.ambient-two {
    bottom: -280px;
    left: -180px;
    background: radial-gradient(circle, rgba(112, 120, 210, 0.12) 0%, rgba(112, 120, 210, 0) 68%);
}

@media (prefers-color-scheme: dark) {
    .ambient-one {
        background: radial-gradient(circle, rgba(240, 107, 120, 0.12) 0%, rgba(240, 107, 120, 0) 68%);
    }

    .ambient-two {
        background: radial-gradient(circle, rgba(104, 116, 220, 0.12) 0%, rgba(104, 116, 220, 0) 68%);
    }
}

.site-header {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 42px 24px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    box-shadow: 0 8px 20px rgba(224, 85, 99, 0.18);
}

.brand-text {
    min-width: 0;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.brand-text p {
    margin: 2px 0 0;
    color: var(--text-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.header-note {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--card);
    font-size: 0.78rem;
    white-space: nowrap;
}

.shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 48px;
    flex: 1 0 auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.upload-card {
    padding: 24px;
}

.drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 330px;
    padding: 42px 24px;
    border: 2px dashed var(--border-strong);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)),
        var(--bg-soft);
    text-align: center;
    cursor: pointer;
    outline: none;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

@media (prefers-color-scheme: dark) {
    .drop-zone {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
            var(--bg-soft);
    }
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragging {
    border-color: var(--accent);
    background-color: var(--accent-soft);
}

.drop-zone.is-dragging {
    transform: scale(1.004);
}

.drop-zone[aria-busy="true"] {
    cursor: progress;
    opacity: 0.72;
}

.drop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    margin-bottom: 19px;
    border-radius: 26px;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(224, 85, 99, 0.10);
}

.drop-icon img {
    width: 46px;
    height: 46px;
}

.drop-zone h2 {
    margin: 0;
    font-size: 1.32rem;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.drop-main {
    margin: 7px 0 0;
    color: var(--accent);
    font-size: 0.98rem;
    font-weight: 600;
}

.drop-hint {
    margin: 15px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.privacy-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.about-card {
    margin-top: 18px;
    padding: 25px;
}

.about-head h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    margin-top: 18px;
}

.about-item {
    padding: 16px 17px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
}

.about-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.about-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.about-item p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.75;
}

.status {
    margin-top: 15px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: 0.86rem;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.spinner {
    display: inline-block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(224, 85, 99, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: vn-spin 750ms linear infinite;
}

@keyframes vn-spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    margin-top: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(200, 63, 77, 0.28);
    border-radius: 11px;
    background: rgba(224, 85, 99, 0.08);
    color: var(--accent-dark);
    font-size: 0.86rem;
    line-height: 1.55;
    word-break: break-word;
}

.result-card {
    padding: 28px;
}

.result-head {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.result-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--green-soft);
}

.result-badge img {
    width: 26px;
    height: 26px;
}

.result-heading {
    min-width: 0;
}

.result-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.result-title {
    margin: 3px 0 0;
    color: var(--text-soft);
    font-size: 0.94rem;
    font-weight: 600;
    word-break: break-word;
}

.result-summary {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
    word-break: break-word;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.6;
    white-space: nowrap;
}

.stat-chip.is-muted {
    color: var(--muted);
}

.warnings {
    margin-top: 15px;
}

.warning-box {
    padding: 13px 15px;
    border: 1px solid var(--warning-border);
    border-radius: 12px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.8rem;
    line-height: 1.6;
}

.warning-title {
    margin-bottom: 3px;
    font-weight: 700;
}

.warning-box ul {
    margin: 0;
    padding-left: 1.25em;
}

.warning-box li {
    margin: 2px 0;
    word-break: break-word;
}

.preview-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 10px;
}

.preview-heading h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.preview-heading span {
    color: var(--muted);
    font-size: 0.76rem;
}

.preview-wrap {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--bg-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#preview {
    display: block;
    width: 100%;
    height: 560px;
    border: 0;
    background: #ffffff;
}

@media (prefers-color-scheme: dark) {
    #preview {
        background: #171719;
    }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.btn img {
    width: 18px;
    height: 18px;
}

.btn-primary img {
    filter: brightness(0) invert(1);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    cursor: progress;
    opacity: 0.65;
    transform: none;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(224, 85, 99, 0.22);
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: var(--card-solid);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    margin-left: auto;
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.download-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.6;
}

.site-footer {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 34px;
    color: var(--muted);
    font-size: 0.76rem;
    text-align: center;
    flex: 0 0 auto;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 640px) {
    .site-header {
        padding: 24px 16px 16px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .brand-text h1 {
        font-size: 1.12rem;
    }

    .brand-text p {
        font-size: 0.78rem;
    }

    .header-note {
        display: none;
    }

    .shell {
        padding: 0 12px 32px;
    }

    .upload-card,
    .result-card,
    .about-card {
        padding: 14px;
        border-radius: 19px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 14px;
    }

    .about-item {
        padding: 14px;
    }

    .drop-zone {
        min-height: 280px;
        padding: 30px 16px;
    }

    .drop-icon {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

    .drop-icon img {
        width: 40px;
        height: 40px;
    }

    .drop-zone h2 {
        font-size: 1.12rem;
    }

    .result-head {
        gap: 12px;
    }

    .result-badge {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .preview-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    #preview {
        height: 480px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .btn-ghost {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
