:root {
    --page: #f4f7fb;
    --page-2: #edf3fa;
    --surface: rgba(255, 255, 255, .68);
    --surface-strong: rgba(255, 255, 255, .86);
    --surface-soft: rgba(255, 255, 255, .48);
    --line: rgba(77, 98, 130, .13);
    --line-strong: rgba(255, 255, 255, .86);
    --text: #142033;
    --muted: #6e7c91;
    --blue: #1677ff;
    --blue-deep: #075fd6;
    --cyan: #28b7d8;
    --violet: #7a6cf6;
    --green: #15986b;
    --amber: #a96b00;
    --red: #cc4059;
    --shadow: 0 24px 70px rgba(65, 86, 120, .13);
    --shadow-soft: 0 10px 32px rgba(65, 86, 120, .09);
    --shadow-button: 0 10px 24px rgba(22, 119, 255, .22);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 11px;
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { min-width: 320px; margin: 0; color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
code, pre, .code-input { font-family: "SFMono-Regular", Menlo, Monaco, Consolas, monospace; }
[hidden] { display: none !important; }

.app-body,
.admin-body {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 9% 4%, rgba(68, 166, 255, .16), transparent 31%),
        radial-gradient(circle at 92% 8%, rgba(125, 108, 246, .13), transparent 28%),
        radial-gradient(circle at 72% 94%, rgba(40, 183, 216, .10), transparent 30%),
        linear-gradient(145deg, #fafcff 0%, var(--page) 48%, var(--page-2) 100%);
}
.app-body { display: flex; flex-direction: column; }
.app-body::before,
.admin-body::before,
.background-grid {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(72, 105, 150, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 105, 150, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 82%);
}
.ambient {
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    filter: blur(48px);
    pointer-events: none;
    opacity: .42;
}
.ambient-one { width: 360px; height: 360px; top: 9%; left: -220px; background: rgba(58, 151, 255, .24); }
.ambient-two { width: 430px; height: 430px; right: -260px; bottom: -160px; background: rgba(119, 99, 244, .19); }

.shell,
.topbar { width: min(1160px, calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 2; }
.shell-narrow { width: min(760px, calc(100% - 32px)); }
.topbar {
    flex: 0 0 auto;
    margin-top: 18px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(255, 255, 255, .62);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.96);
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; font-weight: 760; letter-spacing: -.02em; }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, #36b7e4 0%, #1677ff 52%, #786cf5 100%);
    box-shadow: 0 12px 26px rgba(32, 112, 224, .24), inset 0 1px 1px rgba(255,255,255,.48);
    font-weight: 850;
    letter-spacing: -.04em;
}
.brand-mark.small { width: 39px; height: 39px; border-radius: 12px; font-size: 12px; }
.language-switcher { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.lang-pill {
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    transition: .18s ease;
}
.lang-pill:hover,
.lang-pill.active { color: var(--blue-deep); border-color: rgba(255,255,255,.9); background: rgba(255,255,255,.72); box-shadow: 0 7px 18px rgba(65,86,120,.07); }

.hero-shell {
    flex: 1 0 auto;
    min-height: 0;
    padding: clamp(42px, 8vh, 84px) 0 clamp(50px, 8vh, 88px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(44px, 8vw, 104px);
}
.hero-copy { min-width: 0; }
.hero-copy h1,
.glass-card h1,
.admin-topbar h1 { margin: 0; line-height: 1.04; letter-spacing: -.052em; }
.hero-copy h1 {
    max-width: 690px;
    font-size: clamp(48px, 6.2vw, 76px);
    font-weight: 800;
    background: linear-gradient(120deg, #172338 7%, #1367c9 50%, #6658dc 91%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.eyebrow { margin: 0 0 13px; color: var(--blue-deep); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: clamp(16px, 1.8vw, 19px); line-height: 1.72; }
.hero-copy .lead { max-width: 610px; margin: 23px 0 0; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.trust-row span {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 999px;
    color: #5e6e85;
    background: rgba(255,255,255,.56);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
    font-size: 11px;
    backdrop-filter: blur(14px);
}

.glass-card,
.panel,
.stat-card,
.credential-modal {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.96);
    backdrop-filter: blur(28px) saturate(145%);
    -webkit-backdrop-filter: blur(28px) saturate(145%);
}
.glass-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); }
.glass-card::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.98), transparent);
    pointer-events: none;
}
.redeem-card { padding: clamp(28px, 4.8vw, 44px); }
.card-icon,
.auth-orb {
    width: 50px;
    height: 50px;
    margin-bottom: 25px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 16px;
    color: var(--blue);
    background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(40,183,216,.12));
    box-shadow: 0 10px 25px rgba(57, 98, 156, .12), inset 0 1px 0 #fff;
    font-size: 22px;
}
.auth-orb span { transform: rotate(45deg); }

