* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.12);
    --text: #f5f7fb;
    --muted: #a7b0c0;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --input-bg: rgba(255, 255, 255, 0.06);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
        Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, #1d4ed8 0%, transparent 28%),
        radial-gradient(circle at top right, #7c3aed 0%, transparent 25%),
        linear-gradient(180deg, #0b1020 0%, #11182d 100%);
    color: var(--text);
    min-height: 100vh;
}

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

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 40px;
}

.container.small {
    max-width: 460px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.card {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.center {
    text-align: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.35);
}

h1 {
    margin: 0 0 10px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

h2 {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 700;
}

h3 {
    margin: 22px 0 14px;
    font-size: 18px;
    font-weight: 700;
}

.subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

label {
    display: block;
    margin: 14px 0 8px;
    color: #dbe3f1;
    font-size: 14px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    background: var(--input-bg);
    color: var(--text);
    border-radius: 16px;
    padding: 14px 16px;
    outline: none;
    font-size: 15px;
    transition: 0.2s ease;
}

input::placeholder {
    color: #8f98aa;
}

input:focus,
select:focus {
    border-color: rgba(59,130,246,0.75);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.16);
}

.btn {
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
    box-shadow: 0 12px 24px rgba(59,130,246,0.26);
}

.btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-hover), #4f46e5);
}

.btn-light {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-light:hover {
    background: rgba(255,255,255,0.12);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 12px 24px rgba(239,68,68,0.25);
}

.full {
    width: 100%;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.actions.vertical {
    flex-direction: column;
}

.mt {
    margin-top: 16px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.link-row {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.link-row a {
    color: #dbeafe;
    font-weight: 600;
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 14px;
    background: rgba(239,68,68,0.12);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,0.25);
    font-size: 14px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.topbar-title {
    font-size: 22px;
    font-weight: 800;
}

.topbar-sub {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

.grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 10px;
}

.mode-box {
    position: relative;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.2s ease;
}

.mode-box:hover {
    border-color: rgba(59,130,246,0.5);
    transform: translateY(-1px);
}

.mode-box input[type="radio"] {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 20px;
    height: 20px;
}

.mode-box span {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.mode-box small {
    color: var(--muted);
    line-height: 1.5;
}

pre {
    margin: 0;
    min-height: 220px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.85);
    color: #c7f9cc;
    border: 1px solid rgba(255,255,255,0.08);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.table th,
.table td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
}

.table th {
    color: #dbe3f1;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: rgba(34,197,94,0.14);
    color: #86efac;
}

.badge-danger {
    background: rgba(239,68,68,0.14);
    color: #fca5a5;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 18px 14px 26px;
    }

    .card {
        padding: 20px;
        border-radius: 20px;
    }

    h1 {
        font-size: 28px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        width: 100%;
    }

    .actions .btn,
    .hero-actions .btn {
        width: 100%;
    }
}
/* 修复原生 select 下拉选项在暗色主题下看不清 */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: #f5f7fb;
    background-color: rgba(255, 255, 255, 0.06);
}

select option {
    color: #111827;
    background: #ffffff;
}

select option:checked {
    color: #ffffff;
    background: #2563eb;
}

select option:hover {
    color: #ffffff;
    background: #2563eb;
}
/* ===== 创建实例 - 自定义下拉框 ===== */
.custom-select {
    position: relative;
    width: 100%;
    margin-top: 8px;
}

.custom-select-trigger {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    color: #f5f7fb;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.custom-select-trigger::after {
    content: "▾";
    color: #cbd5e1;
    font-size: 14px;
    margin-left: 10px;
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: #1e293b;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    z-index: 9999;
}

.custom-select.open .custom-select-menu {
    display: block;
}

.custom-select-item {
    padding: 12px 14px;
    border-radius: 12px;
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.custom-select-item:hover,
.custom-select-item.active {
    background: #2563eb;
    color: #ffffff;
}

/* 强制修复这三个菜单 */
#regionMenu,
#sizeMenu,
#imageMenu {
    display: none;
}

#regionCustomSelect.open #regionMenu,
#sizeCustomSelect.open #sizeMenu,
#imageCustomSelect.open #imageMenu {
    display: block;
}
/* 修改密码弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0f172a;
    padding: 30px;
    border-radius: 20px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-bottom: 20px;
}