:root {
    --bg-void: #070a14;
    --bg-sky: #0d1224;
    --bg-panel: rgba(19, 25, 46, 0.72);
    --bg-panel-strong: rgba(23, 30, 56, 0.9);
    --bg-elevated: rgba(31, 41, 74, 0.76);
    --bg-hover: rgba(122, 162, 255, 0.11);

    --border-subtle: rgba(154, 178, 255, 0.15);
    --border-glow: rgba(138, 168, 255, 0.36);

    --accent-star: #7aa2ff;
    --accent-star-hover: #94b6ff;
    --accent-violet: #a78bfa;
    --accent-cyan: #67e8f9;

    --text-main: #eef2ff;
    --text-soft: #c7d2fe;
    --text-muted: #93a1c6;
    --text-dim: #667399;

    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.14);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);

    --shadow-card: 0 18px 42px rgba(3, 6, 18, 0.48);
    --shadow-glow: 0 0 28px rgba(122, 162, 255, 0.18);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(circle at 20% 0%, #151c38 0%, var(--bg-sky) 46%, var(--bg-void) 100%);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* 星夜背景與星塵點綴 */
.sky-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.starfield {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
}

.starfield-sm {
    background-image:
        radial-gradient(1px 1px at 18px 28px, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 94px 72px, rgba(167, 139, 250, 0.45), transparent),
        radial-gradient(1px 1px at 142px 136px, rgba(122, 162, 255, 0.5), transparent),
        radial-gradient(1px 1px at 210px 44px, rgba(255, 255, 255, 0.4), transparent);
    background-size: 240px 180px;
    opacity: 0.65;
}

.starfield-lg {
    background-image:
        radial-gradient(1.6px 1.6px at 60px 90px, rgba(238, 242, 255, 0.72), transparent),
        radial-gradient(1.5px 1.5px at 200px 190px, rgba(122, 162, 255, 0.65), transparent),
        radial-gradient(1.8px 1.8px at 310px 65px, rgba(167, 139, 250, 0.55), transparent);
    background-size: 360px 260px;
    animation: starTwinkle 7s ease-in-out infinite alternate;
}

.nebula-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(88px);
    opacity: 0.24;
}

.nebula-orb-1 {
    width: 440px;
    height: 440px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, var(--accent-violet), transparent 70%);
}

.nebula-orb-2 {
    width: 500px;
    height: 500px;
    bottom: -180px;
    left: -120px;
    background: radial-gradient(circle, var(--accent-star), transparent 70%);
}

@keyframes starTwinkle {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 0.85;
    }
}

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

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .starfield-lg,
    .spinner,
    .fade-in {
        animation: none !important;
    }
    * {
        transition: none !important;
    }
}

/* 捲軸美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(8, 11, 20, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 174, 255, 0.22);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 174, 255, 0.4);
}
