/* ============================================================
   全新站点 · 仪表盘首页样式
   设计语言：模仿 Tabler UI 风（深色顶栏 + 圆角卡片 + 渐变卡头 + 图标按钮）
   全部自写，未复制原站任何资源文件。改品牌只需动下方变量。
   ============================================================ */

/* ---------- 设计令牌（改这里即可换肤） ---------- */
:root {
  --primary: #206bc4;          /* 主色（Tabler 钢蓝） */
  --primary-d: #1a5ba3;        /* 主色加深 */
  --primary-l: #e7f0fa;        /* 主色浅底 */
  --gradient: linear-gradient(135deg, #2b7fd6 0%, #206bc4 55%, #15489c 100%);
  --warn-grad: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  --remind: #f5b623;          /* 提醒/通知 黄（与黄鸭 logo 呼应） */
  --remind-d: #d9940a;        /* 提醒加深 */
  --remind-l: #fff6e0;        /* 提醒浅底 */

  --bg: #f1f5f9;              /* 页面背景 */
  --surface: #ffffff;           /* 卡片底 */
  --text: #1a2733;            /* 主文字 */
  --muted: #6b7a90;          /* 次要文字 */
  --border: #e6edf5;          /* 描边 */
  --dark: #0b1f33;            /* 顶栏深色 */
  --dark-2: #14304d;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(27,46,75,.06), 0 1px 3px rgba(27,46,75,.08);
  --shadow: 0 4px 14px rgba(27,46,75,.08);
  --shadow-lg: 0 12px 32px rgba(27,46,75,.14);

  --maxw: 1320px;
  --nav-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--remind); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; display: block; }
.ti { line-height: 1; vertical-align: -2px; }

/* ---------- 顶栏（深色） ---------- */
.navbar {
  height: var(--nav-h);
  background: var(--dark);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), var(--shadow-sm);
}
.navbar .container-xl {
  height: 100%;
  display: flex; align-items: center; gap: 16px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 17px; color: #fff; white-space: nowrap;
}
.navbar-brand .brand-logo {
  height: 32px; width: auto; display: block;
}
/* 品牌中文名（页眉，跟随父级颜色自适应深浅背景） */
.brand-cn { font-size: 12.5px; font-weight: 600; opacity: .6; margin-left: 5px; letter-spacing: .3px; }

.navbar-nav { display: flex; align-items: center; gap: 2px; list-style: none; }
.navbar-nav .nav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.navbar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.navbar-nav .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.navbar-nav .nav-link .ti { color: #8aa6c4; }
.navbar-spacer { flex: 1; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: 0; color: #fff; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius-sm); font-family: inherit;
}
.user-btn:hover { background: rgba(255,255,255,.08); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient); color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.user-meta .u-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-meta .u-sub { font-size: 11px; color: rgba(255,255,255,.55); line-height: 1.2; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; display: none;
}
.dropdown.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--radius-sm); font-size: 13.5px;
}
.dropdown-item:hover { background: var(--primary-l); color: var(--primary-d); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.balance-box { display: flex; align-items: center; gap: 10px; padding: 10px 11px; }
.balance-box .ti { color: var(--primary); font-size: 18px; }
.balance-box .b-label { font-size: 11px; color: var(--muted); }
.balance-box .b-val { font-weight: 700; font-size: 15px; }

/* 汉堡 */
.navbar-toggler {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm); width: 38px; height: 34px; cursor: pointer;
}
.navbar-toggler .bar { display: block; width: 18px; height: 2px; background: #fff; margin: 3px auto; border-radius: 2px; }

/* ---------- 布局容器 ---------- */
.container-xl { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.page-wrapper { padding: 26px 0 60px; }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.page-subtitle { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* 卡片网格 */
.row { display: flex; flex-wrap: wrap; margin: -10px; }
.row-deck { align-items: stretch; }
.col-12 { width: 100%; }
.col-lg-6 { width: 100%; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  height: 100%; margin: 10px; display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 18px; flex: 1; }
.card-title-bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--gradient); color: #fff;
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.module-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 14px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-outline-primary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-l); }
.btn-white { background: #fff; color: var(--text); border-color: var(--border); }
.btn-white:hover { background: #f6f9fc; }
.btn-warning { background: #f59e0b; color: #3a2a00; }
.btn-warning:hover { background: #e08e00; }
.btn-remind { background: var(--remind); color: #3a2a00; border-color: var(--remind-d); }
.btn-remind:hover { background: var(--remind-d); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; }
.badge-remind { background: var(--remind); color: #3a2a00; }
.btn-block { width: 100%; }

/* ---------- 提示框 ---------- */
.alert {
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px;
}
.alert-warning { background: var(--warn-grad); border: 0; }
.alert .a-icon { font-size: 22px; color: #b7791f; flex-shrink: 0; }
.alert .a-title { font-weight: 700; color: #5b4400; margin-bottom: 3px; }
.alert .a-text { color: #6b5300; }

/* ---------- 进度条 ---------- */
.usage-box { background: #f6f9fc; border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.progress {
  height: 8px; background: #e3eaf2; border-radius: 99px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--gradient); border-radius: 99px;
  width: 0; transition: width 1s ease;
}
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }

/* ---------- 图标按钮网格（客户端/订阅） ---------- */
.btn-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 公告列表 ---------- */
.notice-list { list-style: none; }
.notice-item {
  display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border);
}
.notice-item:last-child { border-bottom: 0; }
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex-shrink: 0; }
.notice-item .n-title { font-weight: 600; font-size: 13.5px; }
.notice-item .n-date { font-size: 11.5px; color: var(--muted); }
.notice-item .n-text { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 统计小卡 ---------- */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 120px; background: #f6f9fc; border-radius: var(--radius-sm);
  padding: 13px 15px; border: 1px solid var(--border);
}
.stat .s-label { font-size: 12px; color: var(--muted); }
.stat .s-val { font-size: 20px; font-weight: 700; margin-top: 3px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(11,31,51,.5);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); max-height: 80vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px;
}
.modal-body { padding: 18px; }
.modal-close { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center;
}
.toast {
  background: #1a2733; color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px);
  transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px;
}

/* ---------- 响应式 ---------- */
@media (min-width: 992px) {
  .col-lg-6 { width: calc(50% - 20px); }
}
@media (max-width: 991px) {
  .navbar-toggler { display: block; }
  .navbar-nav {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--dark-2); flex-direction: column; align-items: stretch;
    padding: 8px; gap: 2px; display: none; box-shadow: var(--shadow);
  }
  .navbar-nav.show { display: flex; }
  .navbar-nav .nav-link { padding: 11px 13px; }
  .user-meta { display: none; }
}
@media (max-width: 575px) {
  .page-title { font-size: 22px; }
  .card-body { padding: 15px; }
  .user-btn .avatar { width: 30px; height: 30px; }
}

/* 404 页面 */
.notfound { padding: 120px 0; text-align: center; }
.notfound-inner { max-width: 560px; margin: 0 auto; }
.notfound-code {
  font-size: 96px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #206bc4, #4f9bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notfound-title { margin: 16px 0 8px; font-size: 28px; }
.notfound-desc { color: #6b7280; margin-bottom: 32px; }
.notfound-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
