:root {
  --bg: #0a0e1a;
  --bg-soft: #0f1526;
  --card: #111a30;
  --border: #223052;
  --text: #4ade80;
  --text-dim: #86efac;
  --primary: #7c5cff;
  --primary-2: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0a0e1a url('/static/bg-admin.jpg') center/cover no-repeat fixed;
  color: var(--text);
  min-height: 100vh;
}

/* 星空背景（默认透明，露出壁纸） */
.starry-sky { position: fixed; inset: 0; z-index: -2; background: transparent; }
.bg-layer { display: none; }

/* 后台壁纸压暗层（降低背景亮度，不影响前台落地页） */
body:not(.landing) .starry-sky::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
}

/* 通用 */
a { color: var(--primary-2); text-decoration: none; }
.link { color: var(--primary-2); text-decoration: underline; }
h1, h2, h3 { font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 14px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: #fff; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; color: #fff; font-weight: 500; }
.btn-primary:hover { opacity: .92; color: #fff; }
.btn-danger { background: transparent; border-color: rgba(239,68,68,.4); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.12); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: #86efac; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.1); color: #4ade80; font-size: 14px; outline: none; transition: border .15s;
}
.form-input::placeholder { color: rgba(74,222,128,.55); }
.form-input:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }

/* 登录页 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 380px;
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 36px 32px;
}
.auth-logo { font-size: 44px; text-align: center; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 22px; margin-bottom: 4px; color: #4ade80; }
.auth-sub { text-align: center; color: #86efac; font-size: 13px; margin-bottom: 24px; }
.auth-msg { margin-top: 12px; font-size: 13px; color: var(--ok); text-align: center; min-height: 18px; }
.auth-msg.error { color: var(--danger); }

/* 布局 */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: transparent; border-right: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand-icon { font-size: 26px; }
.sidebar-brand-text { font-weight: 600; font-size: 15px; }
.sidebar-brand-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-section-title { font-size: 11px; color: var(--text-dim); padding: 10px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 4px;
  border-radius: 8px; color: var(--text-dim); font-size: 14px; transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(124,92,255,.08); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(59,130,246,.16)); color: #4ade80; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px; border-bottom: 1px solid rgba(255,255,255,.12); background: transparent;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.topbar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; font-size: 15px;
}
.container { padding: 26px; max-width: 1200px; width: 100%; }

/* 卡片 */
.card {
  background: transparent; border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { text-align: center; padding: 26px 16px; position: relative; overflow: hidden; }
.stat-card::before { content:''; position:absolute; inset:0; background: radial-gradient(120px 80px at 50% -20%, rgba(124,92,255,.25), transparent); }
.stat-label { font-size: 13px; color: var(--text-dim); }
.stat-num { font-size: 32px; font-weight: 700; margin-top: 8px; background: linear-gradient(135deg, #c4b5fd, #7dd3fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.14); }
.table th { color: var(--text-dim); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.table tr:hover td { background: rgba(124,92,255,.04); }
.empty-tip { text-align: center; color: var(--text-dim); padding: 26px !important; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-dim); }
.badge.ok { color: var(--ok); border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.1); }
.fsize-hint { font-size: 12.5px; color: var(--text-dim); }

/* 上传 */
.upload-area {
  border: 2px dashed rgba(255,255,255,.35); border-radius: 10px; padding: 40px 20px;
  text-align: center; color: var(--text-dim); cursor: pointer; transition: all .2s;
}
.upload-area:hover, .upload-area.drag { border-color: var(--primary); background: rgba(124,92,255,.06); color: var(--text); }
.upload-icon { font-size: 34px; margin-bottom: 8px; }
.upload-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress-bar { flex: 1; height: 8px; border-radius: 10px; background: var(--bg-soft); overflow: hidden; }
.progress-bar > div { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .2s; }

/* 图表 */
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; min-width: 560px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: rgba(10,14,26,.85); border: 1px solid var(--border); color: var(--text);
  padding: 12px 22px; border-radius: 10px; font-size: 14px; z-index: 100;
  opacity: 0; transition: all .3s; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 90vw;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { border-color: rgba(239,68,68,.5); color: #fca5a5; }

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
  .nav-section-title { display: none; }
  .sidebar-footer { display: none; }
  .nav-item { margin-bottom: 0; padding: 8px 10px; font-size: 13px; }
  .container { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* 域名选择弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,7,16,.72); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(460px, 94vw); max-height: 80vh; overflow-y: auto;
  background: transparent; border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-close { float: right; cursor: pointer; color: var(--text-dim); font-size: 14px; }
.modal-close:hover { color: #fff; }
.domain-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: transparent;
  cursor: pointer; transition: all .15s; text-align: left;
}
.domain-option:hover { border-color: var(--primary); }
.domain-option .dname { font-weight: 600; font-size: 14px; color: var(--text); }
.domain-option .durl { color: var(--text-dim); font-size: 12px; margin-top: 3px; word-break: break-all; }
.domain-option .dgo { color: var(--primary-2); font-size: 13px; flex-shrink: 0; }
