/* ============ 北境 CLUB / NORTHREALM —— 极地冰川美学 ============ */
:root {
  --bg: #0B1826;
  --bg2: #12263C;
  --bg3: #16314d;
  --primary: #6EC6FF;
  --accent: #5FE3D0;
  --text: #EAF4FB;
  --muted: #8FA9C0;
  --danger: #E85C5C;
  --warn: #FFD36E;
  --line: rgba(234, 244, 251, 0.12);
  --glass: rgba(18, 38, 60, 0.55);
  --radius: 4px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Source Han Sans CN", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景：极夜渐变 + 远山剪影 + 等高线 */
.bg-scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.bg-scene::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(110, 198, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(95, 227, 208, 0.10), transparent 55%),
    linear-gradient(180deg, #0B1826 0%, #0d1f33 45%, #0a1522 100%);
}
.mountains { position: absolute; bottom: 0; left: 0; width: 100%; height: 46vh; opacity: 0.55; }
.contour { position: absolute; inset: 0; opacity: 0.05;
  background-image: repeating-radial-gradient(circle at 30% 40%, transparent 0 38px, var(--primary) 38px 39px);
}
#snow { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(110, 198, 255, 0.25); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 磨砂玻璃卡片 ============ */
.glass {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ 登录 / 注册 ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 34px 30px; }
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo { font-size: 13px; letter-spacing: 6px; color: var(--accent); font-weight: 700; }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: 3px; margin-top: 6px;
  background: linear-gradient(90deg, #EAF4FB, #6EC6FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin-top: 6px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { flex: 1; padding: 9px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 14px; background: transparent; transition: .2s; }
.tab.active { color: var(--bg); background: var(--primary); border-color: var(--primary); font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: 1px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; background: rgba(11, 24, 38, 0.7); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); font-family: inherit; font-size: 14px; transition: .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110, 198, 255, 0.12); }
textarea { resize: vertical; min-height: 80px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn { padding: 11px 16px; border-radius: var(--radius); border: 1px solid transparent; font-size: 14px; font-weight: 600; transition: .2s; }
.btn-primary { background: var(--primary); color: #06121e; width: 100%; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #062018; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.6; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* ============ 应用外壳 ============ */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(11, 24, 38, 0.55);
  backdrop-filter: blur(10px); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { padding: 0 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-brand .n { font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.side-brand .e { font-size: 10px; color: var(--accent); letter-spacing: 3px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; cursor: pointer; transition: .15s; margin-bottom: 3px; border: 1px solid transparent; }
.nav-item:hover { background: rgba(110, 198, 255, 0.08); color: var(--text); }
.nav-item.active { background: rgba(110, 198, 255, 0.14); color: var(--primary); border-color: rgba(110, 198, 255, 0.25); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.side-foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px; border-top: 1px solid var(--line); }

.main { padding: 26px 30px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 40px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #06121e; font-weight: 800; font-size: 14px; overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn { display: inline-flex; cursor: pointer; border-radius: 50%; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.points-pill { background: rgba(95, 227, 208, 0.14); color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; border: 1px solid rgba(95,227,208,.3); }
.title-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.lv-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 10px; color: #06121e; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.lv-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.lv-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }

/* ============ 通用组件 ============ */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { padding: 18px; }
.stat { padding: 18px; }
.stat .label { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 8px; color: var(--primary); }
.stat .value.accent { color: var(--accent); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); gap: 12px; }
.list-item:last-child { border-bottom: none; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.badge.pending { background: rgba(255, 211, 110, .16); color: var(--warn); }
.badge.approved, .badge.settled, .badge.completed { background: rgba(95, 227, 208, .16); color: var(--accent); }
.badge.rejected, .badge.cancelled { background: rgba(232, 92, 92, .16); color: var(--danger); }
.badge.returned, .badge.shipped { background: rgba(110, 198, 255, .16); color: var(--primary); }
.badge.role { background: rgba(110,198,255,.14); color: var(--primary); }
.badge.role.senior_admin { background: rgba(255,211,110,.18); color: var(--warn); }
.badge.role.mid_admin { background: rgba(95,227,208,.16); color: var(--accent); }
.sub-head { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--muted); margin: 6px 0 10px; }
/* 积分交易 */
.tf-list { display: flex; flex-direction: column; gap: 8px; max-height: 440px; overflow: auto; }
.tf-item { padding: 10px 12px; border-radius: var(--radius); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.tf-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tf-dir { font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 700; }
.tf-dir.out { background: rgba(232,92,92,.16); color: var(--danger); }
.tf-dir.in { background: rgba(95,227,208,.16); color: var(--accent); }
.tf-amt { margin-left: auto; font-weight: 800; }
.tf-amt.out { color: var(--danger); }
.tf-amt.in { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 1px; }
tr:hover td { background: rgba(110, 198, 255, 0.04); }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; }
.amount-pos { color: var(--accent); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(5, 12, 20, 0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 24px; }
.modal h3 { font-size: 18px; margin-bottom: 18px; letter-spacing: 1px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Toast */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: var(--radius); font-size: 14px; min-width: 220px;
  border-left: 3px solid var(--primary); animation: slideIn .25s ease; }
.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 商品卡片 */
.product { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product .thumb { height: 120px; background: linear-gradient(135deg, #16314d, #0d1f33); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product .body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product .price { color: var(--accent); font-weight: 800; font-size: 18px; }

/* 通知 */
.notif { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif.unread { background: rgba(110, 198, 255, 0.06); border-left: 2px solid var(--primary); }
.notif .t { color: var(--muted); font-size: 11px; margin-top: 4px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; padding: 3px 9px; border-radius: 10px; background: rgba(110,198,255,.12); color: var(--primary); cursor: pointer; }
.img-preview { width: 70px; height: 70px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); cursor: zoom-in; }
.sub-content img { max-width: 100%; border-radius: var(--radius); margin-top: 8px; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5,8,14,.88); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 4vh 4vw; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox .lb-close { position: absolute; top: 18px; right: 22px; font-size: 26px; color: #fff; background: rgba(255,255,255,.12); border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; line-height: 1; }

/* 福利公示 */
.wf-hero { padding: 28px 22px; text-align: center; margin-bottom: 16px; }
.wf-title { font-size: 26px; font-weight: 900; letter-spacing: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wf-sub { margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.wf-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.wf-row:last-of-type { border-bottom: none; }
.wf-amt { color: var(--accent); font-weight: 800; white-space: nowrap; }
.wf-note { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.wf-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wf-tier { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px; border-radius: var(--radius); background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 12px; }
.wf-tier span { color: var(--text); }
.wf-tier b { color: var(--accent); font-size: 14px; font-weight: 800; }
.wf-more { font-size: 15px; color: var(--primary); font-weight: 700; letter-spacing: 1px; padding: 6px 0; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 230px; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .main { padding: 18px; }
  .menu-btn { display: inline-flex !important; }
}
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.menu-btn { display: none; }
