/* ===== MIYAISP 设计系统 · 全屏高端暗色 ===== */
:root {
  --bg: #060912;
  --bg-2: #0a1124;
  --panel: #0c1528;
  --card: #101b35;
  --card-2: #0b1428;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.13);
  --text: #eaf0fb;
  --muted: #97a4be;
  --muted-2: #5d6b85;
  --accent: #2ee6c4;
  --accent-2: #1aa3e6;
  --accent-grad: linear-gradient(135deg, #2ee6c4 0%, #1aa3e6 100%);
  --accent-soft: rgba(46, 230, 196, 0.12);
  --gold: #e9c46a;
  --danger: #f4597a;
  --success: #1fd995;
  --warn: #f5b042;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(46, 230, 196, 0.28), 0 14px 40px rgba(26, 163, 230, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ================= 登录页 · 分屏 ================= */
.login-wrap {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  height: 100vh;
  min-height: 640px;
}

/* 左侧品牌视觉区 */
.login-aside {
  position: relative;
  overflow: hidden;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(26, 163, 230, 0.30), transparent 60%),
    radial-gradient(800px 700px at 90% 95%, rgba(46, 230, 196, 0.22), transparent 55%),
    linear-gradient(160deg, #0a1730 0%, #060912 100%);
  border-right: 1px solid var(--border);
}
.login-aside::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  pointer-events: none;
}
.aside-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-grad);
  display: grid; place-items: center; font-weight: 800; color: #06231f; font-size: 19px;
  box-shadow: 0 8px 24px rgba(26, 163, 230, 0.42);
}
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.brand-name span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.aside-hero { margin: auto 0; position: relative; z-index: 2; max-width: 520px; }
.aside-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px;
  border: 1px solid var(--border-2); border-radius: 999px;
  font-size: 12px; color: var(--accent); background: var(--accent-soft); margin-bottom: 22px;
}
.aside-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.aside-title {
  font-size: 44px; line-height: 1.18; font-weight: 800; letter-spacing: -.5px;
}
.aside-title em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aside-desc { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 20px 0 30px; max-width: 460px; }

.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; position: relative; z-index: 2; }
.feature { display: flex; align-items: flex-start; gap: 11px; }
.feature .ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--card); border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--accent);
}
.feature .ft { font-size: 13px; font-weight: 600; }
.feature .fd { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* 浮动凭证卡片装饰 */
.mock-card {
  position: absolute; right: 50px; bottom: 90px; z-index: 1;
  width: 280px; padding: 18px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 27, 53, 0.86), rgba(11, 20, 40, 0.86));
  border: 1px solid var(--border-2); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  transform: rotate(-3deg); opacity: .92;
}
.mock-card .mc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mock-card .mc-title { font-size: 12px; color: var(--muted); }
.mock-card .mc-tag { font-size: 10px; padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.mock-card .mc-line { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.07); margin-bottom: 8px; }
.mock-card .mc-line.w80 { width: 80%; } .mock-card .mc-line.w60 { width: 60%; }
.mock-card .mc-cred { font-family: "SF Mono", Menlo, monospace; font-size: 11px; color: var(--accent); margin-top: 4px; }

/* 右侧表单区 */
.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background:
    radial-gradient(700px 500px at 80% 10%, rgba(26, 163, 230, 0.08), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px;
}
.login-back { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; opacity: 0; height: 0; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 8px 0 30px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .3px; }
.field input {
  width: 100%; height: 48px; padding: 0 15px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; transition: transform .12s, box-shadow .15s, opacity .15s, background .15s;
}
.btn-primary {
  background: var(--accent-grad); color: #06231f; box-shadow: 0 10px 28px rgba(26, 163, 230, 0.34);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg); transition: left .6s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--card-2); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-2); background: rgba(255,255,255,0.05); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12px; border-radius: 8px; }

.form-error { min-height: 18px; color: var(--danger); font-size: 12px; margin-bottom: 10px; }
.login-foot { margin-top: 24px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ================= 仪表盘 · 全屏 ================= */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); }

