:root {
  --bg: #0d1117;
  --bg-card: rgba(22, 27, 38, 0.72);
  --border: rgba(99, 140, 255, 0.14);
  --text: #e6edf3;
  --text-dim: #8b98ab;
  --accent: #6ea8fe;
  --accent2: #a78bfa;
}

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

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(110, 168, 254, 0.12), transparent),
    radial-gradient(900px 500px at 10% 110%, rgba(167, 139, 250, 0.1), transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

.app_header {
  padding: 36px 0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand_icon { font-size: 36px; }

.brand h1 {
  font-size: 26px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab_panel { display: none; flex: 1; }
.tab_panel.active { display: block; }

.panel_toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter_group { display: flex; align-items: center; gap: 8px; }
.filter_sep { color: var(--text-dim); font-size: 13px; }

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #0d1117;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.12); transform: translateY(-1px); }

.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }

.btn.danger { background: transparent; color: #f87171; border-color: rgba(248, 113, 113, 0.3); font-size: 12px; padding: 4px 10px; }
.btn.danger:hover { background: rgba(248, 113, 113, 0.1); }

input[type="date"], input[type="text"], textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.2s;
}

input:focus, textarea:focus { border-color: var(--accent); }

/* 日记 */
.diary_form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
}
.diary_form textarea { resize: vertical; }
.form_actions { display: flex; justify-content: flex-end; gap: 10px; }

.entry_list { display: flex; flex-direction: column; gap: 12px; }

.entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, border-color 0.2s;
}
.entry:hover { transform: translateY(-2px); border-color: rgba(110, 168, 254, 0.4); }

.entry_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.entry_title { font-size: 16px; font-weight: 600; }
.entry_date { font-size: 12px; color: var(--text-dim); margin-left: 10px; }
.entry_content {
  font-size: 14px;
  color: #c8d2e0;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty { color: var(--text-dim); font-size: 14px; text-align: center; padding: 40px 0; }

/* 小笔记 */
.notes_layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.notes_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note_item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.2s;
  word-break: break-all;
}
.note_item:hover { color: var(--text); border-color: var(--accent); }
.note_item.active { color: var(--accent); border-color: var(--accent); }

.note_viewer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  min-height: 300px;
  backdrop-filter: blur(8px);
  line-height: 1.9;
  font-size: 14px;
  overflow-x: auto;
}
.note_viewer h1, .note_viewer h2, .note_viewer h3 { margin: 18px 0 10px; color: var(--accent); }
.note_viewer h1:first-child, .note_viewer h2:first-child { margin-top: 0; }
.note_viewer code {
  background: rgba(110, 168, 254, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
}
.note_viewer pre {
  background: #0a0e16;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
}
.note_viewer pre code { background: none; padding: 0; }
.note_viewer ul { padding-left: 22px; }
.note_viewer a { color: var(--accent); }

/* 相册 */
.album_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.album_card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.album_card:hover { transform: translateY(-3px); border-color: var(--accent); }
.album_icon { font-size: 40px; margin-bottom: 10px; }
.album_name { font-size: 15px; font-weight: 600; }
.album_count { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.album_title { font-size: 17px; font-weight: 600; }

.photo_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.photo_item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  aspect-ratio: 1;
  background: #0a0e16;
}
.photo_item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.photo_item:hover img { transform: scale(1.05); }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 30px;
}
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
}

.app_footer {
  padding: 30px 0 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.app_footer a { color: var(--text-dim); text-decoration: none; }
.app_footer a:hover { color: var(--accent); text-decoration: underline; }
.app_footer p { margin: 4px 0; }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .notes_layout { grid-template-columns: 1fr; }
  .notes_list { flex-direction: row; overflow-x: auto; }
  .note_item { white-space: nowrap; }
}
