/* ============================================================
   资产看板 ERP —— 深色系样式表
   设计参考 DeepSeek Harness：深色底、发丝边框、小圆角、
   无冗余阴影，简约大气，完美适配移动端
   ============================================================ */

:root {
  --bg: #0b0d10;
  --surface: #121519;
  --surface-2: #171b21;
  --surface-3: #1d2229;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #e6e8ea;
  --muted: #81858c;
  --accent: #679efe;
  --accent-strong: #7babff;
  --accent-dim: rgba(103, 158, 254, .13);
  --ok: #34d399;
  --ok-dim: rgba(52, 211, 153, .1);
  --warn: #febc2e;
  --warn-dim: rgba(254, 188, 46, .1);
  --danger: #ff5f57;
  --danger-dim: rgba(255, 95, 87, .1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .92em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  word-break: break-all;
}

::selection { background: var(--accent-dim); color: #fff; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2e35; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3f47; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局骨架 ---------------- */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #0d0f13;
  border-right: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #0b0d10;
  border-radius: 6px;
}
.brand-logo .icon { width: 19px; height: 19px; }

.brand-name { color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: .4px; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  transition: background .12s, color .12s;
}
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-dim);
  color: #fff;
  font-weight: 500;
}

.sidebar-foot { padding: 12px 10px; border-top: 1px solid var(--border); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 10px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.uname { font-size: 13.5px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ver { font-size: 12px; color: #5c6169; text-align: center; margin-top: 10px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(11, 13, 16, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.topbar-user { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.topbar-user .icon { width: 15px; height: 15px; }

.menu-btn { display: none; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.container { max-width: none; margin: 0; padding: 22px 26px 60px; }

/* ---------------- 通用组件 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-head h3 { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3 .icon { width: 16px; height: 16px; color: var(--accent); }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.src-wrap { overflow-x: auto; }
.src-link { word-break: break-all; }
.src-more { color: var(--muted); font-size: 12px; padding: 10px 2px 0; }

/* 来路表格各数字列区分色 */
.col-ip  { color: #60a5fa; }
.col-pv  { color: #34d399; }
.col-uv  { color: #c084fc; }
.col-new { color: #fbbf24; }
.src-wrap th, .src-wrap td { transition: color .15s; }

/* 日期选择图标：深色模式下用自定义浅色图标，避免黑色图标看不清 */
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator {
  width: 20px;
  height: 20px;
  margin-left: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6e8ea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* 加载中 */
.load-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 42px 20px;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fadein { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.traffic-note { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }

/* 来路日期控制 */
.src-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.src-controls .src-date { padding: 6px 12px; }
.src-controls .src-date.active { background: var(--accent); color: #0b0d10; border-color: var(--accent); }
.src-controls .src-date-input { width: 150px; padding: 6px 10px; font-size: 13px; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.page-btn {
  min-height: 32px;
  padding: 4px 11px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) { background: var(--surface-2); }
.page-btn.active { background: var(--accent); color: #0b0d10; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis { color: var(--muted); padding: 0 2px; }
.pagination .src-more { margin-left: 6px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; font-weight: 600; letter-spacing: .2px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  margin: 20px 0 12px;
  color: var(--text);
}
.section-title .icon { width: 16px; height: 16px; color: var(--accent); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 13.5px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn .icon { width: 15px; height: 15px; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.btn.primary { background: var(--accent); color: #0b0d10; }
.btn.primary:hover { background: var(--accent-strong); }

.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }

.btn.danger { background: transparent; border-color: rgba(255, 95, 87, .4); color: var(--danger); }
.btn.danger:hover { background: var(--danger-dim); }

.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 12.5px; border-radius: 4px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-dim); }
.icon-btn .icon { width: 17px; height: 17px; }

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-dim); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.badge.warning { background: var(--warn-dim); color: var(--warn); border-color: rgba(254, 188, 46, .3); }
.badge.danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255, 95, 87, .3); }
.badge.muted { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.badge.server { background: var(--accent-dim); color: var(--accent); border-color: rgba(103, 158, 254, .3); }
.badge.domain { background: rgba(94, 234, 212, .08); color: #5eead4; border-color: rgba(94, 234, 212, .3); }

/* 提示条 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  transition: opacity .25s, transform .25s;
}
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.alert.ok { background: var(--ok-dim); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.alert.danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255, 95, 87, .3); }
.alert.fade { opacity: 0; transform: translateY(-5px); }

/* 标签页 */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all .12s;
}
.tab:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.tab.active { background: var(--accent); color: #0b0d10; border-color: var(--accent); }

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stat-grid.mini { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  transition: border-color .15s, background .15s;
}
.stat-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
a.stat-card.link:hover { border-color: rgba(103, 158, 254, .45); text-decoration: none; }

.stat-top { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin-bottom: 9px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }

.stat-icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
}
.stat-icon .icon { width: 15px; height: 15px; }
.stat-icon.t-primary { background: var(--accent-dim); color: var(--accent); }
.stat-icon.t-secondary { background: rgba(255, 255, 255, .05); color: var(--muted); }
.stat-icon.t-warning { background: var(--warn-dim); color: var(--warn); }
.stat-icon.t-danger { background: var(--danger-dim); color: var(--danger); }

.stat-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat-value small { font-size: 12.5px; font-weight: 500; color: var(--muted); }

.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.delta { font-size: 12px; font-weight: 500; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.stat-sub { color: var(--muted); font-size: 12px; }

/* 到期提醒列表 */
.remind-list { display: flex; flex-direction: column; gap: 6px; }
.remind-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.remind-item:hover { background: var(--surface-2); }
.remind-name { flex: 1; min-width: 140px; font-weight: 500; word-break: break-all; }
.remind-date { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 便签 */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-bar { display: flex; align-items: center; gap: 8px; }
.search-bar input { width: 260px; }

.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  transition: border-color .15s, background .15s;
}
.note-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.note-title, .note-title-btn {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 5px;
  word-break: break-all;
  color: var(--text);
}
.note-title-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.note-title-btn:hover .note-title-text { color: var(--accent); }
.note-title-text { flex: 1; word-break: break-all; }
.note-toggle-hint {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.note-chevron {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform .18s;
}
.note-item.expanded .note-chevron { transform: rotate(180deg); }
.note-content {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-item.expanded .note-content {
  margin-top: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.note-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.note-time .icon { width: 13px; height: 13px; }

/* 便签弹窗：大尺寸，适合长内容阅读与编辑 */
.modal.note-modal .sheet { width: min(760px, 96vw); max-height: 92vh; }
.modal.note-modal textarea {
  min-height: 340px;
  font-size: 14.5px;
  line-height: 1.7;
  font-family: inherit;
}

/* ---------------- 表格 ---------------- */

.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }
thead th {
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
td .strong { font-weight: 500; word-break: break-all; }
.th-actions, .td-actions { text-align: right; }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; }

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.field label em { color: var(--danger); font-style: normal; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #0e1116;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
  appearance: none;
}
/* 数字输入框去掉默认上下箭头，保持与其它表单控件一致的观感 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input::placeholder, textarea::placeholder { color: #565b63; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(103, 158, 254, .15);
}
textarea { resize: vertical; min-height: 58px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2381858c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* 站点编辑行 */
.site-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.site-row .icon-btn { width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); }

/* 信息列表 */
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: 13.5px; }
.info-list dt { color: var(--muted); font-weight: 500; }
.info-list dd { word-break: break-all; }

/* ---------------- 弹窗 ---------------- */

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }

.sheet {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: min(500px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px;
  animation: sheetIn .18s ease;
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------------- 设置页 ---------------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: stretch;
}
.settings-grid .card { display: flex; flex-direction: column; }
.settings-grid .card form { display: flex; flex-direction: column; flex: 1; }
.settings-grid .card form > .btn { margin-top: auto; align-self: flex-start; }
.settings-grid .card:last-child { grid-column: 1 / -1; }

.form-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 10px;
}

.status-line { margin: 2px 0 12px; }
.status-line span {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.status-line .st-on  { color: var(--ok);   background: var(--ok-dim);   border-color: rgba(52, 211, 153, .3); }
.status-line .st-warn{ color: var(--warn); background: var(--warn-dim); border-color: rgba(254, 188, 46, .3); }
.status-line .st-off { color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--border); }

.add-site-btn { margin-top: 8px; }

/* ---------------- 登录页 ---------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(700px 320px at 50% -8%, rgba(103, 158, 254, .1), transparent 65%),
    #08090c;
}

.login-card {
  width: min(392px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
}

.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--accent);
  border-radius: 8px;
  color: #0b0d10;
}
.login-logo .icon { width: 24px; height: 24px; }
.login-brand h1 { font-size: 19px; font-weight: 600; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------------- 响应式：移动端 ---------------- */

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .overlay { opacity: 1; visibility: visible; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .container { padding: 16px 14px 80px; }
  .topbar-user .uname { display: none; }
}

@media (max-width: 767px) {
  body { font-size: 14.5px; }

  .page-head { align-items: stretch; }
  .page-head .btn { width: 100%; }

  .card { padding: 15px; border-radius: var(--radius); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-grid.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 20px; }

  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .card:last-child { grid-column: auto; }
  .settings-grid .card form > .btn { width: 100%; align-self: stretch; }

  /* 表格 → 卡片式列表 */
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
  }
  tbody tr:last-child { border-bottom: none; }
  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 15px;
    border-bottom: 1px dashed var(--border);
    text-align: right;
  }
  td:last-child { border-bottom: none; }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 500;
    font-size: 12.5px;
    flex-shrink: 0;
    text-align: left;
  }
  .td-actions { justify-content: space-between; }
  .row-actions { justify-content: flex-end; }
  .th-actions { display: none; }

  .remind-item { gap: 8px; }
  .remind-name { min-width: 100%; order: -1; }

  .site-row { grid-template-columns: 1fr 1.4fr; }
  .site-row .icon-btn { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 639px) {
  /* 弹窗 → 底部抽屉 */
  .modal.open { align-items: flex-end; }
  .sheet {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    animation: sheetUp .22s ease;
  }
  @keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
  .modal-foot .btn { flex: 1; }
  .modal-foot .btn.primary { order: -1; }
}

/* 移动端：便签搜索与弹窗 */
@media (max-width: 767px) {
  .head-actions { width: 100%; }
  .search-bar { width: 100%; }
  .search-bar input { flex: 1; width: auto; }
  .modal.note-modal .sheet { max-height: 92vh; }
  .modal.note-modal textarea { min-height: 42vh; }
}
