/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ===== Variables ===== */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.10);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --nav-h: 60px;
  --header-h: 56px;
  --max-w: 640px;
}

[data-theme="dark"] {
  --primary: #34d399;
  --primary-dark: #10b981;
  --primary-light: #064e3b;
  --danger: #f87171;
  --danger-light: #7f1d1d;
  --warning: #fbbf24;
  --warning-light: #78350f;
  --info: #60a5fa;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --text-lighter: #64748b;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ===== Header ===== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}
.app-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.header-actions {
  display: flex;
  gap: 4px;
}
.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(0.92); }

/* ===== Content ===== */
.app-content {
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: calc(var(--nav-h) + 24px);
  padding-left: 12px;
  padding-right: 12px;
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
}

/* ===== Navigation ===== */
.app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  max-width: var(--max-w);
  margin: 0 auto;
  transition: background 0.3s, border-color 0.3s;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-lighter);
  cursor: pointer;
  font-size: 11px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn:active { transform: scale(0.95); }
.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 11px; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: background 0.3s, box-shadow 0.3s;
}

/* ===== View Header ===== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 4px 0;
}
.view-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-group input[type="datetime-local"] { padding-right: 8px; }
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-check label { cursor: pointer; font-size: 14px; }

/* ===== Amount Input ===== */
.amount-input-wrapper {
  position: relative;
  margin-bottom: 12px;
}
.amount-input-wrapper::before {
  content: "¥";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  z-index: 1;
}
.amount-input {
  width: 100%;
  padding: 16px 16px 16px 44px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  text-align: left;
  -moz-appearance: textfield;
}
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input:focus { outline: none; }

