:root {
  color-scheme: dark;
  --bg: #070b16;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef4ff;
  --muted: #9fb0cc;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --danger: #fb7185;
  --ok: #6ee7b7;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --blur: 16px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

html {
  background: var(--bg);
}

body {
  display: flex;
  background: transparent;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(125, 211, 252, 0.17), transparent 62%),
    radial-gradient(900px 700px at 92% 108%, rgba(167, 139, 250, 0.17), transparent 62%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 72%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

code, .material-meta, .todo-meta, .project-meta {
  font-variant-numeric: tabular-nums;
}

.todo-meta,
.project-meta,
.material-meta,
.home-material .muted,
.home-todo .muted,
.search-hit .page {
  font-family: Consolas, "Cascadia Code", "Microsoft YaHei", monospace;
}

::selection {
  background: rgba(125, 211, 252, 0.9);
  color: #04101f;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.sidebar {
  width: 210px;
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 15, 26, 0.55);
  border-right: 1px solid var(--glass-border);
  padding: 24px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  padding: 0 10px 20px;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #eef4ff 20%, var(--accent) 70%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  border-left: 2px solid transparent;
  color: var(--muted);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav a::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.18s;
}

.nav a.active::before { opacity: 1; }

.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.72;
  transition: opacity 0.18s, filter 0.18s;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.nav a:hover .nav-icon { opacity: 1; }

.nav a.active {
  background: linear-gradient(90deg, rgba(125, 211, 252, 0.16), rgba(167, 139, 250, 0.05));
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.nav a.active .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(125, 211, 252, 0.55));
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 10px 4px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.75;
  letter-spacing: 0.3px;
}

main#view {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 32px 40px 80px;
  max-width: 1160px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h1 { font-size: 24px; margin: 0; }

.tabs, .filters { display: flex; gap: 6px; flex-wrap: wrap; }

.tabs button, .filters button {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.tabs button:hover, .filters button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.tabs button.active, .filters button.active {
  border-color: rgba(125, 211, 252, 0.6);
  background: rgba(125, 211, 252, 0.14);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.12);
}

.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.quick-add input[type="text"], .quick-add input:not([type]) {
  flex: 1;
  min-width: 160px;
}

input, select, textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

input::placeholder, textarea::placeholder { color: rgba(159, 176, 204, 0.8); }

input:focus, select:focus, textarea:focus {
  border-color: rgba(125, 211, 252, 0.65);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.14);
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #07101f;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.25);
  transition: filter 0.16s, box-shadow 0.16s, transform 0.12s;
}

button.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 28px rgba(125, 211, 252, 0.4);
}

button.primary:active { transform: translateY(1px); }

button.ghost, a.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

button.ghost:hover, a.ghost:hover {
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.danger, button.ghost.danger { color: var(--danger); }

button.ghost.danger:hover,
a.ghost.danger:hover {
  border-color: rgba(251, 113, 133, 0.55);
  color: var(--danger);
}

/* 主要玻璃面板：任务 2 的所有页面卡片 */
.home-card, .settings-section, .material-detail, .project-create,
.project-edit, .project-card, .detail-section, .vault-card,
.vault-editor, .upload-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filters { margin-bottom: 14px; }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: background 0.16s, border-color 0.16s;
}

.todo:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.todo input[type="checkbox"] { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--accent); }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.todo-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.todo.done .todo-title { color: var(--muted); text-decoration: line-through; }
.todo.overdue {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.09);
}
.todo.overdue:hover { background: rgba(251, 113, 133, 0.13); }
.todo.overdue .todo-meta { color: var(--danger); }
.todo .icon {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.todo .icon:hover { background: rgba(255, 255, 255, 0.08); color: var(--danger); }

.todo-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.priority-select {
  padding: 2px 6px;
  font-size: 12.5px;
  border-radius: 6px;
  color: var(--muted);
}
.priority-select.high { color: var(--danger); }
.priority-select.medium { color: #fbbf24; }
.priority-select.low { color: var(--muted); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

.placeholder { color: var(--muted); padding-top: 80px; text-align: center; }
.placeholder h1 { color: var(--text); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: rgba(12, 18, 32, 0.92);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  animation: fade-in 0.15s ease-out;
}

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 资料页 ---------- */

.upload-panel {
  padding: 14px;
  margin-bottom: 16px;
}

.upload-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-controls input { flex: 1; min-width: 140px; }

.drop-zone {
  margin-top: 10px;
  border: 1.5px dashed rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.04);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent);
}

.upload-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-row { display: grid; grid-template-columns: minmax(120px, 1fr) 160px 120px; gap: 10px; align-items: center; font-size: 13px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(125, 211, 252, 0.45);
  transition: width 0.2s;
}
.upload-status { color: var(--muted); text-align: right; }
.upload-status.failed { color: var(--danger); }

.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row input { flex: 1; }

.materials-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.material-list { display: flex; flex-direction: column; gap: 8px; }

.material-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}

