/* =========================================================
   基础设计系统 · 拟态毛玻璃（Neumorphism × Glassmorphism）
   纪念日 · 支持浅色 / 深色双主题
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
    /* 中性色 */
    --ink:        #1a2036;
    --ink-2:      #333c58;
    --ink-3:      #566080;
    --muted:      #7a83a0;
    --line:       rgba(255, 255, 255, .78);
    --line-soft:  rgba(126, 142, 178, .16);

    /* 品牌色 */
    --brand:      #6d5efc;
    --brand-2:    #a855f7;
    --brand-3:    #ff7a9c;
    --mint:       #14b8a6;
    --sky:        #38a8f5;
    --amber:      #f0a03a;
    --rose:       #ef5570;

    /* 玻璃层 */
    --glass:      rgba(255, 255, 255, .55);
    --glass-2:    rgba(255, 255, 255, .76);
    --glass-3:    rgba(255, 255, 255, .36);
    --stroke:     rgba(255, 255, 255, .9);

    /* 阴影 */
    --shadow-lg:  0 30px 70px rgba(64, 82, 128, .16), 0 4px 14px rgba(64, 82, 128, .06);
    --shadow-md:  0 18px 40px rgba(64, 82, 128, .12), 0 2px 8px rgba(64, 82, 128, .05);
    --shadow-sm:  0 10px 24px rgba(64, 82, 128, .09);
    --neu:        10px 10px 26px rgba(158, 173, 199, .42), -10px -10px 26px rgba(255, 255, 255, .95);
    --neu-sm:     6px 6px 15px rgba(158, 173, 199, .34), -6px -6px 15px rgba(255, 255, 255, .92);
    --neu-in:     inset 4px 4px 10px rgba(158, 173, 199, .4), inset -4px -4px 10px rgba(255, 255, 255, .95);

    /* 圆角 */
    --r-2xl: 34px;
    --r-xl:  28px;
    --r-lg:  22px;
    --r-md:  16px;
    --r-sm:  11px;

    /* 字体 */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --serif: "Georgia", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    --mono: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;

    --ease: cubic-bezier(.22, .8, .28, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="dark"] {
    --ink:        #f0f2ff;
    --ink-2:      #d6dbf2;
    --ink-3:      #a9b1cf;
    --muted:      #7c85a4;
    --line:       rgba(255, 255, 255, .12);
    --line-soft:  rgba(160, 175, 215, .16);

    --glass:      rgba(30, 35, 58, .55);
    --glass-2:    rgba(38, 44, 70, .72);
    --glass-3:    rgba(24, 29, 48, .38);
    --stroke:     rgba(255, 255, 255, .14);

    --shadow-lg:  0 30px 70px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .3);
    --shadow-md:  0 18px 40px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-sm:  0 10px 24px rgba(0, 0, 0, .3);
    --neu:        10px 10px 26px rgba(0, 0, 0, .45), -8px -8px 22px rgba(255, 255, 255, .035);
    --neu-sm:     6px 6px 15px rgba(0, 0, 0, .4), -5px -5px 14px rgba(255, 255, 255, .03);
    --neu-in:     inset 4px 4px 10px rgba(0, 0, 0, .45), inset -3px -3px 8px rgba(255, 255, 255, .04);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    background: #eef1f8;
    -webkit-font-smoothing: antialiased;
    transition: background-color .5s var(--ease), color .35s var(--ease);
    overflow-x: hidden;
}

