/* ============================================
   admin.css — 墨记 v3 设计系统
   设计语言：现代简约 · 靛蓝主色 · 柔和阴影 · 微交互
   ============================================ */

:root {
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --primary-dark: #4338CA;
  --primary-hover: #6366F1;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;
  --bg: #F1F5F9;
  --bg-soft: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --success: #10B981;
  --success-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .1);
  --transition: all .2s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: pageIn .35s cubic-bezier(.4, 0, .2, 1);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 28px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
  transition: var(--transition);
}
.brand:hover .logo { transform: scale(1.05); box-shadow: 0 6px 18px rgba(79, 70, 229, .4); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.brand-text span { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--card); color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: var(--transition);
  font-family: inherit; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .25);
}
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--bg-soft); color: var(--text); box-shadow: none; }
.btn.sm { height: 30px; padding: 0 14px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { color: var(--danger); background: var(--danger-light); border-color: transparent; }
.btn.danger:hover { background: #FECACA; color: #B91C1C; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 32px 28px 80px; }
.container.narrow { max-width: 520px; }

.empty {
  text-align: center; padding: 72px 32px;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}
.empty .big { font-size: 48px; margin-bottom: 14px; opacity: .7; }
.empty h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text); }
.empty p { margin: 0 0 22px; font-size: 14px; color: var(--text-muted); }

.settings-card {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 28px 30px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.settings-card:hover { box-shadow: var(--shadow); }
.settings-card h2 { margin: 0 0 20px; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-light); font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }
.info-value { color: var(--text); font-weight: 600; }

.fld { margin-bottom: 18px; }
.fld label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 7px; }
.fld input, .fld select, .fld textarea {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit;
  background: var(--bg-soft); color: var(--text);
  transition: var(--transition);
}
.fld input:focus, .fld select:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.msg { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; font-weight: 500; }
.msg.err { background: var(--danger-light); color: #B91C1C; border: 1px solid #FECACA; }
.msg.ok { background: var(--success-light); color: #047857; border: 1px solid #A7F3D0; }
.hint { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; }
.hint.warning { color: var(--warning); font-weight: 500; }

.avatar-section { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.avatar-display { flex-shrink: 0; }
.avatar-img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-light); }
.avatar-placeholder {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.avatar-form { display: flex; align-items: center; gap: 10px; }

.tabs {
  display: inline-flex; gap: 3px; margin-bottom: 20px;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow-sm);
}
.tab {
  padding: 9px 22px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none; transition: var(--transition);
}
.tab:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(79, 70, 229, .25); }