.quick-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.quick-amount {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.quick-amount:active { transform: scale(0.94); }
.quick-amount.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== Chips (Beneficiary Selector) ===== */
.chips-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.chips-label span:first-child {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}
.chips-hint {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(0.94); }
.chip.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.chip .chip-check { display: none; font-size: 12px; }
.chip.selected .chip-check { display: inline; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-soft { background: var(--primary-soft, #e6f7f1); color: var(--primary); border: 1px solid var(--primary); }
.btn-soft:hover { background: #d4f0e6; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-light); margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }

/* ===== Person Cards ===== */
.person-list { display: flex; flex-direction: column; gap: 10px; }
.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.person-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.person-info { flex: 1; min-width: 0; }
.person-name {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.person-relation {
  font-size: 13px;
  color: var(--text-light);
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.person-actions { display: flex; gap: 2px; }

/* ===== Record Cards ===== */
.record-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.record-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.record-date {
  font-size: 13px;
  color: var(--text-light);
}
.record-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--danger);
}
.record-flow {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.record-flow .arrow { color: var(--text-lighter); margin: 0 4px; }
.record-beneficiary { color: var(--text-light); }
.record-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-light);
  background: var(--bg);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  display: inline-block;
}
.record-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.record-actions .btn { flex: 1; }

/* ===== Summary Cards ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.summary-value.expense { color: var(--danger); }
.summary-label {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Filter Bar ===== */
.filter-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.quick-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-row.single { grid-template-columns: 1fr; }
.filter-group label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.filter-group input,
.filter-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-appearance: none;
}
.filter-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ===== Charts ===== */
.chart-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.chart-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
.chart-canvas-wrap {
  position: relative;
  height: 240px;
}

/* ===== Calendar Heatmap (month) ===== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-h {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  padding-bottom: 2px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  overflow: hidden;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.hot .cal-d,
.cal-cell.hot .cal-a { color: #fff; }
.cal-d { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-a { font-size: 10px; color: var(--text-light); }
.cal-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-light);
}
.cal-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

/* ===== Year Grid ===== */
.yr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.yr-cell {
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  justify-content: center;
}
.yr-cell.hot .yr-m,
.yr-cell.hot .yr-a { color: #fff; }
.yr-m { font-size: 15px; font-weight: 600; color: var(--text); }
.yr-a { font-size: 12px; color: var(--text-light); }
.yr-a.zero { font-size: 11px; opacity: 0.6; }

/* ===== Calendar Panel Nav ===== */
.cal-panel { margin-bottom: 14px; }
.cal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cal-mode {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.seg {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.seg.active {
  background: var(--primary);
  color: #fff;
}
.cal-pickers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  -webkit-appearance: none;
}
.cal-step {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-step:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cal-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

/* ===== Breakdown Table ===== */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.breakdown-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.breakdown-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.breakdown-table tr:last-child td { border-bottom: none; }
.breakdown-table .amount-cell { font-weight: 600; color: var(--danger); text-align: right; }
.breakdown-table .count-cell { color: var(--text-light); text-align: center; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 20px; font-size: 14px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card-bg);
  width: 100%;
  max-width: 500px;
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  transition: background 0.3s;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
}
.modal-footer .btn { flex: 1; }

/* ===== 弹窗内表单字段美化（密码修改等） ===== */
.modal-body .field { margin-bottom: 16px; }
.modal-body .field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 7px;
}
.modal-body .field input {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 15px; background: var(--bg); color: var(--text);
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none;
}
.modal-body .field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
/* 密码可见切换 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent; cursor: pointer;
  font-size: 17px; line-height: 1; border-radius: 8px; color: var(--text-light);
}
.pwd-toggle:hover { background: var(--border); }
/* 弹窗说明提示框 */
.modal-tip {
  display: flex; gap: 8px; align-items: flex-start;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--text-light);
  padding: 10px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; margin: 0 0 16px;
}
.modal-tip .ico { flex: 0 0 auto; font-size: 15px; line-height: 1.4; }
/* 弹窗错误提示 */
.modal-err {
  display: flex; gap: 6px; align-items: center;
  color: var(--danger); font-size: 13px; line-height: 1.4;
  min-height: 18px; margin-top: 2px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.toast-success { background: var(--primary); }
.toast.toast-error { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Data Actions ===== */
.data-actions { display: flex; flex-direction: column; gap: 12px; }
.data-info {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  line-height: 1.6;
}

/* ===== Recent Records ===== */
.recent-section {
  margin-top: 20px;
}
.recent-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-left: 4px;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  :root { --header-h: 60px; --nav-h: 64px; --max-w: 720px; }
  .app-content { padding-left: 20px; padding-right: 20px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-overlay { align-items: center; }
  .modal { border-radius: 20px; }
  .filter-row { grid-template-columns: repeat(4, 1fr); }
  .filter-row.single { grid-template-columns: 1fr 1fr auto; align-items: end; }
  .chart-canvas-wrap { height: 280px; }
  .charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .charts-grid .chart-container { margin-bottom: 0; }
}

/* ===== Scrollbar ===== */
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== Access Gate (门禁) ===== */
.login-screen { display: none; }
body.locked .login-screen { display: flex; }
/* 锁定状态下遮挡整个应用 */
body.locked .app-header,
body.locked main,
body.locked .app-nav { display: none !important; }

.login-screen {
  position: fixed; inset: 0; z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #e6f7f1 0%, #f3f7fb 55%, #eef3fb 100%);
}
[data-theme="dark"] .login-screen { background: linear-gradient(160deg, #0b2a22 0%, #0f172a 55%, #11203a 100%); }

.login-card {
  width: 100%; max-width: 380px;
  background: var(--card-bg); border-radius: 24px;
  box-shadow: 0 14px 44px rgba(16, 60, 45, .18);
  padding: 30px 24px 26px; text-align: center;
  animation: popIn .32s cubic-bezier(.22, .61, .36, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.login-logo { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); }
.login-sub { color: var(--text-light); font-size: 14px; margin: 6px 0 20px; line-height: 1.5; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card .field label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.login-card .field input {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: 16px;
  transition: border-color .2s; -webkit-appearance: none;
}
.login-card .field input:focus { outline: none; border-color: var(--primary); }

.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: -6px 0 8px; text-align: left; }
.login-hint { color: var(--text-light); font-size: 13px; margin: -4px 0 14px; text-align: left; }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-light); margin: 4px 0 16px; justify-content: flex-start; cursor: pointer; }
.login-remember input { width: 18px; height: 18px; accent-color: var(--primary); }
.login-link {
  display: block; width: 100%; margin-top: 12px; border: none; background: none;
  color: var(--primary); font-size: 14px; font-weight: 700; cursor: pointer; padding: 6px;
}
.login-link:active { opacity: .7; }

/* 登录失败抖动 */
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
.login-card.shake { animation: shake .5s; }