/* 背景光斑：三层渐变 + 噪点 */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(1100px 640px at 8% -12%, #dfe6ff 0%, rgba(223, 230, 255, 0) 62%),
        radial-gradient(920px 560px at 96% 2%, #ffe3ec 0%, rgba(255, 227, 236, 0) 58%),
        radial-gradient(1000px 720px at 62% 112%, #d7f5ef 0%, rgba(215, 245, 239, 0) 60%),
        linear-gradient(180deg, #f2f5fc 0%, #eaeef8 100%);
    transition: background .6s var(--ease);
}

[data-theme="dark"] body,
[data-theme="dark"] .bg-scene ~ body {
    background-color: #0a0d1a;
}
[data-theme="dark"] .bg-scene {
    background:
        radial-gradient(1100px 640px at 8% -12%, #1c2350 0%, rgba(28, 35, 80, 0) 62%),
        radial-gradient(900px 560px at 96% 2%, #3a1f45 0%, rgba(58, 31, 69, 0) 58%),
        radial-gradient(1000px 720px at 62% 112%, #0d3a3a 0%, rgba(13, 58, 58, 0) 60%),
        linear-gradient(180deg, #0d1122 0%, #0a0d1a 100%);
}

/* 漂浮光球 */
.orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
    will-change: transform;
}
.orb.o1 { width: 420px; height: 420px; left: -120px; top: 8%; background: rgba(109, 94, 252, .34); animation: floatY 22s var(--ease) infinite; }
.orb.o2 { width: 360px; height: 360px; right: -100px; top: 22%; background: rgba(255, 122, 156, .28); animation: floatY 26s var(--ease) infinite reverse; }
.orb.o3 { width: 300px; height: 300px; left: 42%; bottom: -120px; background: rgba(20, 184, 166, .26); animation: floatY 30s var(--ease) infinite; }

[data-theme="dark"] .orb { opacity: .4; }

@keyframes floatY {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(28px, -34px, 0) scale(1.08); }
    66%      { transform: translate3d(-22px, 22px, 0) scale(.96); }
}

/* ---------------- 基础排版 ---------------- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font-family: inherit; }
::selection { background: rgba(109, 94, 252, .22); }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- 玻璃容器 ---------------- */
.glass {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(24px) saturate(165%);
    -webkit-backdrop-filter: blur(24px) saturate(165%);
}

.glass-soft {
    background: var(--glass-3);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

/* 卡片内的高光描边 */
.sheen { position: relative; }
.sheen::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(150deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: .7;
}
[data-theme="dark"] .sheen::after {
    background: linear-gradient(150deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, .1));
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px; font-weight: 650; line-height: 1.2;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 26px rgba(109, 94, 252, .3);
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(109, 94, 252, .38); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.btn-ghost {
    color: var(--ink-2);
    background: var(--glass-2);
    border-color: var(--line);
    box-shadow: var(--neu-sm);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.btn-ghost:hover { color: var(--brand); box-shadow: var(--neu); }

.btn-quiet {
    background: transparent;
    color: var(--ink-3);
    border-color: var(--line-soft);
    box-shadow: none;
}
.btn-quiet:hover { background: var(--glass-2); color: var(--brand); transform: translateY(-1px); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 16px; }

.btn-icon {
    width: 42px; height: 42px; padding: 0;
    border-radius: 13px;
    color: var(--ink-2);
    background: var(--glass-2);
    border: 1px solid var(--line);
    box-shadow: var(--neu-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .2s var(--ease), color .2s var(--ease), box-shadow .25s var(--ease);
}
.btn-icon:hover { color: var(--brand); transform: translateY(-2px); box-shadow: var(--neu); }

.btn-danger { background: linear-gradient(135deg, #f0576f, #e03e5c); box-shadow: 0 12px 26px rgba(224, 62, 92, .3); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > label,
.label {
    display: block;
    font-size: 13px; font-weight: 650; color: var(--ink-2);
    margin-bottom: 7px;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

.input, .textarea, .select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit; font-size: 14.5px; color: var(--ink);
    background: var(--glass-3);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    box-shadow: var(--neu-in);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: rgba(109, 94, 252, .5);
    box-shadow: var(--neu-in), 0 0 0 4px rgba(109, 94, 252, .13);
    background: var(--glass-2);
}
.textarea { resize: vertical; min-height: 108px; line-height: 1.7; }
.select {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237a83a0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
}

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 46px; height: 27px; border-radius: 99px; position: relative;
    background: var(--glass-3);
    box-shadow: var(--neu-in);
    transition: background .3s var(--ease), box-shadow .3s var(--ease);
    flex: 0 0 auto;
}
.switch .track::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 21px; height: 21px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(64, 82, 128, .25);
    transition: transform .35s var(--ease-spring), background .3s var(--ease);
}
.switch input:checked + .track {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .16), 0 6px 16px rgba(109, 94, 252, .3);
}
.switch input:checked + .track::after { transform: translateX(19px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---------------- 徽标 / 标签 ---------------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    font-size: 13px; font-weight: 600; color: var(--ink-3);
    background: var(--glass-3);
    border: 1px solid var(--line);
    border-radius: 99px;
    cursor: pointer;
    transition: all .22s var(--ease);
    white-space: nowrap;
}
.chip:hover { color: var(--brand); transform: translateY(-1px); background: var(--glass-2); }
.chip.active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(109, 94, 252, .28);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
    padding: 3px 9px; border-radius: 8px;
    background: var(--glass-2); color: var(--ink-3);
    border: 1px solid var(--line);
}
.badge-brand { background: rgba(109, 94, 252, .14); color: #5a4be0; border-color: rgba(109, 94, 252, .18); }
.badge-mint  { background: rgba(20, 184, 166, .14); color: #0d8f81; border-color: rgba(20, 184, 166, .18); }
.badge-rose  { background: rgba(239, 85, 112, .14); color: #c93552; border-color: rgba(239, 85, 112, .18); }
.badge-amber { background: rgba(240, 160, 58, .16); color: #a8680f; border-color: rgba(240, 160, 58, .2); }
[data-theme="dark"] .badge-brand { color: #b9b1ff; }
[data-theme="dark"] .badge-mint  { color: #6fe3d6; }
[data-theme="dark"] .badge-rose  { color: #ff9db1; }
[data-theme="dark"] .badge-amber { color: #ffc57a; }

/* ---------------- 提示条 ---------------- */
.toast-wrap {
    position: fixed; left: 50%; bottom: 30px; z-index: 90;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 10px; align-items: center;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 12px 18px;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    background: var(--glass-2);
    border: 1px solid var(--stroke);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    animation: toastIn .42s var(--ease-spring) both;
}
.toast.ok { color: #0d8f81; }
.toast.err { color: #c93552; }
.toast.out { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-8px) scale(.96); }
}

/* ---------------- 动画库 ---------------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0%   { opacity: 0; transform: scale(.9); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes pulseSoft {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: .9; transform: scale(1.06); }
}
@keyframes shimmer {
    0%   { background-position: -240% 0; }
    100% { background-position: 240% 0; }
}
@keyframes tick {
    0%   { transform: translateY(0); opacity: 1; }
    40%  { transform: translateY(-38%); opacity: 0; }
    60%  { transform: translateY(38%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* 滚动揭示 */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
    will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