.admin-layout { display: flex; gap: 28px; max-width: 1200px; margin: 0 auto; padding: 28px 28px 80px; align-items: flex-start; }
.admin-sidebar { width: 210px; flex-shrink: 0; position: sticky; top: 80px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 22px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none; transition: var(--transition);
}
.side-link:hover { background: var(--card); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(79, 70, 229, .25); }
.side-section {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.side-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.tag-list { list-style: none; padding: 0; margin: 0; }
.tag-list li { margin-bottom: 2px; }
.side-tag {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
  color: var(--text-secondary); text-decoration: none; transition: var(--transition);
}
.side-tag:hover { background: var(--bg-soft); text-decoration: none; }
.side-tag.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.tag-count { font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.side-tag.active .tag-count { background: #fff; color: var(--primary); }
.side-empty { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.clear-tag { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--primary); font-weight: 500; }
.admin-content { flex: 1; min-width: 0; }
.content-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.search-form { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.search-form input[type=search] {
  flex: 1; height: 38px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; outline: none; font-family: inherit;
  background: var(--card); transition: var(--transition);
}
.search-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.sort-group {
  display: flex; gap: 2px; background: var(--card);
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 3px;
}
.sort-btn { padding: 6px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.sort-btn:hover { background: var(--bg-soft); text-decoration: none; }
.sort-btn.active { background: var(--primary); color: #fff; }
.filter-hint { font-size: 13.5px; color: var(--text-muted); margin: 0 0 16px; }
.filter-hint strong { color: var(--primary); }

.note-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.note-card-wrap { position: relative; }
.note-card {
  display: block; background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 20px 22px; text-decoration: none;
  transition: var(--transition); height: 100%; box-shadow: var(--shadow-sm);
}
.note-card:hover {
  border-color: var(--primary-light); box-shadow: var(--shadow);
  transform: translateY(-2px); text-decoration: none;
}
.note-card-head { margin-bottom: 10px; }
.note-card .note-title {
  font-size: 15.5px; font-weight: 700; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; letter-spacing: -.2px;
}
.note-excerpt {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 14px; min-height: 66px;
}
.note-card .note-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }
.note-card-tools { display: flex; gap: 6px; padding: 10px 2px 0; flex-wrap: wrap; }

.todo-add-card {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 22px 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.todo-add-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.todo-input {
  flex: 1; min-width: 220px; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit;
  background: var(--bg-soft); transition: var(--transition);
}
.todo-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.todo-input-sm {
  width: 150px; height: 42px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; outline: none; font-family: inherit;
  background: var(--bg-soft); transition: var(--transition);
}
.todo-input-sm:focus { border-color: var(--primary); background: #fff; }
.todo-select {
  height: 42px; padding: 0 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none;
  background: var(--bg-soft); font-family: inherit; cursor: pointer;
}
.todo-filter { display: flex; gap: 3px; margin-bottom: 16px; }
.todo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.todo-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px 20px;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.todo-item:hover { box-shadow: var(--shadow); }
.todo-item.completed { opacity: .5; }
.todo-item.completed .todo-title { text-decoration: line-through; }
.todo-item.priority-3 { border-left: 3px solid var(--danger); }
.todo-item.priority-1 { border-left: 3px solid var(--primary); }
.todo-item.priority-0 { border-left: 3px solid var(--border); }
.todo-check { position: relative; cursor: pointer; flex-shrink: 0; }
.todo-check input { display: none; }
.checkmark {
  display: inline-block; width: 22px; height: 22px;
  border: 2px solid var(--border); border-radius: 6px;
  position: relative; transition: var(--transition);
}
.todo-check:hover .checkmark { border-color: var(--primary); }
.todo-check input:checked + .checkmark { background: var(--primary); border-color: var(--primary); }
.todo-check input:checked + .checkmark::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 11px; border: solid #fff;
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.todo-content { flex: 1; min-width: 0; }
.todo-title { font-size: 14.5px; font-weight: 500; color: var(--text); display: block; }
.todo-meta { display: flex; gap: 12px; margin-top: 5px; font-size: 12px; color: var(--text-muted); }
.todo-project { background: var(--primary-light); color: var(--primary); padding: 2px 9px; border-radius: 5px; font-weight: 500; }
.todo-due { color: var(--warning); font-weight: 500; }

.trash-hint { font-size: 13.5px; color: var(--text-muted); margin: 0 0 18px; }
.trash-section { margin-bottom: 26px; }
.trash-sec-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.badge.draft { background: var(--accent-light); color: #B45309; }
.badge.pub { background: var(--primary-light); color: var(--primary); }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 18px 22px;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.note-item:hover { box-shadow: var(--shadow); border-color: var(--border); }
.note-main { flex: 1; min-width: 0; }
.note-item .note-title {
  display: block; font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-item .note-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-muted); }
.note-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 18px; }

.admin-stats { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 130px; background: var(--card);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 22px 20px; text-align: center; box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; display: block; }
.table-card {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  background: var(--bg-soft); padding: 14px 16px; text-align: left;
  font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-light);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-soft); }
.table-actions { white-space: nowrap; }
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.role-badge.admin { background: var(--primary-light); color: var(--primary); }
.role-badge.user { background: var(--bg); color: var(--text-secondary); }
.text-muted { color: var(--text-muted); font-size: 12.5px; }

.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F1F5F9 50%, #FEF3C7 100%);
}
.auth-card {
  width: 400px; max-width: 92vw; background: var(--card);
  border: 1px solid var(--border-light); border-radius: 22px;
  padding: 40px 36px 32px; box-shadow: var(--shadow-lg);
  animation: cardIn .4s cubic-bezier(.4, 0, .2, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-head { text-align: center; margin-bottom: 30px; }
.auth-logo {
  display: inline-flex; width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-size: 28px; font-weight: 800;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(79, 70, 229, .35);
}
.auth-head h1 { margin: 16px 0 5px; font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.auth-head p { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.auth-fld { margin-bottom: 18px; }
.auth-fld label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.auth-fld input {
  width: 100%; height: 46px; padding: 0 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14.5px; outline: none; font-family: inherit;
  background: var(--bg-soft); transition: var(--transition);
}
.auth-fld input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.auth-btn {
  width: 100%; height: 46px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px; font-family: inherit;
  box-shadow: 0 3px 12px rgba(79, 70, 229, .3);
  transition: var(--transition);
}
.auth-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(79, 70, 229, .4); }
.auth-btn:active { transform: translateY(0); }
.auth-err { background: var(--danger-light); border: 1px solid #FECACA; color: #B91C1C; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; font-weight: 500; }
.auth-foot { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.auth-foot a { color: var(--primary); font-weight: 500; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 6px;
  color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.auth-btn.oauth-btn {
  background: linear-gradient(135deg, #4F46E5, #8B5CF6); margin-top: 0;
  text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.auth-btn.oauth-btn:hover { background: linear-gradient(135deg, #4F46E5, #8B5CF6); }
.auth-tip { text-align: center; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }

.foot { text-align: center; padding: 24px; font-size: 12.5px; color: var(--text-muted); }

[data-theme="dark"] {
  --bg: #0F172A;
  --bg-soft: #1E293B;
  --card: #1E293B;
  --text: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: #334155;
  --border-light: #293548;
  --primary-light: rgba(79, 70, 229, .2);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .topbar { background: rgba(30, 41, 59, .85); }
[data-theme="dark"] .btn { background: var(--card); color: var(--text-secondary); border-color: var(--border); }
[data-theme="dark"] .btn.ghost { background: transparent; border-color: transparent; }
[data-theme="dark"] .btn.ghost:hover { background: var(--bg-soft); }
[data-theme="dark"] .fld input, [data-theme="dark"] .fld select,
[data-theme="dark"] .todo-input, [data-theme="dark"] .todo-input-sm, [data-theme="dark"] .todo-select {
  background: var(--bg); border-color: var(--border); color: var(--text);
}
[data-theme="dark"] .data-table th { background: var(--bg); }
[data-theme="dark"] .data-table tr:hover td { background: var(--bg); }
[data-theme="dark"] .auth-body { background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 50%, #422006 100%); }

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; padding: 20px 16px 60px; }
  .admin-sidebar { width: 100%; position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .container { padding: 24px 16px 60px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; height: 54px; }
  .top-actions .btn { padding: 0 12px; font-size: 12.5px; height: 32px; }
  .note-item { flex-direction: column; align-items: flex-start; gap: 14px; }
  .note-actions { margin-left: 0; }
  .todo-input-sm { width: 100%; }
  .todo-add-form .btn { width: 100%; }
  .settings-card { padding: 22px 20px; }
  .auth-card { padding: 32px 24px 26px; }
}

/* ---- 用户菜单（后台顶栏） ---- */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; transition: var(--transition);
  font-family: inherit;
}
.user-menu-trigger:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.user-menu-trigger .user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  object-fit: cover;
}
.user-menu-trigger .user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-menu-trigger .user-caret { font-size: 10px; color: var(--text-muted); }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--card);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: var(--transition); z-index: 100;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a {
  display: block; padding: 9px 14px; border-radius: 7px;
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  transition: var(--transition);
}
.user-dropdown a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.user-dropdown a.danger { color: var(--danger); }
.user-dropdown a.danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 5px 8px; }

/* 系统升级页：步骤清单 */
.guide-list { margin: 4px 0 18px; padding-left: 22px; font-size: 13.5px; line-height: 2; color: var(--text); }
.guide-list li { margin-bottom: 2px; }
.guide-list code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }
