/* ============================================================
   个人工作台 - 样式表
   参考视频1：侧边栏交互  参考视频2：任务工作台仪表盘
   桌面 / 平板 / 手机 全响应式
   ============================================================ */

:root {
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --sidebar-bg: #111827;
  --sidebar-text: #cbd5e1;
  --text: #1e293b;
  --text-sub: #64748b;
  --text-light: #94a3b8;
  --border: #e8edf3;
  --shadow: 0 1px 3px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.04);
  --shadow-hover: 0 4px 12px rgba(15,23,42,.08), 0 16px 40px rgba(15,23,42,.08);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==================== 启动加载 ==================== */
.boot {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  transition: opacity .4s, visibility .4s;
}
.boot.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-logo { font-size: 48px; animation: spin 2s linear infinite; }
.boot-text { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.boot-sub { font-size: 12px; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 侧边栏 ==================== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width, 248px);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed { width: 72px; }
.sidebar-head {
  height: 72px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.brand-text { min-width: 0; white-space: nowrap; }
.brand-name { color: #fff; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: #64748b; font-size: 9px; letter-spacing: 1.2px; margin-top: 2px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .side-foot-btn span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-collapse-btn { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-icon-wrap { margin: 0; }
.sidebar.collapsed .side-foot-btn { justify-content: center; }
.sidebar.collapsed .side-user { justify-content: center; }
.sidebar.collapsed .sidebar-resizer { display: none; }
/* 折叠时隐藏子菜单残留的小圆点，保持窄条干净 */
.sidebar.collapsed:not(.peek) .nav-children { display: none; }

/* ===== 悬停临时展开（peek flyout）：窄条上鼠标移入即弹出完整菜单 ===== */
.sidebar.collapsed.peek {
  width: var(--sidebar-width, 248px) !important;
  box-shadow: 10px 0 40px rgba(0,0,0,.3);
}
.sidebar.collapsed.peek .brand-text,
.sidebar.collapsed.peek .sidebar-section-label,
.sidebar.collapsed.peek .nav-label,
.sidebar.collapsed.peek .nav-chevron,
.sidebar.collapsed.peek .side-foot-btn span,
.sidebar.collapsed.peek .user-info,
.sidebar.collapsed.peek .nav-badge { display: revert; }
.sidebar.collapsed.peek .sidebar-head { justify-content: space-between; padding: 0 16px; }
.sidebar.collapsed.peek .collapse-hint { display: none; }
.sidebar.collapsed.peek .nav-item { justify-content: flex-start; padding: 0 12px; }
.sidebar.collapsed.peek .side-foot-btn { justify-content: flex-start; }
.sidebar.collapsed.peek .side-user { justify-content: flex-start; }
.sidebar.collapsed.peek .sidebar-collapse-btn { display: inline-flex; }
.sidebar.collapsed.peek .sidebar-resizer { display: block; }

/* 折叠状态顶部显示的展开提示箭头 */
.collapse-hint {
  display: none;
  position: absolute; right: 8px; top: 22px;
  color: #64748b; font-size: 13px;
  animation: nudge 1.8s ease-in-out infinite;
  pointer-events: none;
}
.sidebar.collapsed:not(.peek) .collapse-hint { display: block; }
@keyframes nudge { 0%,100% { transform: translateX(0); opacity: .5; } 50% { transform: translateX(3px); opacity: 1; } }
.sidebar.collapsed .brand { cursor: pointer; }

.sidebar-collapse-btn { color: #64748b; flex-shrink: 0; }
.sidebar-collapse-btn:hover { color: #fff; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: rgba(148,163,184,.12); }

.sidebar-section-label {
  font-size: 10px; letter-spacing: 1.5px; color: #475569;
  padding: 22px 20px 10px; text-transform: uppercase; font-weight: 600;
  flex-shrink: 0;
}
.nav-list { flex: 1; overflow-y: auto; padding: 0 10px 10px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-list::-webkit-scrollbar { width: 4px; }
.nav-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* 滑动式选中指示器 */
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; margin: 2px 0; border-radius: 9px;
  color: var(--sidebar-text); cursor: pointer; user-select: none;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(148,163,184,.1); color: #fff; }
.nav-item.active { color: #fff; background: rgba(37,99,235,.16); font-weight: 550; }
/* 指示器：在侧边栏左侧滑动 */
.nav-indicator {
  position: absolute; left: -10px; top: 0; width: 3px; height: 42px;
  background: #60a5fa; border-radius: 0 3px 3px 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s;
  opacity: 0; pointer-events: none;
}
.nav-indicator.show { opacity: 1; }
.nav-icon-wrap { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon-wrap svg { width: 18px; height: 18px; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.nav-chevron { width: 14px; height: 14px; transition: transform .25s; color: #64748b; }
.nav-item.expanded .nav-chevron { transform: rotate(90deg); }
.nav-badge { font-size: 10px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 10px; }

/* 手风琴子菜单 */
.nav-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .25s;
  opacity: 0;
}
.nav-children.open { max-height: 400px; opacity: 1; }
.nav-subitem {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 36px; padding-left: 44px; font-size: 12.5px; color: #94a3b8;
  border-radius: 8px; cursor: pointer; transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav-subitem::before {
  content: ""; position: absolute; left: 22px; top: 0; bottom: 0;
  width: 1px; background: #334155;
}
.nav-subitem::after {
  content: ""; position: absolute; left: 19px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #334155; border: 2px solid var(--sidebar-bg);
}
.nav-subitem:hover { color: #fff; background: rgba(148,163,184,.08); }
.nav-subitem.active { color: #fff; background: rgba(37,99,235,.14); }
.nav-subitem.active::after { background: #60a5fa; }

/* 编辑菜单模式 */
.nav-list.editing .nav-item,
.nav-list.editing .nav-subitem { cursor: grab; }
.nav-list.editing .nav-item:active,
.nav-list.editing .nav-subitem:active { cursor: grabbing; }
.nav-list.editing .nav-item { background: rgba(148,163,184,.07); outline: 1px dashed rgba(148,163,184,.25); }
.nav-list.editing .nav-subitem { outline: 1px dashed rgba(148,163,184,.18); }
.sortable-ghost-nav { opacity: .35; background: rgba(37,99,235,.3) !important; }

.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.side-foot-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 38px; padding: 0 12px; border-radius: 8px; font-size: 13px;
  color: var(--sidebar-text); transition: background .18s, color .18s; white-space: nowrap;
}
.side-foot-btn:hover { background: rgba(148,163,184,.1); color: #fff; }
.side-foot-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.07); white-space: nowrap; }
.avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.user-info { min-width: 0; }
.user-name { color: #e2e8f0; font-size: 12.5px; font-weight: 550; }
.user-tip { color: #64748b; font-size: 10px; }
.sidebar-resizer { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 10; }
.sidebar-resizer:hover, .sidebar-resizer.dragging { background: var(--accent); }
.sidebar-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 99; opacity: 0; visibility: hidden; transition: .28s; }
.sidebar-mask.show { opacity: 1; visibility: visible; }

/* ==================== 主区域 ==================== */
.main-wrap { margin-left: var(--sidebar-width, 248px); height: 100vh; display: flex; flex-direction: column; transition: margin-left .28s cubic-bezier(.4,0,.2,1); }
.sidebar.collapsed ~ .main-wrap { margin-left: 72px; }
.mobile-topbar { display: none; }

.content { flex: 1; overflow-y: auto; padding: 24px 28px 60px; scroll-behavior: smooth; }
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

/* ==================== 顶部横幅 ==================== */
.hero {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 132px;
  background: #1e3a5f; margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(30,58,95,.18);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(30,58,95,.94) 0%, rgba(30,58,95,.82) 48%, rgba(30,58,95,.35) 100%),
    linear-gradient(135deg, #1e3a8a 0%, #1e40af 40%, #7c3aed 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 85% 20%, rgba(251,191,36,.45) 0%, transparent 25%),
    radial-gradient(circle at 92% 85%, rgba(244,114,182,.35) 0%, transparent 30%),
    radial-gradient(circle at 70% 90%, rgba(16,185,129,.25) 0%, transparent 35%);
}
.hero-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px; min-height: 132px; }
.hero-left { min-width: 0; }
.hero-title { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: .5px; margin-bottom: 6px; text-shadow: 0 2px 10px rgba(0,0,0,.15); }
.hero-slogan { color: rgba(255,255,255,.78); font-size: 13px; }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.hero-date { color: rgba(255,255,255,.9); font-size: 12px; background: rgba(255,255,255,.14); padding: 6px 14px; border-radius: 20px; backdrop-filter: blur(6px); }
.hero-focus { background: rgba(255,255,255,.92); border-radius: 10px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; backdrop-filter: blur(8px); }
.focus-label { font-size: 11px; color: var(--accent); background: var(--accent-light); padding: 3px 8px; border-radius: 5px; font-weight: 600; white-space: nowrap; }
.focus-text { font-size: 12.5px; color: var(--text); font-weight: 550; white-space: nowrap; }

/* ==================== 编辑工具条 ==================== */
.edit-toolbar { display: none; align-items: center; justify-content: space-between; gap: 16px; background: var(--accent-light); border: 1px dashed var(--accent); border-radius: 12px; padding: 10px 16px; margin-bottom: 18px; }
.edit-toolbar.show { display: flex; }
.edit-toolbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.edit-badge { color: var(--accent); font-weight: 650; font-size: 13px; white-space: nowrap; }
.edit-hint { color: var(--text-sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-toolbar-right { display: flex; gap: 8px; flex-shrink: 0; }

/* ==================== 栏目网格 ==================== */
.widget-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.widget {
  grid-column: span var(--span, 6);
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden; transition: box-shadow .2s, transform .2s, opacity .2s;
  min-width: 0;
}
.widget:hover { box-shadow: var(--shadow-hover); }
.widget.hidden-widget { opacity: .5; }
.widget.sortable-ghost { opacity: .35; background: var(--accent-light); border: 2px dashed var(--accent); }
.widget.sortable-chosen { box-shadow: 0 12px 32px rgba(37,99,235,.22); }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.widget-title-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.widget-mark { width: 3px; height: 15px; border-radius: 2px; background: var(--accent); flex-shrink: 0; }
.widget-title { font-size: 14.5px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-subtitle { font-size: 11px; color: var(--text-light); margin-left: 2px; white-space: nowrap; }
.widget-tools { display: none; align-items: center; gap: 2px; flex-shrink: 0; }
.edit-mode .widget-tools { display: flex; }
.widget-tool { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-sub); transition: .15s; }
.widget-tool:hover { background: var(--accent-light); color: var(--accent); }
.widget-tool.danger:hover { background: #fef2f2; color: #ef4444; }
.widget-tool svg { width: 16px; height: 16px; }
.widget-drag { cursor: grab; }
.widget-drag:active { cursor: grabbing; }
.widget-body { padding: 0 18px 18px; }

/* ==================== 统计卡片 ==================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { border-radius: 12px; padding: 16px 16px 14px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.35); }
.stat-blue { background: linear-gradient(135deg,#eff6ff,#dbeafe); }
.stat-green { background: linear-gradient(135deg,#ecfdf5,#d1fae5); }
.stat-purple { background: linear-gradient(135deg,#f5f3ff,#ede9fe); }
.stat-orange { background: linear-gradient(135deg,#fffbeb,#fef3c7); }
.stat-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-sub); font-weight: 550; }
.stat-icon { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: #fff; }
.stat-blue .stat-icon { color: var(--accent); }
.stat-green .stat-icon { color: #10b981; }
.stat-purple .stat-icon { color: #8b5cf6; }
.stat-orange .stat-icon { color: #f59e0b; }
.stat-value { font-size: 30px; font-weight: 750; color: var(--text); margin: 8px 0 2px; line-height: 1; letter-spacing: -.5px; }
.stat-foot { font-size: 10.5px; color: var(--text-light); }

/* ==================== 待办清单 ==================== */
.todo-add { display: flex; gap: 8px; margin-bottom: 14px; }
.input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #f8fafc;
  color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); background: #fff; }
.input::placeholder { color: #adb5c3; }
.btn { height: 36px; padding: 0 16px; border-radius: 8px; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: .18s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-ghost { background: #f1f5f9; color: var(--text-sub); }
.btn-ghost:hover { background: #e2e8f0; color: var(--text); }
.btn-ghost.danger { color: #ef4444; background: #fef2f2; }
.btn-ghost.danger:hover { background: #fee2e2; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; }

.todo-filters { display: flex; gap: 6px; margin-bottom: 10px; }
.filter-chip { font-size: 11.5px; padding: 4px 11px; border-radius: 20px; color: var(--text-sub); background: #f1f5f9; transition: .15s; }
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active { background: var(--accent); color: #fff; }
.todo-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.todo-list::-webkit-scrollbar { width: 4px; }
.todo-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; transition: background .15s; }
.todo-item:hover { background: #f8fafc; }
.todo-check {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; border: 1.8px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center; transition: .18s;
}
.todo-check:hover { border-color: var(--accent); }
.todo-item.done .todo-check { background: var(--accent); border-color: var(--accent); }
.todo-check svg { width: 12px; height: 12px; stroke-width: 3; color: #fff; opacity: 0; }
.todo-item.done .todo-check svg { opacity: 1; }
.todo-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text-light); }
.todo-tag { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: #f1f5f9; color: var(--text-sub); flex-shrink: 0; }
.todo-priority { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.priority-high { background: #ef4444; }
.priority-mid { background: #f59e0b; }
.priority-low { background: #10b981; }
.todo-del { opacity: 0; width: 22px; height: 22px; border-radius: 5px; color: var(--text-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .15s; }
.todo-item:hover .todo-del { opacity: 1; }
.todo-del:hover { background: #fee2e2; color: #ef4444; }
.todo-del svg { width: 14px; height: 14px; }
.todo-empty { text-align: center; color: var(--text-light); font-size: 12px; padding: 24px 0; }

/* ==================== 日程 ==================== */
.schedule-list { display: flex; flex-direction: column; }
.schedule-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.schedule-item:not(:last-child)::before { content: ""; position: absolute; left: 40px; top: 30px; bottom: -10px; width: 1px; background: var(--border); }
.schedule-time { width: 42px; flex-shrink: 0; font-size: 11.5px; color: var(--accent); font-weight: 650; padding-top: 1px; }
.schedule-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--accent-light); margin-top: 4px; flex-shrink: 0; z-index: 1; }
.schedule-content { flex: 1; min-width: 0; }
.schedule-text { font-size: 12.5px; color: var(--text); }
.schedule-tag { font-size: 10px; color: var(--text-light); margin-top: 2px; }
.schedule-add { display: flex; gap: 6px; margin-top: 10px; }
.schedule-add .input { height: 32px; }
.schedule-add input[type=time] { width: 84px; flex-shrink: 0; height: 32px; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; color: var(--text); font-size: 12px; }

/* ==================== 项目进度 ==================== */
.proj-list { display: flex; flex-direction: column; gap: 16px; }
.proj-item { display: flex; flex-direction: column; gap: 7px; }
.proj-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.proj-name { font-weight: 550; }
.proj-meta { color: var(--text-light); font-size: 11px; }
.proj-bar { height: 7px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.proj-bar-inner { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.proj-add { display: flex; gap: 6px; margin-top: 4px; }

/* ==================== 习惯打卡 ==================== */
.habit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.habit-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; transition: .18s; cursor: pointer; }
.habit-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.habit-card.checked { background: var(--accent-light); border-color: var(--accent); }
.habit-icon { font-size: 24px; margin-bottom: 6px; }
.habit-name { font-size: 12px; font-weight: 550; }
.habit-streak { font-size: 10.5px; color: var(--text-light); margin-top: 4px; }
.habit-card.checked .habit-streak { color: var(--accent); }
.habit-add { display: flex; gap: 6px; margin-top: 12px; }

/* ==================== 笔记 ==================== */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.note-card { border-radius: 10px; padding: 12px; position: relative; min-height: 100px; display: flex; flex-direction: column; }
.note-yellow { background: #fef9c3; }
.note-blue { background: #dbeafe; }
.note-green { background: #dcfce7; }
.note-pink { background: #fce7f3; }
.note-text { font-size: 12px; color: #334155; flex: 1; word-break: break-word; white-space: pre-wrap; line-height: 1.6; }
.note-time { font-size: 10px; color: #64748b; margin-top: 8px; }
.note-del { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; opacity: 0; color: #64748b; transition: .15s; }
.note-card:hover .note-del { opacity: 1; }
.note-del:hover { background: rgba(0,0,0,.06); color: #ef4444; }
.note-del svg { width: 14px; height: 14px; }
.note-add { margin-top: 10px; display: flex; gap: 6px; }
.note-add textarea { flex: 1; min-height: 40px; resize: vertical; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; font-size: 12px; }

/* ==================== 书签 ==================== */
.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.bookmark-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 13px 6px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; transition: .18s; position: relative; }
.bookmark-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.bookmark-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.bookmark-name { font-size: 11.5px; color: var(--text); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-del { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 4px; display: none; align-items: center; justify-content: center; color: var(--text-light); font-size: 14px; line-height: 1; }
.edit-mode .bookmark-del { display: flex; }
.bookmark-del:hover { background: #fee2e2; color: #ef4444; }
.bookmark-add { display: flex; gap: 6px; margin-top: 12px; }
.bookmark-add .input { height: 32px; }

/* ==================== 时钟 ==================== */
.clock-box { text-align: center; padding: 16px 0 8px; }
.clock-time { font-size: 48px; font-weight: 700; letter-spacing: 2px; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, var(--accent), #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.clock-date { font-size: 13px; color: var(--text-sub); margin-top: 10px; }
.clock-week { color: var(--accent); font-weight: 600; }

/* ==================== 空状态 / 页脚 ==================== */
.empty-page { text-align: center; padding: 80px 20px; color: var(--text-sub); }
.empty-icon { font-size: 48px; color: #cbd5e1; margin-bottom: 12px; }
.empty-page h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-page p { font-size: 13px; margin-bottom: 20px; }
.page-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-light); }

/* ==================== 弹窗 ==================== */
.modal-mask { position: fixed; inset: 0; z-index: 500; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: .22s; backdrop-filter: blur(3px); }
.modal-mask.show { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 520px; max-height: 86vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.2); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); transition: transform .22s; }
.modal-mask.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-close { color: var(--text-sub); }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-tip { font-size: 12px; color: var(--text-sub); margin-bottom: 14px; line-height: 1.6; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field input { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
/* label.field 是纵向 flex 容器，.input 的 flex:1 会把输入框压到最小高度（约21px）；此处取消伸缩，保证统一 38px */
.field > .input { flex: none; width: 100%; height: 38px; box-sizing: border-box; }
.field input:focus { border-color: var(--accent); }
.color-row { display: flex; gap: 10px; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; transition: .15s; }
.color-dot.active { border-color: var(--text); transform: scale(1.15); box-shadow: 0 0 0 2px #fff inset; }
.setting-actions { margin-top: 8px; }
.setting-note {
  font-size: 11.5px; color: var(--text-light); line-height: 1.6;
  padding: 10px 12px; background: var(--accent-light); border-radius: 8px; margin-top: 4px;
}

/* 栏目库 */
.widget-library { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: .18s; text-align: left; }
.lib-item:hover { border-color: var(--accent); background: var(--accent-light); transform: translateY(-1px); }
.lib-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.lib-item:hover .lib-icon { background: var(--accent); color: #fff; }
.lib-info { min-width: 0; }
.lib-name { font-size: 12.5px; font-weight: 600; }
.lib-desc { font-size: 10.5px; color: var(--text-light); margin-top: 2px; }

/* ==================== 提示条 ==================== */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(15,23,42,.9); color: #fff; padding: 10px 20px; border-radius: 9px; font-size: 12.5px; z-index: 800; opacity: 0; visibility: hidden; transition: .25s; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ==================== 响应式：平板 ==================== */
@media (max-width: 1024px) {
  .content { padding: 20px 20px 50px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: 22px 24px; }
}

/* 底部导航默认隐藏，仅手机端显示 */
.bottom-nav { display: none; }

/* ==================== 响应式：手机 ==================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 270px !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: 270px !important; }
  .sidebar.collapsed .brand-text, .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-chevron, .sidebar.collapsed .side-foot-btn span,
  .sidebar.collapsed .user-info, .sidebar.collapsed .nav-badge { display: revert; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar.collapsed .sidebar-head { justify-content: space-between; padding: 0 16px; }
  .sidebar.collapsed .sidebar-collapse-btn { display: inline-flex; }
  .sidebar.collapsed .side-foot-btn { justify-content: flex-start; }
  .sidebar.collapsed .side-user { justify-content: flex-start; }
  .sidebar-resizer { display: none; }

  .main-wrap, .sidebar.collapsed ~ .main-wrap { margin-left: 0; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--border);
    flex-shrink: 0; position: sticky; top: 0; z-index: 50;
    padding-top: env(safe-area-inset-top);
  }
  .mobile-title { font-size: 15px; font-weight: 650; }
  .content { padding: 12px 12px 78px; }

  .hero { min-height: 110px; border-radius: 14px; margin-bottom: 14px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 18px; min-height: 110px; }
  .hero-title { font-size: 21px; }
  .hero-slogan { font-size: 11.5px; }
  .hero-right { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
  .hero-date { font-size: 10.5px; padding: 5px 10px; }
  .hero-focus { padding: 7px 10px; gap: 6px; }
  .focus-label { font-size: 10px; padding: 2px 6px; }
  .focus-text { font-size: 11px; }

  .edit-toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .edit-toolbar-left { flex-direction: column; align-items: flex-start; gap: 2px; }
  .edit-hint { white-space: normal; font-size: 11px; }
  .edit-toolbar-right { justify-content: stretch; }
  .edit-toolbar-right .btn { flex: 1; }

  /* 手机端所有栏目占满宽度（除非用户主动设为全宽） */
  .widget-grid { grid-template-columns: repeat(12, 1fr); gap: 12px; }
  .widget { grid-column: span 12 !important; }
  .widget-head { padding: 14px 14px 10px; }
  .widget-body { padding: 0 14px 14px; }
  .widget-tools { display: flex !important; }  /* 手机常显工具，方便编排 */
  .widget-title { font-size: 13.5px; }

  .stat-value { font-size: 26px; }
  .clock-time { font-size: 40px; }
  .todo-del { opacity: 1; }
  .note-del { opacity: 1; }
  .habit-grid { grid-template-columns: repeat(2, 1fr); }
  .bookmark-grid { grid-template-columns: repeat(4, 1fr); }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); justify-content: space-around; align-items: center;
  }
  .bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--text-light); padding: 6px 0; }
  .bottom-nav-item.active { color: var(--accent); }
  .bottom-nav-item svg { width: 21px; height: 21px; }

  .modal { max-height: 90vh; border-radius: 16px 16px 0 0; align-self: flex-end; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .profile-card { padding: 20px 18px; }
  .widget-library { grid-template-columns: 1fr 1fr; }
  .page-foot { font-size: 10px; }
}

/* 手机端非常窄 */
@media (max-width: 380px) {
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 22px; }
  .bookmark-grid { grid-template-columns: repeat(3, 1fr); }
  .widget-library { grid-template-columns: 1fr; }
}

/* 小屏笔记本竖屏侧边栏 */
@media (min-width: 769px) and (max-width: 1100px) {
  .sidebar { width: 210px; }
  .main-wrap { margin-left: 210px; }
  .content { padding: 18px 18px 50px; }
}

/* ============================================================
   提醒系统样式
   ============================================================ */
/* 顶栏动作区 */
.topbar-actions { display: flex; align-items: center; gap: 4px; }

/* 铃铛按钮 + 角标 */
.bell-btn, .hero-bell { position: relative; }
.bell-badge {
  position: absolute; right: -2px; top: -2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.hero-top-actions { display: flex; align-items: center; gap: 10px; }
.hero-bell {
  width: 32px; height: 32px; border-radius: 8px; color: #fff;
  background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s; position: relative;
}
.hero-bell:hover { background: rgba(255,255,255,.28); }
.hero-bell svg { width: 17px; height: 17px; }
.hero-bell .bell-badge { box-shadow: 0 0 0 2px rgba(30,58,95,.5); right: -3px; top: -3px; }

/* 提醒设置弹窗 */
.modal-sm { max-width: 460px; }
.reminder-task {
  background: var(--accent-light); border-radius: 9px; padding: 12px 14px;
  font-size: 13px; color: var(--text); font-weight: 550; margin-bottom: 18px;
  border-left: 3px solid var(--accent);
}
.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: .16s; user-select: none;
}
.channel-item:hover { border-color: var(--accent); background: var(--accent-light); }
.channel-item.checked { border-color: var(--accent); background: var(--accent-light); }
.channel-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.8px solid #cbd5e1;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .16s;
}
.channel-item.checked .channel-check { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 12px; }
.channel-icon { font-size: 19px; flex-shrink: 0; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 13px; font-weight: 600; }
.channel-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.channel-status { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.status-ok { background: #dcfce7; color: #15803d; }
.status-warn { background: #fef3c7; color: #b45309; }
.reminder-note { font-size: 11.5px; color: var(--text-sub); margin-top: 12px; line-height: 1.6; }
.reminder-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px;
  color: var(--accent); background: var(--accent-light); padding: 2px 7px;
  border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.reminder-badge.fired { color: #15803d; background: #dcfce7; }

/* 邮箱配置 */
.email-config { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; }
.email-config-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.email-config-head span { font-size: 13.5px; font-weight: 650; }
.email-config-head small { font-size: 11px; color: var(--text-light); }
.email-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.email-grid .field { margin-bottom: 0; }
.email-grid .field-wide { grid-column: 1 / -1; }
.email-grid .field > span { font-size: 11.5px; }
.email-grid .field input { height: 34px; font-size: 12.5px; background: #fff; }
.email-tip { font-size: 10.5px; color: var(--text-light); line-height: 1.6; margin: 12px 0 10px; }

/* 通知中心浮层 */
.notice-panel {
  position: fixed; right: 20px; top: 74px; width: 360px; max-width: calc(100vw - 32px);
  max-height: 70vh; background: #fff; border-radius: 14px; z-index: 450;
  box-shadow: 0 20px 60px rgba(15,23,42,.22); display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .22s;
}
.notice-panel.show { opacity: 1; visibility: visible; transform: none; }
.notice-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.notice-head h3 { font-size: 15px; font-weight: 650; }
.notice-head-actions { display: flex; align-items: center; gap: 6px; }
.notice-list { overflow-y: auto; padding: 6px 0; }
.notice-item { display: flex; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--border); position: relative; }
.notice-item:last-child { border-bottom: none; }
.notice-item.unread { background: var(--accent-light); }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.notice-item:not(.unread) .notice-dot { background: #cbd5e1; }
.notice-content { flex: 1; min-width: 0; }
.notice-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notice-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.notice-ch { font-size: 12px; margin-top: 5px; }
.notice-empty { text-align: center; color: var(--text-light); font-size: 12.5px; padding: 40px 20px; }
.notice-mask { position: fixed; inset: 0; z-index: 440; display: none; }
.notice-mask.show { display: block; }

/* 到点提醒弹窗 */
.alert-mask {
  position: fixed; inset: 0; z-index: 900; background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: .22s; backdrop-filter: blur(4px);
}
.alert-mask.show { opacity: 1; visibility: visible; }
.alert-box {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px;
  padding: 30px 26px 24px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.3);
  transform: scale(.94); transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.alert-mask.show .alert-box { transform: scale(1); }
.alert-icon { font-size: 52px; margin-bottom: 10px; animation: ring .6s ease-in-out infinite alternate; }
@keyframes ring { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.alert-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.alert-text { font-size: 14px; color: var(--text); background: var(--accent-light); padding: 14px; border-radius: 10px; line-height: 1.6; }
.alert-channels { font-size: 12px; color: var(--text-light); margin: 14px 0 20px; }
.alert-box .btn { width: 100%; }

@media (max-width: 768px) {
  .notice-panel { right: 8px; left: 8px; top: 56px; width: auto; max-height: 74vh; }
  .email-grid { grid-template-columns: 1fr; }
}

/* 任务提醒按钮 */
.todo-bell {
  width: 24px; height: 24px; border-radius: 5px; color: var(--text-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: .15s; opacity: .65;
}
.todo-bell:hover { background: var(--accent-light); color: var(--accent); opacity: 1; }
.todo-bell svg { width: 16px; height: 16px; }

/* ============================================================
   密码保险箱样式
   ============================================================ */
.vault-view { margin-top: 0; }

/* 未解锁 */
.vault-lock {
  max-width: 440px; margin: 30px auto; background: var(--card-bg);
  border-radius: 18px; padding: 40px 34px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.vault-lock-icon { font-size: 56px; margin-bottom: 14px; }
.vault-lock h2 { font-size: 22px; margin-bottom: 8px; }
.vault-lock-sub { font-size: 12.5px; color: var(--text-sub); line-height: 1.7; margin-bottom: 26px; }
.vault-form { display: flex; flex-direction: column; gap: 14px; }
.vault-form .field { text-align: left; }
.vault-hint { font-size: 11px; color: #b45309; background: #fffbeb; border-radius: 8px; padding: 10px 12px; margin-top: 16px; line-height: 1.6; text-align: left; }

/* 已解锁主界面 */
.vault-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.vault-search { flex: 1; min-width: 200px; }
.vault-search .input { width: 100%; }
.vault-toolbar-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* 分类筛选 */
.vault-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.vault-cats::-webkit-scrollbar { height: 4px; }
.vault-cats::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.vault-cat {
  display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 20px;
  background: #fff; border: 1px solid var(--border); font-size: 12px; white-space: nowrap;
  cursor: pointer; transition: .15s; flex-shrink: 0;
}
.vault-cat:hover { border-color: var(--accent); }
.vault-cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.vault-cat .cat-count { font-size: 10px; opacity: .7; }

/* 条目列表 */
.vault-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.vault-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 16px; cursor: pointer; transition: .18s; position: relative;
}
.vault-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.vi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vi-cat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.vi-info { flex: 1; min-width: 0; }
.vi-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-meta { font-size: 11px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-remind { position: absolute; right: 12px; top: 12px; font-size: 10px; background: #fef3c7; color: #b45309; padding: 2px 7px; border-radius: 10px; }
.vault-empty { text-align: center; padding: 60px 20px; color: var(--text-light); grid-column: 1 / -1; }
.vault-empty .empty-icon { font-size: 44px; }

/* 条目编辑 */
.vault-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vault-field-grid .field { margin-bottom: 0; }
#viNotes { resize: vertical; min-height: 70px; line-height: 1.6; }
.pwd-input { display: flex; gap: 6px; }
.pwd-input input { flex: 1; min-width: 0; }
.pwd-input button {
  width: 38px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc;
  font-size: 16px; flex-shrink: 0; transition: .15s;
}
.pwd-input button:hover { background: var(--accent-light); border-color: var(--accent); }
#viCategory, #viNotes.vi-select { height: 38px; }

/* 条目详情 */
.detail-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 76px; flex-shrink: 0; font-size: 12px; color: var(--text-light); }
.detail-value { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; }
.detail-value a { color: var(--accent); text-decoration: none; }
.detail-pwd { font-family: ui-monospace, Consolas, monospace; background: #f1f5f9; padding: 4px 8px; border-radius: 6px; }
.detail-actions { display: inline-flex; gap: 6px; margin-left: 6px; }
.detail-actions button { font-size: 11px; color: var(--accent); padding: 2px 6px; border-radius: 5px; }
.detail-actions button:hover { background: var(--accent-light); }

/* 恢复码 */
.recovery-code {
  font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700;
  letter-spacing: 1px; text-align: center; background: #f8fafc; border: 2px dashed var(--accent);
  border-radius: 10px; padding: 18px; margin: 14px 0; user-select: all; color: var(--text);
}

/* 安全体检 */
.check-section { margin-bottom: 18px; }
.check-section h4 { font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.check-good { color: #15803d; }
.check-warn { color: #b45309; }
.check-item { font-size: 12px; padding: 8px 10px; border-radius: 7px; background: #f8fafc; margin-bottom: 6px; }
.check-item.warn { background: #fffbeb; color: #92400e; }
.check-summary { display: flex; gap: 12px; margin-bottom: 20px; }
.check-stat { flex: 1; text-align: center; padding: 14px; background: var(--accent-light); border-radius: 10px; }
.check-stat .n { font-size: 24px; font-weight: 700; color: var(--accent); }
.check-stat .l { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* 备份列表 / 审计日志 */
.backup-list { display: flex; flex-direction: column; gap: 6px; }
.backup-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 8px 10px; background: #f8fafc; border-radius: 7px; }
.backup-item .bn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-item button { color: #ef4444; font-size: 11px; }
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 10px; font-size: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.audit-item:last-child { border-bottom: none; }
.audit-time { color: var(--text-light); width: 130px; flex-shrink: 0; font-size: 11px; }
.audit-action { font-weight: 550; }
.audit-detail { color: var(--text-light); font-size: 11px; margin-left: 6px; }

@media (max-width: 768px) {
  .vault-lock { margin: 16px auto; padding: 28px 20px; }
  .vault-toolbar { flex-direction: column; align-items: stretch; }
  .vault-search { width: 100%; }
  .vault-toolbar-btns { justify-content: space-between; }
  .vault-toolbar-btns .btn { flex: 1; padding: 0 8px; font-size: 11px; }
  .vault-items { grid-template-columns: 1fr; }
  .vault-field-grid { grid-template-columns: 1fr; }
  .audit-time { width: auto; }
  .audit-item { flex-direction: column; gap: 2px; }
}

/* 任务分类 */
.todo-cat-select { flex: 0 0 92px; padding: 0 6px; font-size: 12px; }
.todo-cat-dot { font-size: 11px; width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 安全等级标识 */
.lv-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-right: 1px; }
.vi-level {
  position: absolute; right: 12px; bottom: 12px; font-size: 10px; font-weight: 650;
  padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}

/* ============================================================
   用户账户 / SaaS
   ============================================================ */
.side-user { position: relative; }
.user-logout {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 6px; color: var(--text-light);
  font-size: 17px; opacity: 0; transition: .16s;
}
.side-user:hover .user-logout { opacity: 1; }
.user-logout:hover { background: var(--accent-light); color: var(--accent); }
/* 我的：个人资料中心（独立页面） */
.profile-view { margin-top: 0; }
.profile-card {
  max-width: 560px; margin: 0 auto; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 16px; padding: 26px 28px;
  box-shadow: var(--shadow);
}
.profile-title { font-size: 20px; margin-bottom: 4px; }
.profile-sub { font-size: 12px; color: var(--text-sub); margin-bottom: 20px; }

.user-profile-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--accent-light); border-radius: 12px; margin-bottom: 18px;
}
.avatar-lg { width: 50px; height: 50px; font-size: 20px; flex-shrink: 0; }
.user-divider {
  font-size: 12px; font-weight: 650; color: var(--text-sub);
  margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--border);
}
.profile-actions { display: flex; gap: 10px; margin-top: 16px; }
.profile-actions .btn { flex: 1; height: 38px; min-width: 0; }
.avatar-editable { cursor: pointer; position: relative; transition: filter .16s; }
.avatar-editable:hover { filter: brightness(.9); }
.avatar-editable::after {
  content: '✎'; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-picker {
  background: var(--bg-soft, #f8fafc); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 18px;
}
.avatar-picker-title { font-size: 12px; font-weight: 650; color: var(--text-sub); margin-bottom: 10px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.avatar-opt {
  width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: transform .14s; padding: 0;
}
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt.selected { border-color: var(--accent); }
.field-tip {
  font-size: 11.5px; color: var(--text-light); line-height: 1.6;
  margin: -12px 0 18px; padding: 8px 10px; background: var(--accent-light);
  border-radius: 8px;
}
