/* ============================================================
   JCVerifactuCore Cloud Admin — 明亮高亮主题（Light）
   设计语言：浅灰底 + 白色卡片 + 清晰蓝色强调 + 加大字号与间距
   可读性优先：基础字号 15px、行高 1.55、控件高度 ≥ 40px
   ============================================================ */
:root {
    --bg: #f4f6fa;
    --bg-2: #eef2f7;
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --panel-alt: #f8fafc;
    --line: #e3e8ef;
    --line-strong: #c9d3df;
    --text: #1b2532;
    --text-dim: #4b5a6b;
    --text-faint: #7a8799;
    --accent: #1d6fe0;
    --accent-2: #0f4fb3;
    --accent-soft: #e8f0fd;
    --ok: #138a4a;
    --ok-soft: #e5f6ec;
    --warn: #b26a00;
    --warn-soft: #fff4e0;
    --danger: #c8352b;
    --danger-soft: #fdebe9;
    --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
    --sans: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei UI", sans-serif;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 14px; color: var(--text); font-weight: 650; letter-spacing: 0; }
h3 { font-size: 24px; }
h4 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 8px 0; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    flex-shrink: 0;
    padding: 24px 16px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    font-family: var(--mono); font-weight: 700; color: #ffffff; font-size: 15px;
}
.brand-title { font-weight: 700; color: var(--text); font-size: 16px; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--text-faint); font-family: var(--mono); letter-spacing: 0.06em; }

.nav-section { font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; padding: 16px 12px 6px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 15px;
    border: 1px solid transparent;
    transition: all .15s ease;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.nav-link.active {
    color: var(--accent-2);
    background: var(--accent-soft);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav-link .ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.nav-link.primary {
    margin: 10px 0 6px;
    color: #ffffff;
    font-weight: 600;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(29, 111, 224, 0.28);
}
.nav-link.primary:hover { background: var(--accent-2); color: #ffffff; }
.nav-link.primary.active { color: #ffffff; box-shadow: none; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-faint); font-family: var(--mono); line-height: 1.6; }

.main { flex: 1; min-width: 0; padding: 28px 36px 48px; }

.topbar {
    display: flex; align-items: center; justify-content: flex-end; gap: 16px;
    margin-bottom: 22px; color: var(--text-dim); font-size: 14px;
}
.user-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 8px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel);
}
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #ffffff;
}
.role-tag { font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); letter-spacing: .06em; text-transform: uppercase; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h3 { margin: 0; }
.page-head .desc { color: var(--text-dim); font-size: 14.5px; margin-top: 6px; }

/* ---------- 控件 ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 18px;
    min-height: 40px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #ffffff; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); color: #ffffff; }
.btn.ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--bg-2); }
.btn.sm { padding: 5px 12px; min-height: 32px; font-size: 13.5px; border-radius: 7px; }
.btn.danger { border-color: rgba(200, 53, 43, 0.45); background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover:not(:disabled) { border-color: var(--danger); background: #fbd9d5; color: var(--danger); }
.btn.block { width: 100%; justify-content: center; }

.input, select.input, textarea.input {
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--text);
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 42px;
    width: 100%;
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.18); }
.input.sm { width: auto; padding: 5px 10px; min-height: 32px; font-size: 13.5px; }
.input.mono { font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }
select.input option { background: #ffffff; color: var(--text); }
input[type="date"].input { color-scheme: light; }

.field { margin: 14px 0; }
.field label { display: block; font-size: 13.5px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.field .hint, .hint { font-size: 13px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }

/* ---------- 面板 / 卡片 ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    min-width: 120px;
    position: relative;
}
.card-title { font-size: 15.5px; font-weight: 650; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 14px 0 22px; }
.stat { padding: 18px 20px; }
.stat .num { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat .num.warn { color: var(--danger); }
.stat .lbl { color: var(--text-dim); font-size: 13.5px; margin-top: 8px; }

/* ---------- 表格 ---------- */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--panel); box-shadow: var(--shadow); }
.tbl { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl th {
    background: var(--panel-alt);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: sticky; top: 0;
}
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: #f3f7fd; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .mono, .mono { font-family: var(--mono); font-size: 13.5px; }
.tbl .empty { text-align: center; color: var(--text-faint); padding: 32px; }

/* ---------- 状态徽标 ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-family: var(--mono); font-size: 12.5px; letter-spacing: .03em;
    border: 1px solid var(--line-strong); color: var(--text-dim); background: var(--panel-alt);
}
.badge.ok, .badge.active { color: var(--ok); border-color: rgba(19, 138, 74, 0.35); background: var(--ok-soft); }
.badge.warn, .badge.suspended, .badge.expired, .badge.replaced { color: var(--warn); border-color: rgba(178, 106, 0, 0.35); background: var(--warn-soft); }
.badge.bad, .badge.revoked, .badge.retired { color: var(--danger); border-color: rgba(200, 53, 43, 0.35); background: var(--danger-soft); }

.msg { font-size: 14.5px; padding: 10px 14px; border-radius: 8px; border: 1px solid; display: inline-block; line-height: 1.5; }
.msg.ok { color: var(--ok); border-color: rgba(19, 138, 74, 0.35); background: var(--ok-soft); }
.msg.err { color: var(--danger); border-color: rgba(200, 53, 43, 0.35); background: var(--danger-soft); }
.subtle { color: var(--text-dim); font-weight: normal; font-size: 13.5px; }
.faint { color: var(--text-faint); }

/* ---------- 动态密码 ---------- */
.unlock-card { border-color: rgba(29, 111, 224, 0.35); background: #f6f9ff; }
.unlock-code {
    font-family: var(--mono); font-size: 40px; font-weight: 700; letter-spacing: 0.14em;
    color: var(--accent-2); padding: 14px 18px; margin: 6px 0 8px;
    border: 1px dashed var(--accent); border-radius: var(--radius); background: #ffffff;
    display: inline-block; user-select: all;
}

/* ---------- 登录页 ---------- */
.login-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 100%);
}
.login-card {
    width: 100%; max-width: 440px;
    padding: 38px 38px 30px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.10);
    position: relative;
    animation: rise .4s ease both;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-logo .brand-logo { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }
.login-logo h3 { margin: 0; font-size: 22px; }
.login-logo .sub { font-family: var(--mono); font-size: 12px; color: var(--text-faint); letter-spacing: .1em; }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); display: flex; justify-content: space-between; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(19, 138, 74, .5); animation: pulse 1.8s infinite; margin-right: 6px; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19, 138, 74, .5); } 70% { box-shadow: 0 0 0 8px rgba(19, 138, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 138, 74, 0); } }

/* ---------- 开通向导 ---------- */
.steps { display: flex; align-items: center; gap: 0; margin: 6px 0 24px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 14.5px; }
.step .n {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 13px; background: var(--panel);
}
.step.active { color: var(--text); font-weight: 600; }
.step.active .n { border-color: var(--accent); color: #ffffff; background: var(--accent); }
.step.done { color: var(--ok); }
.step.done .n { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.step-line { flex: 1; max-width: 80px; height: 2px; background: var(--line-strong); margin: 0 12px; }
.wizard { max-width: 820px; }
.wizard .summary { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14.5px; }
.wizard .summary dt { color: var(--text-dim); }
.wizard .summary dd { margin: 0; }
.keybox {
    font-family: var(--mono); font-size: 13px; word-break: break-all; line-height: 1.7;
    padding: 14px 16px; border-radius: var(--radius);
    border: 1px solid rgba(19, 138, 74, 0.4); background: var(--ok-soft); color: #0f5c33;
}
.choice { display: flex; gap: 10px; margin: 10px 0 14px; }
.choice .opt {
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); cursor: pointer; font-size: 14px; background: var(--panel); font-family: inherit;
}
.choice .opt.on { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pick-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: var(--bg-2); }
.pick-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* 404 等兜底 */
#blazor-error-ui { background: var(--danger-soft); color: var(--danger); border-top: 1px solid var(--danger); bottom: 0; left: 0; right: 0; padding: 12px 18px; position: fixed; display: none; z-index: 99; }

a.card { color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