.material-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(125, 211, 252, 0.45);
}

.thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.07);
}

.thumb.file {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.material-main { flex: 1; min-width: 0; }
.material-title { font-weight: 600; overflow-wrap: anywhere; }
.material-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.muted { color: var(--muted); font-weight: 400; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
  color: var(--muted);
}
.badge.ready {
  background: rgba(110, 231, 183, 0.12);
  border-color: rgba(110, 231, 183, 0.25);
  color: var(--ok);
}
.badge.failed {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.3);
  color: var(--danger);
}
.badge.processing {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.3);
  color: var(--accent);
}

.material-detail {
  padding: 16px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.detail-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.detail-head h2 { font-size: 18px; margin: 0 0 6px; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-actions a.ghost { display: inline-flex; align-items: center; padding: 6px 12px; }
.danger { color: var(--danger); }

.preview-image { max-width: 100%; border-radius: 10px; margin-top: 12px; }
.preview-pdf {
  width: 100%;
  height: 520px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.preview-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  max-height: 520px;
  overflow: auto;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
}

.search-group {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.search-group-title { font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.search-hit { padding: 7px 0; border-bottom: 1px dashed var(--line); cursor: pointer; font-size: 14px; }
.search-hit:last-child { border-bottom: 0; }
.search-hit:hover { color: var(--accent); }
.search-hit .page { font-size: 12px; color: var(--accent); margin-right: 6px; }
mark {
  background: rgba(125, 211, 252, 0.9);
  color: #04101f;
  border-radius: 3px;
  padding: 0 2px;
}
.error-text { color: var(--danger); font-size: 13px; }

/* ---------- 项目页 ---------- */

.project-create, .project-edit {
  padding: 14px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-grid input, .form-grid select { width: 100%; }

.project-group h2 { font-size: 16px; margin: 22px 0 10px; }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

.project-card {
  display: block;
  padding: 12px 14px;
}
.project-card:hover { border-color: var(--accent); }
.project-card-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.project-name { overflow-wrap: anywhere; }
.project-next { margin-top: 8px; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.project-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.overdue-text { color: var(--danger); font-size: 12.5px; margin: 6px 0 0; }

.back-row { margin-bottom: 10px; }
.detail-section { padding: 14px; margin-top: 16px; }
.section-head h2 { font-size: 16px; margin: 0 0 10px; }
.milestone-list, .log-list, .linked-todos { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  transition: background 0.16s;
}
.milestone:hover { background: rgba(255, 255, 255, 0.06); }
.milestone input { width: 16px; height: 16px; accent-color: var(--accent); }
.milestone-title { flex: 1; }
.milestone.done { opacity: 0.8; }
.milestone.done .milestone-title { color: var(--muted); text-decoration: line-through; }
.milestone .icon { background: none; border: 0; color: var(--muted); cursor: pointer; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input:first-child { flex: 1; min-width: 160px; }
.log-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.log-list li .muted { margin-right: 8px; font-size: 12.5px; }
.linked-todos li { padding: 4px 0; }
.linked-todos li.done { color: var(--muted); text-decoration: line-through; }

.project-select { margin-top: 4px; padding: 2px 6px; font-size: 12.5px; border-radius: 6px; color: var(--muted); }

/* ---------- 密码库 ---------- */

.vault-card {
  max-width: 460px;
  margin: 60px auto 0;
  padding: 24px;
}
.vault-card h1 { font-size: 20px; margin: 0 0 8px; }
.vault-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.vault-form label, .vault-editor label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.vault-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vault-note { margin: 0 0 14px; font-size: 13px; }
.vault-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 18px; }
.vault-entry {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: background 0.16s, border-color 0.16s;
}
.vault-entry:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(125, 211, 252, 0.35);
}
.vault-entry-head { display: flex; align-items: center; gap: 10px; }
.vault-title { font-weight: 600; overflow-wrap: anywhere; }
.vault-sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.vault-secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.vault-secret { font-family: Consolas, "Courier New", monospace; font-size: 13.5px; overflow-wrap: anywhere; flex: 1; min-width: 120px; }
.vault-entry-actions { display: flex; gap: 8px; margin-top: 8px; }
.vault-editor { border: 1px solid var(--accent); padding: 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.vault-editor-head { display: flex; justify-content: space-between; align-items: center; }
.vault-editor-head h2 { font-size: 16px; margin: 0; }
.secret-input { display: flex; gap: 8px; }
.secret-input input { flex: 1; }
.generator { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.generator label { flex-direction: row; align-items: center; gap: 6px; }
.inline-check { flex-direction: row; align-items: center; gap: 6px; }
.vault-editor textarea, .vault-form input, .vault-editor input, .vault-editor select { width: 100%; }
.vault-editor textarea { resize: vertical; }

/* ---------- 首页 ---------- */

.home-page { max-width: 960px; margin: 0 auto; }
.home-head { margin-bottom: 12px; }
.home-search { display: flex; gap: 8px; margin-bottom: 18px; }
.home-search input { flex: 1; }
.home-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.home-card {
  padding: 16px 18px;
}

.home-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.home-card-head h2 { font-size: 16px; margin: 0; }
.home-card-head a { font-size: 13px; color: var(--accent); }

.home-todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.home-todo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  transition: background 0.16s;
}
.home-todo:hover { background: rgba(255, 255, 255, 0.06); }
.home-todo input { width: 16px; height: 16px; accent-color: var(--accent); }
.home-todo-title { flex: 1; }
.home-todo.overdue .home-todo-title { color: var(--danger); }
.home-todo.overdue .muted { color: var(--danger); }
.home-todo .muted { font-size: 12.5px; }

.home-projects { display: flex; flex-direction: column; gap: 10px; }
.home-project {
  display: block;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background 0.16s, border-color 0.16s;
}
.home-project:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(125, 211, 252, 0.35);
}
.home-project-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.home-next { font-size: 13px; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }

.home-materials { display: flex; flex-direction: column; gap: 6px; }
.home-material { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.home-material:last-child { border-bottom: 0; }
.home-material span:first-child { overflow-wrap: anywhere; }
.home-material .muted { font-size: 12.5px; white-space: nowrap; }

.vault-state { font-size: 16px; font-weight: 600; margin: 6px 0; }

/* ---------- 登录页 ---------- */

.login-body {
  align-items: center;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  margin: 0;
}

.login-card h1 {
  margin-bottom: 6px;
}

/* ---------- 设置页 ---------- */

.settings-page { max-width: 960px; margin: 0 auto; }

.settings-section {
  padding: 16px 18px;
  margin-bottom: 14px;
}

.settings-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.settings-section-head h2 { font-size: 16px; margin: 0; }
.settings-section-head p { margin: 0; font-size: 12.5px; }

.settings-info { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: 0; }
.info-row strong { font-weight: 600; }
.info-row code {
  font-family: Consolas, "Cascadia Code", "Courier New", monospace;
  font-size: 12px;
  color: var(--accent);
  overflow-wrap: anywhere;
  max-width: 70%;
  text-align: right;
}
.info-row.data-dir code {
  flex: 1;
  min-width: 0;
  max-width: none;
  text-align: left;
}
.info-row.data-dir button { flex: 0 0 auto; }

.settings-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.settings-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.settings-fields input, .settings-fields select { width: 100%; }
.settings-actions { display: flex; justify-content: flex-end; }
.settings-hint { margin: 10px 0 0; font-size: 12.5px; }

.danger-zone { border-color: rgba(251, 113, 133, 0.28); }
.danger-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.danger-actions h3 { font-size: 14px; margin: 0 0 4px; }
.danger-actions p { font-size: 12.5px; margin: 0 0 10px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.backup-list { display: flex; flex-direction: column; gap: 6px; }
.backup-row {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13.5px;
}
.backup-row:hover { background: rgba(255, 255, 255, 0.06); }
.backup-row:last-child { border-bottom: 0; }
.backup-row .muted { text-align: right; }

@media (max-width: 900px) {
  .home-page { max-width: none; }
}

@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 15, 26, 0.8);
  }
  .brand { padding: 0 8px 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a {
    white-space: nowrap;
    padding: 7px 10px;
    min-height: 44px;
  }
  .sidebar-foot { display: none; }
  main#view {
    padding: 20px 16px 60px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
  input, select, textarea { font-size: 16px; }
  .page-head h1 { font-size: 21px; }
  .quick-add, .home-search, .search-row { flex-wrap: wrap; }
  .materials-layout { grid-template-columns: 1fr; }
  .material-detail { position: static; max-height: none; }
  .upload-row { grid-template-columns: 1fr; gap: 4px; }
  .project-cards { grid-template-columns: 1fr; }
  .settings-section { padding: 14px; }
  .settings-fields { grid-template-columns: 1fr; }
  .danger-actions { grid-template-columns: 1fr; }
  .info-row { flex-wrap: wrap; }
  .info-row code { max-width: 100%; }
  .info-row.data-dir code {
    flex-basis: 100%;
    order: 3;
    text-align: left;
  }
  .info-row.data-dir button { margin-left: auto; }
  body::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
