﻿:root {
  --bg: #eef3fb;
  --text: #17233c;
  --muted: #5f7091;
  --accent: #2f6bff;
  --accent-soft: #2f6bff1f;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --panel: rgba(255, 255, 255, .62);
  --panel-solid: rgba(255, 255, 255, .82);
  --panel-border: rgba(255, 255, 255, .92);
  --line: #e2eaf7;
  --radius: 16px;
  --shadow: 0 22px 50px -26px rgba(23, 45, 96, .34);
  --shadow-soft: 0 10px 24px -18px rgba(23, 45, 96, .32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: 48px;
  background:
    radial-gradient(820px 560px at 8% -8%, #dbe8ff 0%, transparent 62%),
    radial-gradient(700px 500px at 96% 2%, #e0f6fd 0%, transparent 58%),
    radial-gradient(760px 560px at 52% 108%, #ece6ff 0%, transparent 62%),
    linear-gradient(180deg, #f3f7fd 0%, #eef3fc 52%, #f5f8fe 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -.2px; }
p { margin: 0; }
a { color: #2f6bff; text-decoration: none; }
[hidden] { display: none !important; }

.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); font-size: 13px; margin: 8px 0 0; }

/* 玻璃卡片 */
.login-card,
.panel,
.metric,
.quota-card,
.modal,
.footer-inner {
  position: relative;
  background: linear-gradient(168deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.58) 100%);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

/* 登录 */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(430px, 100%);
  padding: 32px;
  border-radius: 26px;
}
.login-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 12% 0%, #ffffff, transparent 55%);
  opacity: .8;
}
.login-card > * { position: relative; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand.small { margin-bottom: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #3f7bff, #12b6d8 60%, #7b5cff);
  color: #fff; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 10px 20px -10px #2f6bffcc, inset 0 1px 0 #ffffff66;
}
.brand-img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; }
.brand.small .brand-img { width: 36px; height: 36px; flex: 0 0 36px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .6px; }
.brand strong { font-size: 15px; }
.login-card h1 { font-size: 23px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; line-height: 1.7; }
.login-card .foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 20px; }
.login-card .foot a { color: #2f6bff; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--muted); }
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field.checkbox > span { color: var(--text); font-size: 13px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #d9e3f4;
  background: #fffffff0;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { line-height: 1.65; resize: vertical; min-height: 86px; }
input:hover, select:hover, textarea:hover { border-color: #c3d3ee; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: #9aa8c2; }
select option { color: var(--text); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 11px; border: 1px solid transparent;
  background: #ffffffcc; color: #24345a; font-size: 13px; font-weight: 550; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
}
.btn:hover { transform: translateY(-1px); background: #fff; }
.btn.primary {
  background: linear-gradient(135deg, #3f7bff, #2f6bff 48%, #12a9d8);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 24px -14px #2f6bffcc, inset 0 1px 0 #ffffff4d;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: #ffffff9e; border-color: #ffffff; box-shadow: var(--shadow-soft); }
.btn.danger { background: #fff1f1; border-color: #fbd5d5; color: #b91c1c; }
.btn.danger:hover { background: #ffe7e7; }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; padding: 11px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; margin: 12px auto 0;
  width: min(1320px, calc(100% - 28px));
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 14px 34px -22px rgba(23,45,96,.42), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  position: sticky; top: 12px; z-index: 20;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: #2b4a8f; font-size: 12px; }
.user-chip { color: var(--text); font-size: 13px; font-weight: 550; }
.clock { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

main { width: min(1280px, calc(100% - 32px)); margin: 20px auto 0; }

/* 概览 */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.metric { padding: 14px 16px; border-radius: var(--radius); }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric strong { font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }

/* 标签页 */
.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 6px;
  border-radius: 999px; background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  margin-bottom: 16px;
}
.tabs button {
  padding: 8px 15px; border-radius: 999px; border: 0; background: transparent;
  color: #53648a; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.tabs button:hover { color: var(--text); background: #eef4ff; }
.tabs button.active {
  background: linear-gradient(135deg, #3f7bff, #2f6bff 55%, #12a9d8);
  color: #fff; box-shadow: 0 10px 22px -12px #2f6bffcc;
}

/* 面板 */
.panel { padding: 20px; border-radius: 22px; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; margin-bottom: 4px; }
.panel-head .muted { font-size: 12px; line-height: 1.7; max-width: 720px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 140px; }

/* 表格 */
.table-wrap {
  width: 100%; overflow-x: auto;
  border-radius: 14px; border: 1px solid #eef3fc; background: #ffffff7a;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #edf2fb; vertical-align: top; }
th { color: var(--muted); font-weight: 550; font-size: 12px; white-space: nowrap; background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f4f8ff; }
td .btn { margin-right: 4px; }
.empty { color: var(--muted); font-size: 13px; padding: 16px 4px; }

.tag { padding: 2px 9px; border-radius: 999px; font-size: 11px; white-space: nowrap; display: inline-block; }
.tag.ok { background: #e7f8ef; color: #15803d; border: 1px solid #c9efdc; }
.tag.warn { background: #fef5e7; color: #b45309; border: 1px solid #fbe3be; }
.tag.bad { background: #fff1f1; color: #b91c1c; border: 1px solid #fbd5d5; }
.tag.neutral { background: #f1f5fb; color: #475569; border: 1px solid #e2eaf7; }

/* 签发 */
.issue-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px; align-items: end;
}
.issue-form .field { margin-bottom: 0; }
.issue-form .btn { align-self: end; }
.issue-result {
  margin-top: 16px; padding: 16px; border-radius: 16px;
  background: #f0fbf4; border: 1px solid #d4f0df;
}
.issue-result h4 { color: #15803d; margin-bottom: 10px; }
.kv { display: grid; gap: 8px; margin-bottom: 12px; }
.kv div { display: flex; gap: 10px; justify-content: space-between; font-size: 13px; }
.kv span { color: var(--muted); }
.issue-form-wrap { margin-top: 18px; }
.issue-form-wrap h3 { font-size: 15px; margin-bottom: 12px; }

.quota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quota-card { padding: 16px; border-radius: var(--radius); }
.quota-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.quota-card strong { font-size: 24px; letter-spacing: -.5px; }

/* 历史面板 */
.history { margin-top: 16px; }
.snapshot-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px; padding: 12px; border-radius: 12px; background: #f7faff; margin-bottom: 10px;
  border: 1px solid #eef3fc;
}
.snapshot-grid div { font-size: 12px; }
.snapshot-grid span { display: block; color: var(--muted); margin-bottom: 3px; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; }
pre {
  margin: 8px 0 0; padding: 10px; border-radius: 10px; background: #f5f8fd;
  border: 1px solid #e8eefa; overflow: auto; max-height: 220px; font-size: 12px; color: #33456b;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 20px; background: #22345a33; backdrop-filter: blur(6px);
}
.modal { width: min(520px, 100%); padding: 22px; border-radius: 22px; box-shadow: 0 30px 70px -26px #17233c66; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 16px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 11px 18px; border-radius: 12px; z-index: 80;
  background: rgba(255,255,255,.94); border: 1px solid #fff; color: var(--text);
  font-size: 13px; box-shadow: 0 18px 40px -18px rgba(23,45,96,.5);
  backdrop-filter: blur(16px); max-width: calc(100% - 40px);
  animation: toastIn .22s ease both;
}
.toast.error { background: #fff1f1; border-color: #fbd5d5; color: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; border-radius: 22px; position: static; }
  .clock { display: none; }
  main { width: calc(100% - 24px); }
  .panel { padding: 14px; }
  .field-row { grid-template-columns: 1fr; }
}


