:root {
    --bg: #fbf8ff;
    --panel: rgba(255, 255, 255, .82);
    --panel-strong: rgba(255, 255, 255, .92);
    --text: #202338;
    --muted: #767c93;
    --line: rgba(41, 45, 74, .12);
    --accent: #7ddfd4;
    --accent-2: #ffbfd7;
    --accent-3: #b9c7ff;
    --danger: #e14e73;
    --ok: #159f6f;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Inter, "HarmonyOS Sans SC", MiSans, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(125,223,212,.30), transparent 28rem),
        radial-gradient(circle at 86% 16%, rgba(255,191,215,.32), transparent 27rem),
        radial-gradient(circle at 64% 82%, rgba(185,199,255,.30), transparent 30rem),
        linear-gradient(135deg, #fffefe 0%, #f7fbff 42%, #fff6fb 100%);
    overflow-x: hidden;
}
.aurora { position: fixed; width: 32rem; height: 32rem; filter: blur(72px); opacity: .42; pointer-events: none; }
.aurora-a { left: -12rem; top: -10rem; background: #9de7de; border-radius: 42% 58% 49% 51%; }
.aurora-b { right: -12rem; bottom: -10rem; background: #ffc8dc; border-radius: 58% 42% 52% 48%; }
.grain {
    position: fixed; inset: 0; pointer-events: none; opacity: .32;
    background-image: linear-gradient(90deg, rgba(45,50,86,.035) 1px, transparent 1px), linear-gradient(rgba(45,50,86,.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 88%);
}
.shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; position: relative; }
.public-shell::before {
    content: ""; position: absolute; width: 18rem; height: 18rem; right: 13%; top: 16%;
    border: 1px solid rgba(41,45,74,.08); transform: rotate(14deg); border-radius: 4rem;
    background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.04));
}
.public-shell::after {
    content: ""; position: absolute; width: 8rem; height: 8rem; left: 18%; bottom: 18%;
    border: 1px solid rgba(41,45,74,.08); transform: rotate(-18deg); border-radius: 2.4rem;
}
.hero-card, .admin-card {
    width: min(100%, 640px);
    position: relative;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(255,255,255,.74), rgba(255,255,255,.48)), var(--panel);
    backdrop-filter: blur(22px);
    border-radius: 34px;
    box-shadow: 0 28px 90px rgba(66, 75, 118, .14), 0 10px 30px rgba(66, 75, 118, .08);
    padding: 2.2rem;
}
.public-card {
    width: min(100%, 520px);
    padding: 1rem;
    border-radius: 30px;
    background: rgba(255,255,255,.72);
}
.hero-card::after {
    content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.62); border-radius: 24px; pointer-events: none;
}
.public-card::after { display: none; }
.brand-line { display: flex; gap: .75rem; align-items: center; color: var(--muted); letter-spacing: .04em; font-weight: 700; }
.logo-mark {
    width: 2.35rem; height: 2.35rem; display: grid; place-items: center;
    border-radius: 13px; color: #202338; font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 26px rgba(125,223,212,.22);
}
h1 { font-size: clamp(2.1rem, 6vw, 4.6rem); line-height: .94; letter-spacing: -.07em; margin: 1.8rem 0 1rem; }
h2 { margin-top: 0; letter-spacing: -.03em; }
.muted { color: var(--muted); line-height: 1.75; }
.small { font-size: .92rem; }
.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;
}
.code-form, .stack-form { display: grid; gap: .8rem; margin-top: 1.7rem; }
.public-code-form { margin-top: 0; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; }
label { color: #414761; font-size: .92rem; font-weight: 750; }
input[type="text"], input[type="password"], input[type="number"], input:not([type]) {
    width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.82); color: var(--text);
    border-radius: 18px; padding: 1rem 1.1rem; outline: none; font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.code-input {
    min-height: 58px;
    border-radius: 22px !important;
    font-size: 1.08rem !important;
    letter-spacing: .08em;
    background: rgba(255,255,255,.86) !important;
}
.code-input::placeholder { color: #9aa0b5; letter-spacing: 0; }
input[type="file"] {
    width: 100%; border: 1px dashed rgba(66,75,118,.24); background: rgba(255,255,255,.62); color: var(--muted);
    border-radius: 18px; padding: 1rem;
}
input:focus { border-color: rgba(125,223,212,.95); box-shadow: 0 0 0 4px rgba(125,223,212,.18); }
button, .button-link {
    border: none; border-radius: 18px; padding: 1rem 1.1rem; cursor: pointer; color: #202338;
    font-weight: 900; text-decoration: none; display: inline-flex; justify-content: center; align-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 30px rgba(255,191,215,.22), 0 10px 24px rgba(125,223,212,.18);
    transition: transform .16s ease, box-shadow .16s ease;
}
.code-button {
    min-height: 58px;
    white-space: nowrap;
    border-radius: 22px;
    padding-inline: 1.45rem;
}
button:hover, .button-link:hover { transform: translateY(-1px); box-shadow: 0 18px 36px rgba(255,191,215,.26), 0 12px 28px rgba(125,223,212,.22); }
.alert { margin-top: 1.2rem; border-radius: 18px; padding: 1rem; border: 1px solid var(--line); }
.error { background: rgba(225,78,115,.10); color: #b62d54; }
.success { background: rgba(21,159,111,.10); color: #08734e; }
.trust-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.trust-row span, .badge {
    border: 1px solid var(--line); background: rgba(255,255,255,.62); color: #414761;
    padding: .45rem .7rem; border-radius: 999px; font-size: .86rem;
}
.ready-card .file-panel {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border: 1px solid var(--line); background: rgba(255,255,255,.56); border-radius: 22px; padding: 1rem;
}
.file-panel p { color: var(--muted); margin-bottom: 0; }
.admin-login-shell { place-items: center; }
.login-card { max-width: 460px; }
.dashboard { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; position: relative; }
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin: 1rem 0 1.5rem; }
.dash-header h1 { margin: .8rem 0 0; font-size: clamp(2rem, 5vw, 4rem); }
.ghost-btn, .mini-btn { background: rgba(255,255,255,.62); color: var(--text); border: 1px solid var(--line); box-shadow: none; padding: .72rem .9rem; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 1rem; margin: 1rem 0; }
.admin-card { width: 100%; background: var(--panel-strong); padding: 1.5rem; border-radius: 28px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.metric-card ul { margin: .8rem 0 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.8; }
.table-card { margin-top: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { text-align: left; padding: .95rem .8rem; border-bottom: 1px solid var(--line); color: #343950; vertical-align: middle; }
th { color: var(--muted); font-size: .88rem; }
.name-cell { font-weight: 750; max-width: 280px; overflow-wrap: anywhere; }
.badge.on { color: var(--ok); }
.badge.off { color: var(--muted); }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.actions form { display: inline; }
.mini-btn { font-size: .86rem; border-radius: 12px; padding: .55rem .68rem; }
.mini-btn.danger { color: #b62d54; border-color: rgba(225,78,115,.28); }
.empty { color: var(--muted); text-align: center; padding: 2rem; }
@media (max-width: 760px) {
    .hero-card, .admin-card { padding: 1.35rem; border-radius: 24px; }
    .public-card { padding: .78rem; }
    .public-code-form { grid-template-columns: 1fr; }
    .code-button { width: 100%; }
    .grid-two, .inline-fields { grid-template-columns: 1fr; }
    .dash-header, .ready-card .file-panel { flex-direction: column; align-items: stretch; }
}
