


:root {
  --bg-base: #000028;
  --bg-surface: #0B1030;
  --bg-elevated: #161D4D;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #F2F4FF;
  --text-secondary: #9BA3C9;
  --text-muted: rgba(242, 244, 255, 0.45);
  --accent: #2ECC71;
  --accent-strong: #27AE60;
  --accent-cyan: #00D8FF;
  --success: #2ECC71;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-num: ui-monospace, "SF Mono", Consolas, monospace;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --transition: 150ms;
}


* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 2.1;
  min-height: 100vh;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(46, 204, 113, 0.35); }
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img, svg { vertical-align: middle; }
button { font-family: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-cyan { color: var(--accent-cyan); }
.hidden { display: none !important; }


.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  position: relative;
}

.card::before {
  content: '';
  position: absolute; top: 0; left: 12px; right: 12px; height: 1px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
}
.card + .card { margin-top: 16px; }
.tint-box { border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 10px; }
.tint-green { border: 1px solid rgba(46, 204, 113, 0.25); background: rgba(46, 204, 113, 0.05); }
.tint-cyan { border: 1px solid rgba(0, 216, 255, 0.25); background: rgba(0, 216, 255, 0.05); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .icon { width: 18px; height: 18px; color: var(--accent); }


.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  line-height: 1.4;
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
  user-select: none;
  min-height: 40px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04240F;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #27AE60, #1E9E5A); 
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-elevated); }
.btn-danger { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-cyan { background: linear-gradient(135deg, var(--accent-cyan), #00A8CC); color: #002B36; font-weight: 600; }
.btn-sm { padding: 5px 12px; font-size: 13px; min-height: 32px; border-radius: 6px; }
.btn-block { width: 100%; }


.input, .select, .textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color var(--transition);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-cyan); outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input[type='number']::-webkit-outer-spin-button,
.input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-item { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 16px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }


.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  transition: background var(--transition); position: relative; flex-shrink: 0;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--transition), background var(--transition);
}
.switch input:checked + .track { background: rgba(46, 204, 113, 0.25); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent); }
.switch input:disabled + .track { opacity: 0.4; cursor: not-allowed; }
.switch-label { font-size: 14px; }


.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-option {
  padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
  background: transparent;
}
.radio-option.selected { background: rgba(46, 204, 113, 0.15); border-color: var(--accent); color: var(--accent); }


.toast-box {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);  
  z-index: 99999;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--toast-color);          
  color: var(--text-primary);
  padding: 10px 12px 10px 10px;
  border-radius: 10px;
  font-size: 14px;
  min-width: 280px; max-width: 420px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 18px var(--toast-glow);  
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 200ms, transform 200ms;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.hide { opacity: 0; transform: translateY(8px); }

.toast-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--toast-color);
  color: #00140B;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast-icon svg { width: 13px; height: 13px; }
.toast-msg { flex: 1; line-height: 1.5; word-break: break-word; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 14px; padding: 2px 4px; line-height: 1; cursor: pointer; }
.toast-close:hover { color: var(--text-primary); }

.toast-success { --toast-color: var(--success); --toast-glow: rgba(46, 204, 113, 0.22); background: linear-gradient(90deg, rgba(46, 204, 113, 0.10), var(--bg-elevated) 45%); }
.toast-error   { --toast-color: var(--danger);  --toast-glow: rgba(239, 68, 68, 0.22);  background: linear-gradient(90deg, rgba(239, 68, 68, 0.10), var(--bg-elevated) 45%); }
.toast-warning { --toast-color: var(--warning); --toast-glow: rgba(245, 158, 11, 0.22); background: linear-gradient(90deg, rgba(245, 158, 11, 0.10), var(--bg-elevated) 45%); }
.toast-info    { --toast-color: var(--accent-cyan); --toast-glow: rgba(0, 216, 255, 0.22); background: linear-gradient(90deg, rgba(0, 216, 255, 0.10), var(--bg-elevated) 45%); }


.dialog-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  z-index: 99990; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
  animation: dialogIn 180ms ease-out;
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.dialog-title { font-size: 15px; font-weight: 600; }
.dialog-close { background: none; border: none; color: var(--text-muted); font-size: 18px; line-height: 1; padding: 4px; }
.dialog-close:hover { color: var(--text-primary); }
.dialog-body { padding: 20px; overflow-y: auto; flex: 1; }
.dialog-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.dialog-text { color: var(--text-secondary); font-size: 14px; }


.loading-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  z-index: 99995; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.loading-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(46, 204, 113, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-secondary); font-size: 14px; }


.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); text-align: center; }
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover { background: var(--bg-elevated); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .td-num { text-align: center; font-variant-numeric: tabular-nums; }
.tbl .td-center { text-align: center; }
.tbl-empty { padding: 32px; text-align: center; color: var(--text-secondary); }

.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dot-ok { color: var(--success); }
.dot-warn { color: var(--warning); }
.dot-err { color: var(--danger); }
.dot-muted { color: var(--text-muted); }


.action-btn {
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary);
  border-radius: 6px; padding: 4px 10px; font-size: 13px; transition: all var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.action-btn:hover { color: var(--accent); border-color: var(--accent); }
.action-wrapper { position: relative; display: inline-block; }
.action-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 100;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  min-width: 140px; padding: 4px; display: none;
  box-shadow: var(--shadow-card);
}
.action-menu.show { display: block; }
.action-menu button {
  display: flex; width: 100%; text-align: left; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text-primary);
  padding: 8px 12px; font-size: 13px; border-radius: 6px;
}
.action-menu button .icon { flex-shrink: 0; }
.action-sep { height: 1px; background: var(--border); margin: 4px 8px; }
.action-menu button:hover { background: var(--bg-surface); color: var(--accent); }
.action-menu button.danger { color: var(--danger); }
.action-menu button.danger:hover { background: rgba(239, 68, 68, 0.12); }
.action-menu button:disabled { opacity: 0.4; cursor: not-allowed; }


