:root {
    color-scheme: light;
    --blue: #2f80ed;
    --blue-dark: #246ed3;
    --text: #202124;
    --muted: #8a8f98;
    --surface: #ffffff;
    --field: #f8f9fb;
    --border: #edf0f4;
    --success: #14804a;
    --success-bg: #edf9f2;
    --error: #c83532;
    --error-bg: #fff1f0;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.95), rgba(247, 248, 250, 0.55) 34%, transparent 62%),
        #f4f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.page-shell {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 72px 24px 56px;
}

.hero {
    text-align: center;
    margin-bottom: 34px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(32px, 6vw, 46px);
    line-height: 1.18;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.hero p {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.sign-card {
    padding: 38px 42px 30px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(229, 232, 237, 0.9);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(31, 42, 61, 0.09);
}

.sign-card h2 {
    margin: 0 0 22px;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
}

.upload-list {
    display: grid;
    gap: 15px;
}

.upload-item {
    position: relative;
}

.upload-item input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.file-picker {
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 10px 18px;
    color: #34383f;
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(31, 42, 61, 0.045);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.file-picker:hover {
    background: #f4f7fb;
    border-color: #d8e6f8;
    box-shadow: 0 8px 20px rgba(47, 128, 237, 0.08);
    transform: translateY(-1px);
}

.upload-item input[type="file"]:focus-visible + .file-picker {
    outline: 3px solid rgba(47, 128, 237, 0.2);
    outline-offset: 2px;
}

.file-picker.selected {
    color: #1e65bf;
    background: #f4f8fe;
    border-color: #bdd7fa;
}

.plus {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-right: 17px;
    color: #fff;
    background: linear-gradient(145deg, #3f92f6, #2674da);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    font-weight: 300;
    box-shadow: 0 4px 10px rgba(47, 128, 237, 0.25);
}

.file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.submit-button {
    display: block;
    width: min(100%, 230px);
    min-height: 56px;
    margin: 34px auto 0;
    padding: 12px 28px;
    color: #fff;
    background: linear-gradient(180deg, #398cf1, var(--blue));
    border: 0;
    border-radius: 28px;
    box-shadow: 0 8px 18px rgba(47, 128, 237, 0.28);
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.submit-button:hover {
    background: linear-gradient(180deg, #3484e6, var(--blue-dark));
    box-shadow: 0 10px 22px rgba(47, 128, 237, 0.34);
    transform: translateY(-1px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.message {
    margin: 0 0 24px;
    padding: 15px 17px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
}

.message.success {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #ccebd9;
}

.message.success strong,
.message.success span {
    display: block;
}

.message.error {
    color: var(--error);
    background: var(--error-bg);
    border: 1px solid #ffd2cf;
}

.download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.download-actions a {
    color: #fff;
    background: var(--blue);
    border-radius: 7px;
    padding: 7px 13px;
    text-decoration: none;
    font-weight: 600;
}

.progress {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    color: #65707e;
    font-size: 14px;
}

.progress.visible {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cfe0f7;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.privacy-note {
    margin: 22px 0 0;
    color: #a0a5ad;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}

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

@media (max-width: 640px) {
    .page-shell {
        padding: 44px 16px 32px;
    }

    .hero {
        margin-bottom: 26px;
    }

    .hero h1 {
        font-size: 30px;
        letter-spacing: 0.04em;
    }

    .hero p {
        margin-top: 12px;
        font-size: 15px;
    }

    .sign-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .file-picker {
        min-height: 60px;
        padding: 9px 14px;
    }

    .plus {
        width: 32px;
        height: 32px;
        margin-right: 13px;
    }

    .file-name {
        font-size: 14px;
    }
}

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