/* =========================================================================
   活码系统 · 深青 × 琥珀 设计系统
   深海军蓝侧栏 + 低温青绿主色 + 琥珀点缀，克制而高级的运营控制台
   ========================================================================= */
:root {
  --brand: #0f766e;
  --brand-strong: #0b5c56;
  --brand-soft: #d6efec;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --danger: #e11d48;
  --info: #0284c7;
  --success: #059669;
  --warning: #d97706;
  --ink: #0f172a;
  --muted: #6b7280;
  --line: #e7ecf3;
  --panel: #ffffff;
  --app-bg: #eef1f6;
  --sidebar-w: 252px;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow-2: 0 16px 40px -16px rgba(15,23,42,.22);
  --shadow-glow: 0 0 0 1px rgba(15,118,110,.12), 0 10px 30px -12px rgba(15,118,110,.35);
  --font-body: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--app-bg);
  color: #253043;
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ======= App layout ======= */
.app-wrapper { display: flex; min-height: 100vh; }

/* ======= Sidebar ======= */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000;
  display: flex; flex-direction: column;
  background: #171c21;
  color: rgba(230,238,248,.72);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04), 8px 0 30px -18px rgba(4,12,26,.7);
  transition: width .25s ease;
}
.sidebar-brand {
  position: relative; z-index: 1;
  padding: 24px 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand .brand-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(150deg, #12a392, #0b5c56);
  box-shadow: 0 8px 22px -8px rgba(18,163,146,.7), inset 0 1px 0 rgba(255,255,255,.25);
  color: #eafffb; font-size: 1.5rem;
}
.sidebar-brand h4 { color: #fff; margin: 0; font-weight: 700; font-size: 1.02rem; letter-spacing: 3px; }
.sidebar-brand small { color: rgba(255,255,255,.45); font-size: .7rem; letter-spacing: 2px; }
.sidebar-user {
  position: relative; z-index: 1;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-user .username { font-weight: 600; color: #fff; font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.sidebar-user .expiry { font-size: .72rem; color: rgba(255,255,255,.5); }
.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; position: relative; z-index: 1; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0; padding: 11px 14px; border-radius: 12px;
  color: rgba(230,238,248,.62); font-size: .9rem; text-decoration: none;
  position: relative; transition: background .18s, color .18s, transform .18s;
}
.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; color: rgba(255,255,255,.5); transition: color .18s; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a:hover i { color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(120deg, rgba(15,118,110,.32), rgba(15,118,110,.12));
  color: #fff; box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-nav a.active i { color: #2dd4bf; }
.sidebar-footer {
  position: relative; z-index: 1;
  padding: 10px 12px 16px; border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: rgba(230,238,248,.5); font-size: .85rem; text-decoration: none; transition: all .18s;
}
.sidebar-footer a:hover { background: rgba(255,82,82,.12); color: #ff8a8a; }
.sidebar-footer a i { width: 20px; text-align: center; }

/* ======= Main content ======= */
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 26px 30px 40px; min-height: 100vh; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.page-header h4 { margin: 0; font-weight: 700; color: #14202f; font-size: 1.32rem; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.page-header h4 i { color: var(--brand); }

/* ======= Cards ======= */
.card {
  border: none; border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-2); }
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 600; background: #fbfcfe; border-bottom: 1px solid var(--line);
  padding: 15px 20px; color: #17212e; display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* Stat cards */
.stat-card { border-radius: 20px; border: none; overflow: hidden; position: relative; }
.stat-card .card-body { padding: 22px 24px; position: relative; z-index: 1; }
.stat-card .card-title { font-size: .8rem; font-weight: 600; letter-spacing: .5px; opacity: .9; margin: 0 0 8px; }
.stat-card .card-text { font-weight: 800; font-size: 2rem; margin: 0; }
.stat-card .stat-icon { font-size: 2.4rem; opacity: .22; position: absolute; top: 18px; right: 20px; z-index: 0; }
.stat-card small { opacity: .85; }
.stat-card.text-bg-primary { background: linear-gradient(155deg,#3b6df0,#2b4bd0) !important; }
.stat-card.text-bg-success { background: linear-gradient(155deg,#0ea17f,#0a7b64) !important; }
.stat-card.text-bg-info { background: linear-gradient(155deg,#0a8ed9,#0663a8) !important; }
.stat-card.text-bg-warning { background: linear-gradient(155deg,#f2a51b,#d97706) !important; }
.stat-card.text-bg-danger { background: linear-gradient(155deg,#f0406f,#c81e48) !important; }
.stat-card.text-bg-secondary { background: linear-gradient(155deg,#64748b,#475569) !important; }
.stat-card.text-bg-dark { background: linear-gradient(155deg,#0f2030,#0a1520) !important; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }

/* ======= Tables ======= */
.table-container {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1);
}
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 12px 16px; }
.table thead th {
  font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .8px;
  color: #6b7686; background: #fbfcfe; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { vertical-align: middle; border-color: #f0f3f8; color: #2a3343; }
.table-hover tbody tr { transition: background .14s; }
.table-hover tbody tr:hover { background: #f6f9fc; }
.table .table-dark thead th { background: #131f30 !important; color: #fff; }
.table-container .pagination { padding: 14px 16px; margin: 0; background: #fff; }

/* ======= Buttons ======= */
.btn {
  border-radius: 11px; font-weight: 600; font-size: .85rem; padding: 8px 17px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  border: none;
}
.btn i { margin-right: 4px; }
.btn-sm { border-radius: 9px; padding: 5px 12px; font-size: .78rem; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg,#0f8a80,#0a6a62); box-shadow: 0 6px 16px -8px rgba(15,118,110,.7); color:#fff; }
.btn-primary:hover { box-shadow: 0 8px 20px -8px rgba(15,118,110,.85); }
.btn-success { background: linear-gradient(135deg,#0ea17f,#0a7b64); }
.btn-info { background: linear-gradient(135deg,#0a8ed9,#0663a8); color:#fff; }
.btn-warning { background: linear-gradient(135deg,#f2a51b,#dd8a08); color:#3a2500; }
.btn-danger { background: linear-gradient(135deg,#f0406f,#c81e48); }
.btn-outline-primary { color:#0a8a80; border-color:#9ad6cf; background:#f2fbfa; }
.btn-outline-primary:hover { background:#0f766e; color:#fff; }
.btn-outline-secondary, .btn-outline-warning, .btn-outline-info { border-color:#dbe2ec; color:#51606f; background:#fff; }
.btn-outline-secondary:hover { background:#f1f4f8; color:#0f172a; }

/* ======= Forms ======= */
.form-control, .form-select {
  border-radius: 11px; border: 1px solid #dbe2ec; background: #fbfcfe;
  padding: 9px 13px; font-size: .88rem; color: #1c2737;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(15,118,110,.14);
}
.form-control::placeholder { color: #a7b2c2; }
label { font-weight: 600; font-size: .83rem; margin-bottom: 6px; color: #3a4453; }
.input-group-text { background: #f6f8fb; border: 1px solid #dbe2ec; color: #6b7686; border-right: 0; }

/* ======= Badges ======= */
.badge {
  border-radius: 999px; font-weight: 600; padding: 4px 11px; font-size: .72rem; letter-spacing: .3px;
}
.badge.bg-purple { background: #6d28d9 !important; color:#fff; }
.badge.bg-info { background:#0a8ed9 !important; color:#fff; }
.badge.bg-secondary { background:#8a94a6 !important; color:#fff; }
.badge.bg-warning { background:#f2a51b !important; color:#3a2500; }
.badge.bg-info.bg-soft, .badge.bg-soft { background:#eaf3fd !important; color:#0a6ec2; }

/* ======= Pagination ======= */
.pagination { margin-top: 0; }
.page-link { border: none; border-radius: 10px !important; margin: 0 3px; color: #48566a; font-size: .82rem; padding: 6px 12px; background:#f6f8fb; }
.page-item.active .page-link { background: linear-gradient(135deg,#0f8a80,#0a6a62); box-shadow: 0 6px 14px -8px rgba(15,118,110,.8); }
.page-item .page-link:hover { background: #e9f3f1; color:#0a6a62; }

/* ======= Modal ======= */
.modal-content { border: none; border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(4,12,26,.5); }
.modal-header { border-radius: 18px 18px 0 0; padding: 18px 22px; border-bottom: 1px solid var(--line); background:#fbfcfe; }
.modal-header h5 { font-weight: 700; display:flex; align-items:center; gap:8px; }
.modal-footer { border-radius: 0 0 18px 18px; border-top: 1px solid var(--line); padding: 14px 22px; background:#fbfcfe; }

/* ======= Alert ======= */
.alert { border: none; border-radius: 12px; font-size: .87rem; box-shadow: none; }
.alert .bi { margin-right: 4px; }

/* ======= small helpers ======= */
.text-muted-small { font-size: .78rem; color: #9aa5b4; }
.gap-2 { gap: .5rem; }
.flex-wrap { flex-wrap: wrap; }

/* ======= Domain cards ======= */
.domain-card { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.domain-card .card-header { background:#fbfcfe; padding: 13px 18px; display:flex; align-items:center; justify-content:space-between; }

/* ======= Dashboard widgets ======= */
.weekday-label { width: 40px; font-size:.8rem; color:#7a8595; }
.weekly-val { width: 32px; text-align: right; font-size:.8rem; color:#7a8595; font-family: var(--font-mono); }
.weekly-bar { height: 12px; background:#eef1f6; border-radius: 8px; overflow:hidden; margin:0 8px; }
.weekly-bar-fill { height:100%; background: linear-gradient(90deg,#0f8a80,#2dd4bf); border-radius:8px; transition: width .6s ease; }
.recent-list { max-height: 280px; overflow-y:auto; }
.recent-list::-webkit-scrollbar { width:6px; }
.recent-list::-webkit-scrollbar-thumb { background:#e2e8f0; border-radius:8px; }
.recent-item { padding:11px 18px; border-bottom:1px solid #f2f5f9; }
.recent-avatar { width:34px; height:34px; border-radius:50%; background:linear-gradient(140deg,#0f8a80,#0a5d58); color:#dff7f1; display:inline-flex; align-items:center; justify-content:center; box-shadow: 0 4px 10px -6px rgba(15,118,110,.8); }
.announcement-item { border-bottom:1px solid #eef2f7; padding-bottom:12px; margin-bottom:12px; }
.announcement-item:last-child { border-bottom:none; margin-bottom:0; padding-bottom:0; }

/* ======= Customer service widget ======= */
.service-widget { position: fixed; top: 86px; right: 22px; z-index: 1050; }
.service-btn {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid #fff; padding: 0; overflow: hidden; cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(4,12,26,.5); background:#fff; transition: transform .2s;
}
.service-btn:hover { transform: scale(1.1) rotate(-4deg); }
.service-btn img { width:100%; height:100%; object-fit:cover; }
.service-badge {
  position:absolute; right:-3px; bottom:-3px; width:22px; height:22px; border-radius:50%;
  background:linear-gradient(135deg,#f2a51b,#dd8a08); color:#3a2500; font-size:.72rem;
  display:inline-flex; align-items:center; justify-content:center; border:2px solid #fff;
}
.service-panel {
  position:absolute; right:0; top:64px; width:240px; background:#fff; border-radius:14px;
  box-shadow: 0 16px 48px -20px rgba(4,12,26,.6); overflow:hidden;
  animation: pop .18s ease;
}
.service-panel-header {
  display:flex; align-items:center; justify-content:space-between; padding:13px 16px;
  background: linear-gradient(135deg,#0b1422,#0e2a3f); color:#fff; font-weight:600; font-size:.88rem;
}
.service-panel-body { padding:16px; font-size:.85rem; color:#2a3343; line-height:1.7; white-space:pre-wrap; word-break:break-all; }
@keyframes pop { from { opacity:0; transform: translateY(-4px) scale(.98);} to {opacity:1; transform:none;} }

/* ======= Captcha ======= */
.captcha-group { display: flex; gap: 9px; align-items: stretch; }
.captcha-group .form-control { flex: 1 1 auto; min-width: 0; }
.captcha-svg { flex: 0 0 auto; width: 120px; height: 44px; line-height:0; border:1px solid #e2e6ec; border-radius:9px; overflow:hidden; background:#eef1f6; }
.captcha-svg svg { display:block; width:100%; height:100%; }
.captcha-refresh { flex:0 0 auto; width: 44px; display:inline-flex; align-items:center; justify-content:center; }

/* Image thumbnail in tables */
.img-thumbnail-small { width: 48px; height: 48px; object-fit: cover; border-radius: 12px; border: 1px solid #eef1f6; box-shadow: var(--shadow-1); }

/* ======= Login pages — split-screen ======= */
.login-page {
  min-height: 100vh; display: flex; align-items: stretch; background: #fff;
}
.login-hero {
  flex: 1 1 46%; position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 660px at 12% -6%, rgba(18,163,146,.5), transparent 55%),
    radial-gradient(820px 620px at 102% 104%, rgba(245,158,11,.30), transparent 55%),
    linear-gradient(150deg,#0a1220 0%, #0e2740 58%, #0a1d33 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 60px;
}
.login-hero::after {
  content:""; position:absolute; inset:0; opacity:.5; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 72%);
          mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 72%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero .hero-brand { display:flex; align-items:center; gap:14px; }
.login-hero .hero-mark {
  width: 46px; height: 46px; border-radius: 12px; display:grid; place-items:center;
  background: linear-gradient(150deg,#12a392,#0b5c56);
  box-shadow: 0 10px 24px -10px rgba(18,163,146,.8), inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 1.4rem;
}
.login-hero .hero-brand .hero-name { font-weight:800; letter-spacing:3px; font-size:1.05rem; }
.login-hero .hero-brand .hero-tag { font-size:.72rem; letter-spacing:2px; opacity:.5; }
.login-hero .hero-copy h1 { font-size: 2.7rem; font-weight: 800; line-height: 1.12; letter-spacing:.5px; margin: 34px 0 18px; }
.login-hero .hero-copy h1 em { font-style: normal; color:#2dd4bf; }
.login-hero .hero-copy p { font-size: 1rem; line-height:1.75; opacity:.72; max-width: 420px; }
.login-hero .hero-features { list-style:none; margin: 30px 0 0; padding:0; display:flex; flex-direction:column; gap:14px; }
.login-hero .hero-features li { display:flex; align-items:center; gap:12px; font-size:.92rem; opacity:.85; }
.login-hero .hero-features li i {
  width: 30px; height: 30px; border-radius: 9px; display:grid; place-items:center; flex:0 0 auto;
  background: rgba(255,255,255,.08); color:#2dd4bf; border:1px solid rgba(45,212,191,.25);
}
.login-hero .hero-foot { font-size:.75rem; opacity:.45; letter-spacing:.5px; }

.login-form-side {
  flex: 1 1 54%; display:flex; align-items:center; justify-content:center;
  padding: 48px 40px; background:#fbfcfe;
}
.login-form-wrap { width:100%; max-width: 380px; animation: fa .4s ease both; }
@keyframes fa { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform:none;} }
.login-form-wrap .form-eyebrow {
  font-size:.72rem; letter-spacing:3px; text-transform:uppercase; color: var(--brand);
  font-weight:700; margin-bottom:8px;
}
.login-form-wrap h2 { font-size:1.7rem; font-weight:800; color:#0f172a; margin:0 0 6px; }
.login-form-wrap .sub { color:#6b7280; font-size:.9rem; margin:0 0 28px; }
.login-field { margin-bottom:18px; }
.login-field label { display:block; font-size:.76rem; font-weight:700; letter-spacing:.5px; color:#3a4453; margin-bottom:7px; text-transform:uppercase; }
.login-field .control {
  display:flex; align-items:center; gap:10px; border:1px solid #dfe5ee; border-radius:4px;
  padding: 0 12px; background:#fff; transition: border-color .18s, box-shadow .18s;
}
.login-field .control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,118,110,.12); }
.login-field .control .ic { color:#9aa5b4; font-size:1rem; }
.login-field .control input {
  border:none; outline:none; background:transparent; flex:1; min-width:0;
  padding: 13px 0; font-size:.92rem; color:#1c2737; font-family: var(--font-body);
}
.login-field .control input::placeholder { color:#aab3c2; }
.login-field .control .toggle-eye { background:none; border:none; color:#9aa5b4; cursor:pointer; font-size:1rem; }
.login-captcha { display:flex; gap:10px; align-items:stretch; }
.login-captcha .form-control { border-radius:4px; }
.login-submit {
  width:100%; margin-top:8px; border:none; border-radius:6px; cursor:pointer;
  background: linear-gradient(135deg,#0f8a80,#0a6a62); color:#fff;
  padding: 14px 18px; font-size:.95rem; font-weight:700; letter-spacing:1px;
  box-shadow: 0 10px 22px -10px rgba(15,118,110,.7); transition: transform .15s, box-shadow .15s;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(15,118,110,.85); }
.login-alt { margin-top:20px; text-align:center; font-size:.85rem; color:#7a8595; }
.login-alt a { color:#0a8a80; font-weight:600; text-decoration:none; }
.login-alt a:hover { text-decoration:underline; }
.login-error { background:#fdeef1; color:#c81e48; border:1px solid #f7cfd7; border-radius:6px; padding:11px 14px; font-size:.85rem; margin-bottom:18px; display:flex; gap:8px; align-items:center; }
.login-hint { font-size:.78rem; color:#9aa5b4; margin-top:6px; }

/* login override for sharper controls (no rounded card) */
.login-form-wrap .captcha-svg { border-radius:4px; }
.login-form-wrap .captcha-refresh { border-radius:4px; width:44px; }
.login-form-wrap .captcha-refresh.btn-outline-secondary { background:#fff; }

@media (max-width: 900px) {
  .login-hero { display:none; }
  .login-form-side { flex:1 1 auto; padding: 40px 24px; }
}

/* ======= Responsive ======= */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-brand h4, .sidebar-brand small, .sidebar-brand .brand-mark,
  .sidebar-user, .sidebar-nav a span, .sidebar-footer a span { display:none; }
  .sidebar-nav a, .sidebar-footer a { justify-content:center; padding:12px; }
  .sidebar-nav a i, .sidebar-footer a i { margin:0; }
  .main-content { margin-left: 64px; padding: 18px; }
  .page-header { flex-direction: column; align-items: flex-start; gap:10px; }
}

/* ======= Animations ======= */
.main-content { animation: fade .3s ease; }
@keyframes fade { from { opacity:0; } to { opacity:1; } }