.table-page { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; flex-wrap: wrap; }
.table-page.page-center { justify-content: center; }
.table-page .page-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  min-width: 32px; height: 32px; border-radius: 6px; font-size: 13px; padding: 0 8px;
}
.table-page .page-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.table-page .page-btn.active { background: rgba(46, 204, 113, 0.15); border-color: var(--accent); color: var(--accent); }
.table-page .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.table-page .page-count { color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.table-page select.page-limit { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 6px; height: 32px; font-size: 13px; padding: 0 6px; }


.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-item {
  background: none; border: none; color: var(--text-secondary);
  padding: 10px 16px; font-size: 14px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }


.progress { height: 8px; border-radius: 4px; background: var(--bg-elevated); overflow: hidden; }
.progress .bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-cyan)); transition: width 200ms; width: 0; }
.progress-label { font-size: 12px; color: var(--text-secondary); margin-top: 6px; text-align: right; }


.app-shell { display: flex; min-height: 100vh; }
.user-page { margin-left: 240px; }
.side-nav {
  width: 240px; flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000;
}
.nav-header { padding: 20px 16px 14px; }
.nav-brand { font-size: 18px; font-weight: 700; }
.nav-brand em { color: var(--accent); font-style: normal; }
.nav-brand-sub { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.nav-user-card {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  color: #00140B; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-sub { font-size: 11px; color: var(--text-muted); }
.nav-list { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: all var(--transition); position: relative;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: rgba(46, 204, 113, 0.1); color: var(--accent);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-cyan));
  border-radius: 2px;
}
.nav-arrow {
  margin-left: auto; width: 14px; height: 14px; flex-shrink: 0;
  color: var(--text-muted); transition: transform 180ms;
}
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-sub {
  overflow: hidden; max-height: 0;
  transition: max-height 220ms ease;
  margin-left: 14px; border-left: 1px solid var(--border); padding-left: 10px;
}
.nav-group.open .nav-sub { max-height: 240px; }
.nav-sub .nav-item { padding: 9px 12px; font-size: 13px; }
.nav-footer { padding: 12px; border-top: 1px solid var(--border); }
.nav-lang-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: var(--radius-sm);
  border: 1px solid rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.08);
  color: var(--accent); font-weight: 600; font-size: 14px;
  transition: all var(--transition); text-decoration: none;
  box-shadow: 0 0 14px rgba(46, 204, 113, 0.12);
}
.nav-lang-btn:hover { background: rgba(46, 204, 113, 0.16); color: var(--accent-cyan); border-color: var(--accent); }
.nav-lang-btn .icon { width: 16px; height: 16px; }
.topbar-mobile {
  display: none;
  align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 998; background: var(--bg-base);
}
.menu-toggle-btn {
  flex: 0 0 40px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 10px;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.menu-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
.mobile-title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-lang {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  text-decoration: none; text-align: center;
  transition: all var(--transition);
}
.mobile-lang::before {
  content: '';
  width: 14px; height: 14px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ECC71' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.mobile-lang:hover { border-color: var(--accent); background: rgba(46, 204, 113, 0.08); }
.content-area { flex: 1; min-width: 0; }
.page-content { padding: 20px; }
.nav-mask { display: none; }


.lang-banner {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.15), rgba(0, 216, 255, 0.1));
  border-bottom: 1px solid rgba(46, 204, 113, 0.3);
  padding: 8px 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 13px; color: var(--text-secondary);
}
.lang-banner a { font-weight: 600; }
.lang-banner .close { background: none; border: none; color: var(--text-muted); font-size: 14px; padding: 2px 6px; }


@media (max-width: 768px) {
  body { font-size: 15px; }
  .table-wrap:has(.tbl-empty) .tbl, .table-empty .tbl { min-width: 0; }
  .table-wrap:has(.tbl-empty) .tbl-empty, .table-empty .tbl-empty { padding: 70px 16px; }
  .input, .select, .textarea { font-size: 14px; padding: 8px 10px; }
  .card { padding: 14px 14px; }
  .btn { min-height: 38px; padding: 8px 14px; }
  .btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
  .dialog { max-width: 100%; }
  .table-page { justify-content: center; }
  
  .toast-box { left: 50%; transform: translate(-50%, -50%); align-items: center; }
  .toast { min-width: 0; max-width: 86vw; }
  
  .tbl th, .tbl td { white-space: nowrap; }
  .side-nav {
    position: fixed; top: 0; left: -72vw; width: 72vw; z-index: 1000;
    transition: left 200ms;
  }
  .side-nav.show { left: 0; }
  .nav-mask.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; }
  .topbar-mobile {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 998; background: var(--bg-base);
  }
  .user-page { margin-left: 0; }
  .page-content { padding: 14px; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; border: 1px solid var(--border); }
::-webkit-scrollbar-thumb:hover { background: #2A3370; }
::-webkit-scrollbar-corner { background: var(--bg-surface); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
