/* ---------- Design tokens ---------- */
:root {
    --bg: #f4f6fb;
    --bg-soft: #eaeefa;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-2: rgba(255, 255, 255, 0.55);
    --surface-solid: #ffffff;
    --text: #0d1425;
    --text-2: #47536b;
    --text-3: #7b879c;
    --line: rgba(13, 20, 37, 0.09);
    --line-strong: rgba(13, 20, 37, 0.16);
    --brand: #4f46e5;
    --brand-2: #06b6d4;
    --brand-soft: rgba(79, 70, 229, 0.10);
    --shadow-sm: 0 1px 2px rgba(13, 20, 37, 0.05), 0 10px 26px -18px rgba(13, 20, 37, 0.35);
    --shadow-md: 0 24px 50px -30px rgba(13, 20, 37, 0.42);
    --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
    --bg: #05070d;
    --bg-soft: #0a0f1b;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.03);
    --surface-solid: #0f1524;
    --text: #e9edf9;
    --text-2: #a9b4cb;
    --text-3: #7d89a0;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --brand: #818cf8;
    --brand-2: #22d3ee;
    --brand-soft: rgba(129, 140, 248, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 30px -20px rgba(0, 0, 0, 0.9);
    --shadow-md: 0 30px 60px -32px rgba(0, 0, 0, 0.95);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, p, dl, dd, figure {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

input, select, textarea {
    font: inherit;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    background: var(--brand-soft);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 8px;
}

.icon {
    width: 18px;
    height: 18px;
    display: block;
    flex: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Scrollbar ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Blazor error ui ---------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 100;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #111827;
    color: #e9edf9;
    font-size: 13.5px;
    box-shadow: var(--shadow-md);
}

#blazor-error-ui .reload {
    color: #a5b4fc;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    opacity: 0.6;
}

/* ---------- Import button: hide the native file input, icon only ---------- */
.import-btn input[type="file"] {
    display: none;
}

.import-btn {
    cursor: pointer;
}

/* ---------- Info pages ---------- */
.info-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.info-card {
    width: min(420px, 100%);
    padding: 36px 32px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.info-code {
    display: block;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(140deg, #6366f1, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.info-card h1 {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 650;
}

.info-card p {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--text-2);
}

.info-meta {
    font-size: 12px;
    color: var(--text-3);
    word-break: break-all;
}

.info-link {
    display: inline-flex;
    align-items: center;
    margin-top: 20px;
    height: 40px;
    padding: 0 18px;
    border-radius: 11px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    background: linear-gradient(140deg, #6366f1, #7c3aed);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