/* 顶栏 */
.topbar {
  height: 68px; flex: none; display: flex; align-items: center; gap: 18px;
  padding: 0 34px; background: rgba(8, 13, 26, 0.7); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px); position: relative; z-index: 5;
}
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.topbar .brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.topbar .brand .brand-name { font-size: 17px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); margin-left: 8px; }
.topbar .btn-ghost.btn-sm { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 10px; }
.topbar .btn-ghost.btn-sm svg { width: 18px; height: 18px; }
.topbar-spacer { flex: 1; }

.main { flex: 1; overflow-y: auto; padding: 30px 34px 40px; }
.view { display: none; }
.view.active { display: block; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.section-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border-2), transparent); }
.card-pad { padding: 20px 22px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; position: relative; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-2); }
.stat::after {
  content: ""; position: absolute; right: -24px; top: -24px; width: 110px; height: 110px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none;
}
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 10px; word-break: break-all; line-height: 1.2; }
.stat .v.mono { font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 16px; font-weight: 600; }
.stat .v.accent { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .hint { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

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

/* 过滤栏 */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 18px 22px; }
.filters .fg { display: flex; flex-direction: column; gap: 7px; }
.filters label { font-size: 11px; color: var(--muted); }
.filters select, .filters input {
  height: 40px; padding: 0 13px; background: var(--card-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 13px; min-width: 128px;
}
.filters select:focus, .filters input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters .search { min-width: 240px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  text-align: left; padding: 14px 18px; color: var(--muted); font-weight: 600;
  font-size: 12px; letter-spacing: .3px; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
table.data tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(255,255,255,0.03); }
.col-mono {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12px;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.col-nowrap { white-space: nowrap; }
.region { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.region .flag {
  font-size: 18px; line-height: 1; flex: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.region .rname { color: var(--text); }
.region .rcity { color: var(--muted); font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 7px; font-size: 11px; font-weight: 600; letter-spacing: .2px; }
.tag.exc { background: rgba(46,230,196,0.14); color: var(--accent); }
.tag.shr { background: rgba(245,176,66,0.14); color: var(--warn); }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.row-actions { display: flex; gap: 7px; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 22px; border-top: 1px solid var(--border); }
.pagination .info { color: var(--muted); font-size: 12px; }
.pages { display: flex; gap: 6px; align-items: center; }
.pages button { min-width: 34px; height: 34px; padding: 0 9px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; }
.pages button:hover:not(:disabled) { border-color: var(--border-2); }
.pages button:disabled { opacity: .4; cursor: not-allowed; }
.pages button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* toast / loading / empty */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border-2); color: var(--text);
  padding: 12px 20px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--success); }
.toast.err { border-color: var(--danger); }

.loading-bar { height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: slide 1s linear infinite; display: none; }
.loading-bar.show { display: block; }
@keyframes slide { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty { text-align: center; color: var(--muted); padding: 56px 0; font-size: 13px; }

/* QR tooltip */
.qr-cell { position: relative; cursor: pointer; }
.qr-tooltip {
  position: fixed; z-index: 200;
  background: var(--card); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none; flex-direction: column; align-items: center; gap: 8px;
  min-width: 220px; max-width: 260px;
  pointer-events: none;
}
.qr-tooltip.show { display: flex; }
.qr-tooltip img { border-radius: 6px; background: #fff; display: block; }
.qr-tooltip .qr-label { font-size: 12px; color: var(--muted); text-align: center; word-break: break-all; }
.qr-tooltip .qr-url { font-size: 11px; color: var(--accent); word-break: break-all; text-align: center; max-width: 240px; }
.qr-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(39, 201, 144, 0.08); border: 1px solid rgba(39, 201, 144, 0.25);
  color: var(--accent); padding: 5px 10px; border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: background .15s;
}
.qr-btn:hover { background: rgba(39, 201, 144, 0.15); }
.row-actions { display: flex; gap: 6px; }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .main { padding: 22px 18px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 18px; }
}
