/* ========== base.css ========== */
* {
    box-sizing: border-box;
}

:root {
    --bg: #07111f;
    --bg-soft: #0a1628;
    --bg-panel: #101a2b;
    --bg-panel-2: #131f33;
    --bg-hover: #182640;
    --line: rgba(118, 150, 198, .10);
    --line-strong: rgba(118, 150, 198, .18);
    --text: #edf4ff;
    --muted: #8ea3c2;
    --blue: #4f83ff;
    --blue-2: #67a0ff;
    --cyan: #12c8ff;
    --green: #52d726;
    --red: #ff5f61;
    --orange: #f5a623;
    --radius: 20px;
    --shadow: 0 20px 44px rgba(0, 0, 0, .26);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, .14);
    --hover-shadow: 0 16px 34px rgba(0, 0, 0, .18);
    --sidebar-width: 252px;
    --topbar-height: 88px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --icon-ring: linear-gradient(135deg, #4f83ff 0%, #12c8ff 100%);
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

@supports not (height: 100dvh) {
    :root {
        --app-height: 100vh;
    }
}

html,
body {
    height: var(--app-height);
    min-height: var(--app-height);
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: none;
    background: #040a13;
}

body {
    margin: 0;
    min-height: var(--app-height);
    color: var(--text);
    overflow: hidden;
    overscroll-behavior: none;
    background:
        radial-gradient(circle at 86% 0%, rgba(46, 108, 255, .08), transparent 22%),
        radial-gradient(circle at 0% 100%, rgba(18, 200, 255, .03), transparent 16%),
        linear-gradient(180deg, #040a13 0%, #050c16 46%, #07101b 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.sidebar-open,
body.modal-open,
body.log-open,
body.no-scroll {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: none;
}

.hidden {
    display: none !important;
}

/* 登录页面 */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: max(24px, calc(var(--safe-top) + 18px));
    padding-bottom: max(24px, calc(var(--safe-bottom) + 18px));
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: rgba(16, 26, 43, .96);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .30);
    backdrop-filter: blur(10px);
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -.4px;
}

.login-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(10, 17, 28, .78);
    color: var(--text);
    border: 1px solid rgba(103, 136, 184, .16);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(111, 153, 214, .24);
    background: #101d31;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #4d8dff;
    box-shadow: 0 0 0 3px rgba(79, 131, 255, .10);
    background: #112036;
}

button {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #4877e2 0%, #5d92ff 100%);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
    box-shadow: 0 8px 18px rgba(23, 74, 169, .22);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(25, 76, 170, .24);
}

button.secondary {
    background: linear-gradient(135deg, #32445f 0%, #425775 100%);
    box-shadow: none;
}

button.success {
    background: linear-gradient(135deg, #43b900 0%, #5cd21e 100%);
    box-shadow: 0 8px 18px rgba(53, 144, 14, .18);
}

button.danger {
    background: linear-gradient(135deg, #ff585d 0%, #ff6e72 100%);
    box-shadow: 0 8px 18px rgba(180, 41, 41, .18);
}

button.warning {
    background: linear-gradient(135deg, #d08a13 0%, #f0a826 100%);
    box-shadow: 0 8px 18px rgba(175, 118, 22, .18);
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status-line {
    margin-top: 12px;
    font-size: 13px;
    color: #9fcbff;
    min-height: 20px;
    line-height: 1.7;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }

.field-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.field { grid-column: span 6; }
.field.full { grid-column: span 12; }
.field.third { grid-column: span 4; }

.group-card {
    background: rgba(10, 17, 28, .78);
    border: 1px solid rgba(96, 129, 176, .07);
    border-radius: 18px;
    padding: 18px;
    box-shadow: none;
}

.group-note {
    color: #8fa4c3;
    font-size: 12px;
    line-height: 1.8;
    margin-top: -4px;
    margin-bottom: 14px;
}

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

.muted-placeholder::placeholder {
    color: #7688a5;
}