.stack-form { display: grid; gap: 17px; }
.stack-form label { display: grid; gap: 8px; color: #35445a; font-size: 12px; font-weight: 720; }
.stack-form small,
label small,
.stat-card small { color: var(--muted); font-size: 10.5px; font-weight: 520; line-height: 1.55; }
input,
select,
textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid rgba(78, 99, 132, .16);
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: rgba(255,255,255,.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.96), 0 1px 2px rgba(44,60,84,.025);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus,
select:focus,
textarea:focus { border-color: rgba(22,119,255,.48); background: rgba(255,255,255,.94); box-shadow: 0 0 0 4px rgba(22,119,255,.10), inset 0 1px 0 #fff; }
.code-input { text-transform: uppercase; letter-spacing: .07em; font-size: 16px; }

.button {
    appearance: none;
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; border-color: rgba(3,84,195,.26); background: linear-gradient(180deg, #2d91ff, #1677ff 58%, #0c66df); box-shadow: var(--shadow-button), inset 0 1px 0 rgba(255,255,255,.42); }
.button.primary:hover { box-shadow: 0 14px 28px rgba(22,119,255,.28), inset 0 1px 0 rgba(255,255,255,.46); }
.button.secondary { color: #29415f; border-color: rgba(255,255,255,.9); background: rgba(255,255,255,.72); box-shadow: 0 7px 19px rgba(65,86,120,.07); }
.button.ghost { color: var(--muted); border-color: rgba(78,99,132,.13); background: rgba(255,255,255,.32); }
.button.wide { width: 100%; }
.compact-button { min-height: 39px; padding-inline: 14px; }
.button.danger-button { color: #af334a; border-color: rgba(204,64,89,.16); background: rgba(255,236,240,.72); box-shadow: none; }

.security-note { margin: 18px 0 0; display: flex; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.security-note span { color: var(--blue); }
.footer { flex: 0 0 auto; position: relative; z-index: 2; padding: 15px 16px 25px; text-align: center; color: #8c98aa; font-size: 10px; }
.alert { margin-bottom: 17px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; line-height: 1.55; backdrop-filter: blur(16px); }
.alert.error { color: #982e43; border-color: rgba(204,64,89,.16); background: rgba(255,235,239,.78); }
.alert.success { color: #0c704f; border-color: rgba(21,152,107,.16); background: rgba(226,248,240,.80); }
.alert.warning { color: #835500; border-color: rgba(169,107,0,.16); background: rgba(255,246,219,.82); }

.success-shell,
.login-shell { flex: 1 0 auto; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 36px 0; }
.success-card,
.login-card,
.install-card { padding: clamp(28px, 5.5vw, 48px); }
.success-card h1,
.login-card h1,
.install-card h1 { font-size: clamp(34px, 6vw, 52px); }
.auth-card { width: min(100%, 570px); }
.success-badge {
    width: 64px;
    height: 64px;
    margin-bottom: 23px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(145deg, #36c995, #15986b);
    box-shadow: 0 14px 29px rgba(21,152,107,.22), inset 0 1px 0 rgba(255,255,255,.42);
    font-size: 27px;
}
.credential-list { display: grid; gap: 10px; margin: 28px 0 19px; }
.credential-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 14px;
    background: rgba(255,255,255,.53);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
.credential-row > div { min-width: 0; display: grid; gap: 5px; }
.credential-label { color: var(--muted); font-size: 9.5px; font-weight: 820; letter-spacing: .10em; text-transform: uppercase; }
.credential-row code { overflow-wrap: anywhere; white-space: pre-wrap; color: #17243b; font-size: 13px; }
.credential-actions { display: flex !important; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.copy-button,
.mini-copy { flex: 0 0 auto; border: 1px solid rgba(78,99,132,.14); border-radius: 9px; color: var(--blue-deep); background: rgba(255,255,255,.73); cursor: pointer; font-weight: 720; }
.copy-button { padding: 7px 10px; font-size: 11px; }
.copy-button.open-link { display: inline-flex; align-items: center; }
.mini-copy { margin-left: 6px; padding: 4px 7px; font-size: 9px; }
.warning-box { padding: 12px 14px; border-radius: 12px; color: #78560e; background: rgba(255,246,220,.72); font-size: 11px; line-height: 1.6; }
.action-row { display: flex; gap: 10px; margin-top: 22px; }
.action-row .button { flex: 1; }
.subtle-link { display: block; margin-top: 20px; text-align: center; color: var(--muted); font-size: 11px; }
.login-card .brand-mark,
.install-card .brand-mark { margin-bottom: 24px; }
.section-label { margin-top: 9px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--blue-deep); font-size: 10px; font-weight: 820; letter-spacing: .12em; text-transform: uppercase; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.install-card { margin: 42px 0; }

/* Admin workspace */
.admin-layout { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0,1fr); gap: 16px; padding: 16px; }
.sidebar {
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    padding: 17px 13px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 23px;
    background: rgba(255,255,255,.61);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.96);
    backdrop-filter: blur(30px) saturate(145%);
    -webkit-backdrop-filter: blur(30px) saturate(145%);
}
.sidebar::before { content: ""; width: 42px; height: 11px; margin: 0 8px 17px; background: radial-gradient(circle at 5px 5px,#ff5f57 0 4.5px,transparent 5px),radial-gradient(circle at 21px 5px,#febc2e 0 4.5px,transparent 5px),radial-gradient(circle at 37px 5px,#28c840 0 4.5px,transparent 5px); }
.admin-brand { padding: 0 8px 18px; }
.admin-brand > span:last-child { display: grid; gap: 2px; min-width: 0; }
.admin-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-brand small { color: var(--muted); font-size: 9.5px; font-weight: 630; }
.admin-nav { display: grid; gap: 4px; overflow-y: auto; scrollbar-width: thin; }
.admin-nav a { padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: #617087; font-size: 12px; font-weight: 700; transition: .16s ease; }
.admin-nav a:hover { color: var(--blue-deep); border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.56); }
.admin-nav a.active { color: #fff; border-color: rgba(4,82,188,.18); background: linear-gradient(180deg, #3094ff, #1677ff 58%, #0d69e5); box-shadow: 0 9px 19px rgba(22,119,255,.19), inset 0 1px 0 rgba(255,255,255,.38); }
.sidebar-footer { margin-top: auto; padding: 14px 8px 1px; display: grid; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-footer form { margin: 0; }
.link-button { appearance: none; padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 10px; }
.admin-main { min-width: 0; padding: 0 7px 42px 0; }
.admin-topbar {
    position: relative;
    top: auto;
    z-index: 1;
    min-height: 54px;
    margin-bottom: 12px;
    padding: 8px 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid rgba(77,98,130,.12);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.admin-topbar h1 { font-size: clamp(22px, 2.4vw, 29px); letter-spacing: -.04em; }
.admin-chip { padding: 7px 10px; border: 1px solid rgba(255,255,255,.88); border-radius: 999px; color: #5d6b80; background: rgba(255,255,255,.52); box-shadow: inset 0 1px 0 rgba(255,255,255,.96); font-size: 10px; font-weight: 680; white-space: nowrap; }
.admin-content { display: grid; gap: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.stat-grid.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
.finance-stat-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
.finance-mini-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.stat-card { position: relative; min-width: 0; padding: 18px; display: grid; gap: 7px; overflow: hidden; border-radius: 18px; }
.stat-card::after { content: ""; position: absolute; width: 96px; height: 96px; right: -48px; bottom: -58px; border-radius: 50%; background: rgba(22,119,255,.07); }
.stat-card.featured { color: #fff; border-color: rgba(255,255,255,.45); background: linear-gradient(145deg, rgba(38,143,255,.92), rgba(108,91,232,.88)); }
.stat-card.featured span,
.stat-card.featured small { color: rgba(255,255,255,.78); }
.stat-card span { color: var(--muted); font-size: 10px; }
.stat-card strong { position: relative; z-index: 1; overflow-wrap: anywhere; font-size: clamp(21px,2.8vw,29px); letter-spacing: -.04em; }
.stat-link { transition: transform .16s ease, box-shadow .16s ease; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 20px 46px rgba(65,86,120,.14); }
.profit-card strong,
.positive-money { color: #087a55 !important; font-weight: 760; }
.loss-card strong,
.negative-money { color: #bf354e !important; font-weight: 760; }
.stat-card.featured strong { color: #fff !important; }

.admin-grid { display: grid; gap: 18px; }
.admin-grid.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.panel { position: relative; min-width: 0; padding: 21px; overflow: hidden; border-radius: 20px; }
.panel-heading { position: relative; z-index: 1; margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.panel-heading > a { color: var(--blue-deep); font-size: 11px; font-weight: 750; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid rgba(255,255,255,.84); border-radius: 14px; background: rgba(255,255,255,.35); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { padding: 11px 12px; border-bottom: 1px solid rgba(78,99,132,.09); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; color: #637188; background: rgba(247,250,255,.93); font-size: 9.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.38); }
.status,
.card-type { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border-radius: 999px; white-space: nowrap; font-size: 9px; font-weight: 800; }
.status.redeemed { color: #0b7653; background: rgba(21,152,107,.10); }
.status.unused { color: #075fcf; background: rgba(22,119,255,.10); }
.status.disabled { color: #9d3248; background: rgba(204,64,89,.10); }
.card-type { color: #5b4fc3; background: rgba(122,108,246,.10); }
.empty-cell { padding: 36px; text-align: center; color: var(--muted); }
.file-drop { padding: 24px; display: grid; place-items: center; gap: 9px; border: 1px dashed rgba(22,119,255,.25); border-radius: 15px; text-align: center; background: rgba(255,255,255,.31); }
.file-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: rgba(22,119,255,.09); font-size: 20px; }
.import-grid,
.category-import-grid { align-items: start; }
.format-example,
.generated-details textarea { margin: 0; padding: 16px; overflow-x: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; color: #eaf1ff; background: #172236; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); font-size: 10px; line-height: 1.8; }
.notice-list { margin-top: 15px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.notice-list p { margin: 7px 0; }
.report-panel { display: grid; gap: 15px; }
.generated-details summary { margin-bottom: 10px; color: var(--blue-deep); cursor: pointer; font-weight: 760; }
.paste-import { min-height: 245px; overflow-wrap: anywhere; font-family: "SFMono-Regular",Menlo,Monaco,Consolas,monospace; font-size: 11px; }
.management-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.management-actions form { margin: 0; }
.filter-bar { display: grid; grid-template-columns: 140px minmax(200px,1fr) 105px auto auto; gap: 8px; margin-bottom: 15px; }
.category-filter-bar { grid-template-columns: 120px 145px 120px minmax(200px,1fr) 85px auto auto; }
.finance-filter-bar { grid-template-columns: 120px 110px 135px minmax(180px,1fr) 82px auto auto; }
.wide-table { min-width: 1060px; }
.credential-table { min-width: 1550px; }
.finance-table { min-width: 1260px; }
.inline-form { display: inline; }
.text-action { appearance: none; padding: 0; border: 0; color: var(--blue-deep); background: none; cursor: pointer; font-size: 10px; font-weight: 740; }
.text-action.danger { color: var(--red); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 19px; color: var(--muted); font-size: 11px; }
.pagination a { color: var(--blue-deep); font-weight: 740; }
.settings-panel { max-width: 940px; }
.category-create-form { display: grid; grid-template-columns: minmax(210px,310px) auto; gap: 8px; align-items: center; }
.category-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(215px,1fr)); gap: 10px; }
.category-chip { min-width: 0; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(255,255,255,.87); border-radius: 13px; background: rgba(255,255,255,.41); box-shadow: inset 0 1px 0 rgba(255,255,255,.95); }
.category-chip.uncategorized { background: rgba(22,119,255,.05); }
.category-chip strong { display: block; overflow-wrap: anywhere; }
.category-chip span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.empty-category-tip { margin: 0; padding: 13px 0; color: var(--muted); font-size: 11px; }
.upgrade-notice { margin-bottom: 17px; }
.bulk-category-bar { margin: 0 0 14px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.86); border-radius: 12px; background: rgba(255,255,255,.35); }
.bulk-category-bar select { width: min(320px,100%); }
.bulk-selected { min-width: 68px; color: var(--muted); font-size: 10px; font-weight: 720; }
.category-card-table th:first-child,
.category-card-table td:first-child { width: 34px; text-align: center; }
.category-card-table input[type="checkbox"] { width: 15px; height: 15px; padding: 0; accent-color: var(--blue); }
.category-inline-form { min-width: 205px; display: flex; align-items: center; gap: 5px; }
.category-inline-form select { min-width: 145px; padding: 7px 26px 7px 8px; font-size: 10px; }
.mini-save { appearance: none; padding: 6px 8px; border: 1px solid rgba(22,119,255,.17); border-radius: 8px; color: var(--blue-deep); background: rgba(22,119,255,.08); cursor: pointer; font-size: 9px; font-weight: 800; }
.row-actions { min-width: 170px; white-space: nowrap; }
.row-actions > * { margin-right: 7px; }
.row-actions > *:last-child { margin-right: 0; }
.detail-meta-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.detail-meta-grid > div { padding: 13px; display: grid; gap: 5px; border: 1px solid rgba(255,255,255,.84); border-radius: 12px; background: rgba(255,255,255,.38); }
.detail-meta-grid strong { font-size: 10px; }
.detail-meta-grid span { color: var(--muted); font-size: 11px; }
.finance-preview { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(255,255,255,.87); border-radius: 14px; background: linear-gradient(145deg,rgba(255,255,255,.57),rgba(22,119,255,.05)); }
.finance-preview span { color: var(--muted); font-size: 11px; }
.finance-preview strong { font-size: 22px; letter-spacing: -.035em; }

body.modal-open { overflow: hidden; }
.credential-modal-backdrop { position: fixed; inset: 0; z-index: 1000; padding: 22px; display: grid; place-items: center; background: rgba(36,49,70,.20); backdrop-filter: blur(17px); -webkit-backdrop-filter: blur(17px); }
.credential-modal { width: min(640px,100%); max-height: calc(100vh - 44px); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 23px; border-radius: 21px; }
.credential-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.credential-modal-header h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.credential-modal-header .eyebrow { margin-bottom: 5px; }
.modal-close { width: 35px; height: 35px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.9); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.65); cursor: pointer; font-size: 21px; line-height: 1; }
.modal-loading { padding: 30px 11px; text-align: center; color: var(--muted); }
.admin-credential-list { margin: 0; }
.admin-credential-list .credential-row { background: rgba(255,255,255,.44); }
.admin-credential-list code { max-width: 440px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.modal-security-note { margin: 16px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.inline-details { position: relative; display: inline-block; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.mini-reset-form { min-width: 235px; margin-top: 7px; padding: 9px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-soft); }
.mini-reset-form input { padding: 7px 9px; }
.muted-text { color: var(--muted); font-size: 10px; }
.user-admin-grid { align-items: start; }

/* Security center */
.security-grid { align-items: start; }
.security-panel { overflow: visible; }
.security-state { margin-bottom: 18px; padding: 14px 15px; display: flex; align-items: center; gap: 12px; border-radius: 14px; }
.security-state > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 850; }
.security-state > div { display: grid; gap: 3px; }
.security-state small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.security-state.enabled { border: 1px solid rgba(21,152,107,.14); background: rgba(225,248,240,.65); }
.security-state.enabled > span { background: var(--green); }
.security-state.disabled { border: 1px solid rgba(169,107,0,.14); background: rgba(255,246,220,.65); }
.security-state.disabled > span { background: #d89217; }
.security-action-form { margin-top: 17px; }
.setup-secret-card { margin-bottom: 18px; padding: 16px; border: 1px solid rgba(22,119,255,.14); border-radius: 14px; background: rgba(239,247,255,.7); }
.setup-secret-card p { margin: 0 0 11px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.setup-secret-card > code { display: block; margin-bottom: 10px; padding: 12px; border-radius: 10px; color: #0e4f9e; background: rgba(255,255,255,.76); word-break: break-all; user-select: all; font-size: 14px; letter-spacing: .09em; }
.setup-secret-card details { margin-top: 12px; color: var(--muted); font-size: 10px; }
.setup-secret-card details code { display: block; margin-top: 8px; padding: 10px; border-radius: 9px; background: rgba(255,255,255,.7); word-break: break-all; user-select: all; }
.danger-zone { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.danger-zone summary { color: var(--red); cursor: pointer; font-size: 11px; font-weight: 750; }
.danger-zone form { margin-top: 13px; }
.recovery-panel { border-color: rgba(21,152,107,.18); }
.recovery-code-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.recovery-code-grid code { padding: 11px; border: 1px solid rgba(255,255,255,.9); border-radius: 10px; text-align: center; color: #0b6849; background: rgba(255,255,255,.65); user-select: all; font-size: 12px; font-weight: 750; }
.switch-row { padding: 12px 13px; display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 11px !important; border: 1px solid rgba(255,255,255,.86); border-radius: 13px; background: rgba(255,255,255,.39); cursor: pointer; }
.switch-row input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; padding: 0; accent-color: var(--blue); }
.switch-row span { display: grid; gap: 3px; }
.switch-row small { display: block; }
.audit-list { display: grid; gap: 8px; }
.audit-list > div { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(255,255,255,.84); border-radius: 11px; background: rgba(255,255,255,.38); }
.audit-list span { overflow-wrap: anywhere; font-size: 10px; font-weight: 700; }
.audit-list time { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; }

@media (max-width: 1280px) {
    .finance-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .category-filter-bar,
    .finance-filter-bar { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1040px) {
    .hero-shell { grid-template-columns: 1fr; gap: 38px; padding-top: 46px; }
    .hero-copy { text-align: center; }
    .hero-copy .lead { margin-inline: auto; }
    .trust-row { justify-content: center; }
    .redeem-card { width: 100%; max-width: 560px; margin-inline: auto; }
    .admin-grid.two-columns { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .finance-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .form-grid.three { grid-template-columns: 1fr; }
    .recovery-code-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
    .public-topbar { align-items: flex-start; flex-direction: column; }
    .language-switcher { justify-content: flex-start; }
    .hero-shell { padding-top: 30px; padding-bottom: 55px; gap: 32px; }
    .hero-copy h1 { font-size: clamp(42px,13vw,62px); }
    .form-grid.two { grid-template-columns: 1fr; }
    .admin-layout { display: block; padding: 9px; }
    .sidebar { position: relative; top: 0; width: 100%; height: auto; padding: 13px; border-radius: 19px; }
    .sidebar::before { display: none; }
    .admin-brand { padding-bottom: 11px; }
    .admin-nav { display: flex; overflow-x: auto; padding-bottom: 3px; }
    .admin-nav a { white-space: nowrap; }
    .sidebar-footer { display: none; }
    .admin-main { padding: 9px 0 34px; }
    .admin-topbar { position: relative; top: auto; min-height: 48px; margin-bottom: 10px; padding: 7px 4px 9px; }
    .admin-topbar h1 { font-size: 22px; }
    .admin-chip { display: none; }
    .panel { padding: 17px; }
    .card-management-heading,
    .category-heading { align-items: stretch; flex-direction: column; }
    .filter-bar,
    .category-filter-bar,
    .finance-filter-bar { grid-template-columns: 1fr; }
    .bulk-category-bar { align-items: stretch; flex-direction: column; }
    .bulk-category-bar select,
    .bulk-category-bar .button { width: 100%; }
    .management-actions { justify-content: stretch; }
    .management-actions form,
    .management-actions .button { width: 100%; }
    .credential-modal-backdrop { padding: 11px; }
    .credential-modal { max-height: calc(100dvh - 22px); padding: 18px; }
}
@media (max-width: 560px) {
    .shell,
    .topbar { width: min(100% - 22px,1160px); }
    .topbar { margin-top: 11px; }
    .hero-shell { padding-top: 26px; padding-bottom: 48px; }
    .redeem-card,
    .success-card,
    .login-card,
    .install-card { border-radius: 21px; }
    .action-row.vertical-mobile,
    .credential-row { align-items: stretch; flex-direction: column; }
    .credential-actions { justify-content: stretch; }
    .credential-actions > * { flex: 1; justify-content: center; }
    .stat-grid,
    .stat-grid.compact,
    .finance-stat-grid,
    .finance-mini-grid { grid-template-columns: 1fr; }
    .panel-heading { flex-direction: column; }
    .category-create-form { grid-template-columns: 1fr; }
    .category-create-form .button { width: 100%; }
    .category-summary,
    .detail-meta-grid,
    .recovery-code-grid { grid-template-columns: 1fr; }
    .audit-list > div { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}


/* v1.7 手机号卡密独立管理 */
.phone-card-stats { margin-bottom: 18px; }
.phone-card-layout { margin-bottom: 18px; align-items: start; }
.phone-code-import { min-height: 215px; }
.phone-rule-list { margin-top: 0; }
.phone-card-filter { grid-template-columns: 150px 110px auto auto; max-width: 560px; }
.phone-card-table { min-width: 980px; }
.phone-code-cell { min-width: 300px; max-width: 620px; }
.phone-code-cell code { display: inline-block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; user-select: all; font-size: 11px; }
.phone-import-report { margin: 18px 0; }
.phone-import-report .generated-details textarea { width: 100%; min-height: 120px; }
@media (max-width: 820px) {
    .phone-card-filter { grid-template-columns: 1fr; max-width: none; }
}
