/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 10px -4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

/* ========== Dark Mode ========== */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.4), 0 4px 10px -4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .login-page {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
}

[data-theme="dark"] .login-container {
  background: rgba(30, 41, 59, 0.95);
}

[data-theme="dark"] .search-box {
  background: var(--card-bg);
}

[data-theme="dark"] .top-bar {
  background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .panel {
  background: var(--card-bg);
}

[data-theme="dark"] .icon-btn {
  background: var(--card-bg);
}

[data-theme="dark"] .panel-btn {
  background: var(--card-bg);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #0f172a;
  color: var(--text);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  background: #1e293b;
}

[data-theme="dark"] .modal {
  background: var(--card-bg);
}

[data-theme="dark"] .modal-close {
  background: #334155;
}

[data-theme="dark"] .modal-close:hover {
  background: #475569;
}

[data-theme="dark"] .bookmark-item:hover {
  background: #1e293b;
}

[data-theme="dark"] .bm-action-btn {
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .note-item {
  border-color: transparent !important;
}

[data-theme="dark"] .note-item .note-actions button {
  background: rgba(0,0,0,0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ========== Page ========== */
.page {
  display: none;
  min-height: 100vh;
}
.page.active {
  display: block;
}

/* ========== Login ========== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}
.login-page.active {
  display: flex;
}

.login-container {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 20px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-logo {
  text-align: center;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: #fafafa;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 8px;
  display: none;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.login-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== Main Page ========== */
.main-page {
  display: block;
  padding: 0;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.greeting {
  font-size: 16px;
  color: var(--text-secondary);
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.top-right {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary);
}

/* Search */
.search-section {
  padding: 32px 32px 20px;
  max-width: 700px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 4px 16px 4px 20px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}

.search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 12px;
  font-size: 15px;
  background: transparent;
}

.search-engines {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.engine-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.engine-tag:hover {
  background: var(--bg);
}

.engine-tag.active {
  background: var(--primary);
  color: #fff;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 0 32px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .search-section { padding: 20px 16px; }
  .main-content { padding: 0 16px 20px; }
  .top-bar { padding: 12px 16px; }
}

/* ========== Clock Panel ========== */
.clock-panel {
  text-align: center;
  padding: 24px 16px;
}

.clock-time {
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.clock-weekday {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

.clock-quote {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-style: italic;
  line-height: 1.5;
}

/* Panel */
.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.panel-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,0.05);
}

/* ========== Bookmarks v2（多级列选 + 徽章列表） ========== */
.bookmark-multi-col {
  display: flex;
  height: 360px;
  overflow: hidden;
}
.bm-col {
  width: 110px;
  min-width: 110px;
  border-right: 1px solid var(--border);
  padding: 4px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.bm-col:last-child {
  flex: 1;
  min-width: 0;
  border-right: none;
  padding: 12px;
}
.bm-col-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 10px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.bm-col-item, .bm-folder-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.bm-col-item:hover, .bm-folder-item:hover {
  background: var(--bg);
  color: var(--text);
}
.bm-col-item.active, .bm-folder-item.active {
  background: rgba(79,70,229,0.1);
  color: var(--primary);
  font-weight: 600;
}
.bm-col-item .bm-count {
  font-size: 10px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 0 5px;
  border-radius: 8px;
}
.bm-col-item .bm-arr {
  font-size: 10px;
  opacity: 0.5;
  margin-left: 4px;
}

/* 文件夹删除按钮（绝对定位，不影响列宽） */
.bm-folder-item { position: relative; }
.bm-folder-del {
  display: none;
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: var(--card-bg); cursor: pointer;
  color: var(--text-secondary); font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  z-index: 2;
}
.bm-folder-item:hover .bm-folder-del {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bm-folder-del:hover {
  background: #fee2e2; color: #ef4444;
}

/* 列头删除按钮 */
.bm-col-header {
  display: flex; align-items: center; gap: 8px;
}
.bm-col-del {
  display: none;
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: transparent; cursor: pointer;
  color: var(--text-secondary); font-size: 12px;
}
.bm-col-header:hover .bm-col-del {
  display: inline-flex;
  align-items: center; justify-content: center;
}
.bm-col-del:hover { background: #fee2e2; color: #ef4444; }

/* 锁定状态：书签徽章编辑删除按钮隐藏 */
.bm-locked .bm-badge-actions { display: none !important; }
.bm-locked .bm-badge { justify-content: center; padding: 5px 12px; }
/* 锁定状态：文件夹列头删除按钮隐藏 */
.bm-folder-locked .bm-col-del { display: none !important; }
.bm-folder-locked .bm-folder-del { display: none !important; }
/* 锁定状态下文件夹操作按钮变灰不可点击 */
.bm-folder-locked .bm-folder-btn { opacity: 0.35; pointer-events: none; }

/* 热搜更新时间 */
.hot-update { font-weight:400; font-size:10px; color:var(--text-secondary); margin-left:6px; }

/* 天气更新时间 */
.weather-update { font-size:11px; color:var(--text-secondary); text-align:right; padding-top:6px; border-top:1px solid var(--border); margin-top:6px; }

/* 文件夹底色 */
.bm-folder-item {
  background: transparent;
  transition: var(--transition);
}
.bm-folder-item:hover { background: var(--bg); }
.bm-folder-item.active { background: rgba(79,70,229,0.08); }


/* ========== Old bookmark styles ========== */

/* 书签徽章列表（类似快捷工具样式） */
.bm-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.bm-badge {
  padding: 5px 10px 5px 12px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(79,70,229,0.05);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.bm-badge:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,0.1);
  transform: translateY(-1px);
}
.bm-badge .bm-badge-actions {
  visibility: hidden;
  display: flex;
  gap: 2px;
  margin-left: 4px;
}
.bm-badge:hover .bm-badge-actions {
  visibility: visible;
}
.bm-badge-action {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bm-badge-action:hover {
  color: var(--primary);
  background: #eef2ff;
}

/* Old bookmark styles kept for fallback */
.bookmark-container {
  padding: 16px 20px;
  min-height: 200px;
}
.bookmark-category { margin-bottom: 20px; }
.bookmark-category:last-child { margin-bottom: 0; }
.bookmark-sidebar { width: 160px; min-width: 160px; border-right: 1px solid var(--border); padding: 4px 0; max-height: 400px; overflow-y: auto; flex-shrink: 0; }
.bm-folder { padding: 5px 10px; cursor: pointer; font-size: 11px; color: var(--text-secondary); transition: var(--transition); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.bm-folder:hover { background: var(--bg); color: var(--text); }
.bm-folder.active { background: rgba(79,70,229,0.1); color: var(--primary); font-weight: 600; }
.category-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }

.bookmark-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.bookmark-item:hover {
  background: var(--bg);
}

.bookmark-item .bm-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
  background: #f3f4f6;
  overflow: hidden;
}

.bookmark-item .bm-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bookmark-item .bm-title {
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
  color: var(--text-secondary);
}

.bookmark-item .bm-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 2px;
}

.bookmark-item:hover .bm-actions {
  display: flex;
}

.bm-action-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.bm-action-btn:hover {
  color: var(--primary);
}

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

/* ========== Weather ========== */
.weather-container {
  padding: 16px 20px;
}

.weather-loading {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 20px 0;
}

.weather-now {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.weather-emoji {
  font-size: 40px;
  line-height: 1;
}

.weather-temp {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.weather-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.weather-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* 7天预报列表 */
.weather-forecast {
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
}

.forecast-row {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  transition: var(--transition);
  gap: 10px;
}
.forecast-row:hover {
  background: var(--bg);
}

.forecast-row .fc-label {
  width: 58px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-row .fc-emoji {
  font-size: 18px;
  width: 24px;
  flex-shrink: 0;
}

.forecast-row .fc-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-row .fc-temp {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* ========== Notes v2: 3-column grid ========== */
.notes-grid {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}
@media (max-width: 1100px) { .notes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .notes-grid { grid-template-columns: 1fr; } }

.notes-container {
  padding: 12px 16px;
  max-height: 400px;
  overflow-y: auto;
}

.note-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  position: relative;
  transition: var(--transition);
  border: 1px solid transparent;
  min-height: 80px;
  display: flex;
  flex-direction: column;
}

.note-item:hover {
  border-color: rgba(0,0,0,0.08);
}

.note-item .note-content {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-item .note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.note-item .note-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.note-item .note-due {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}
.note-item .note-due.overdue {
  color: #ef4444;
}

.note-item .note-actions {
  display: flex;
  gap: 4px;
}

.note-item .note-actions button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.note-item .note-actions button:hover {
  color: var(--primary);
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}

.modal-sm {
  width: 400px;
}

.modal-lg {
  width: 680px;
}

/* Settings grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}
@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
  .modal-lg { width: 95vw; }
}
.settings-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Quick tools editor */
.tool-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
}
.tool-editor-item .tool-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-editor-item .tool-url {
  flex: 2;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-editor-item .tool-del {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
}
.tool-editor-item .tool-del:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Note title */
.note-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.note-tag {
  padding: 1px 8px;
  font-size: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.08);
  color: var(--text-secondary);
}
[data-theme="dark"] .note-tag {
  background: rgba(255,255,255,0.1);
}

/* Weather placeholder */
.weather-placeholder {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 32px 20px;
}

/* Dashboard page background transparency */
.dashboard-page {
  min-height: 100vh;
  background: var(--bg);
}
.dashboard-page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--wallpaper-url, url('/assets/bizhi.jpeg')) center/cover no-repeat;
  opacity: 0.06;
  z-index: -1;
  pointer-events: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.modal-close:hover {
  background: #e5e7eb;
  color: var(--text);
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}

/* ========== Admin User Management ========== */
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg);
  transition: var(--transition);
}

.user-item:hover {
  background: rgba(79,70,229,0.05);
}

.user-item .user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-item .user-name-display {
  font-size: 13px;
  font-weight: 600;
}

.user-item .user-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.user-item .user-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  margin-left: 6px;
}

.user-item .user-actions {
  display: flex;
  gap: 6px;
}

.user-item .user-actions button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: var(--transition);
}

.user-item .user-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.user-item .user-actions .btn-danger {
  color: #ef4444;
  border-color: #fecaca;
}

.user-item .user-actions .btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========== Calendar ========== */
.calendar-panel .panel-header h3 {
  text-align: center;
  width: 100%;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 12px 12px;
  text-align: center;
  font-size: 12px;
}
.calendar-grid .cal-header {
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 0;
  font-size: 11px;
}
.calendar-grid .cal-day {
  padding: 6px 0;
  border-radius: 6px;
  cursor: default;
  color: var(--text);
  transition: var(--transition);
}
.calendar-grid .cal-day:hover {
  background: var(--bg);
}
.calendar-grid .cal-day.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.calendar-grid .cal-day.other-month {
  color: var(--border);
}
.calendar-grid .cal-day.weekend {
  color: #ef4444;
}
.calendar-grid .cal-day.today.weekend {
  background: #ef4444;
  color: #fff;
}

/* ========== Quick Tools ========== */
.quick-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 32px 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.quick-tools a {
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  transition: var(--transition);
}
.quick-tools a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,0.05);
  transform: translateY(-1px);
}

/* ========== Countdown ========== */
.countdown-panel { padding: 4px 0; }
.countdown-header { font-size: 13px; font-weight: 600; padding: 10px 16px 6px; color: var(--text-secondary); }
.cd-item { display: flex; align-items: center; padding: 6px 16px; gap: 8px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.cd-item:last-child { border-bottom: none; }
.cd-item:hover { background: var(--bg); }
.cd-item .cd-name { flex: 1; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-item .cd-days { font-size: 16px; font-weight: 700; color: var(--primary); min-width: 50px; text-align: right; }
.cd-item .cd-date { font-size: 10px; color: var(--text-secondary); min-width: 70px; }
.cd-item .cd-del { width: 20px; height: 20px; border: none; border-radius: 50%; background: transparent; cursor: pointer; color: var(--text-secondary); font-size: 14px; }
.cd-item .cd-del:hover { background: #fee2e2; color: #ef4444; }

/* ========== Hot Search v2: dual column ========== */
.hot-dual-col { display: flex; }
.hot-dual-col .hot-col { flex: 1; min-width: 0; padding: 8px 12px 12px; }
.hot-dual-col .hot-col:first-child { border-right: 1px solid var(--border); }
.hot-col-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

.hot-item { display: flex; align-items: center; padding: 6px 0; gap: 8px; border-bottom: 1px solid var(--border); }
.hot-item:last-child { border-bottom: none; }
.hot-item .hot-rank { width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--text-secondary); flex-shrink: 0; }
.hot-item .hot-rank.hot-top { background: #ef4444; color: #fff; }
.hot-item a { flex: 1; font-size: 12px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--transition); }
.hot-item a:hover { color: var(--primary); }
.hot-item .hot-num { font-size: 10px; color: var(--text-secondary); flex-shrink: 0; }

/* Weather forecast section titles */
.weather-forecast-title { font-size: 12px; font-weight: 600; padding: 8px 0 4px; color: var(--text-secondary); border-top: 1px solid var(--border); margin-top: 8px; }

/* ========== Tag Cloud ========== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 20px 14px;
  border-top: 1px solid var(--border);
}
.tag-cloud .tag {
  padding: 3px 12px;
  font-size: 11px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.tag-cloud .tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tag-cloud .tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== RSS ========== */
.rss-container {
  padding: 8px 16px 14px;
  max-height: 280px;
  overflow-y: auto;
}
.rss-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.rss-item:last-child {
  border-bottom: none;
}
.rss-item a {
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
  transition: var(--transition);
}
.rss-item a:hover {
  color: var(--primary);
}
.rss-item .rss-source {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ========== 响应式：720p 小屏 (≤1366×768) ========== */
@media (max-width: 1366px) {
  .main-content {
    grid-template-columns: 280px 1fr;
    gap: 16px;
    padding: 0 20px 24px;
  }
  .search-section { padding: 20px 20px 12px; }
  .search-box { padding: 2px 12px 2px 16px; }
  .search-box input { padding: 10px 8px; font-size: 14px; }
  .top-bar { padding: 12px 20px; }
  .bm-col { width: 100px; min-width: 100px; }
  .bookmark-multi-col { height: 300px; }
  .notes-grid { max-height: 380px; }
  .weather-meta { font-size: 11px; gap: 4px 6px; }
  .forecast-row { padding: 5px 6px; gap: 6px; }
  .forecast-row .fc-label { font-size: 10px; width: 50px; }
  .clock-time { font-size: 34px; }
  .weather-temp { font-size: 30px; }
  .weather-emoji { font-size: 32px; }
}

@media (max-width: 960px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .bm-col { width: 90px; min-width: 90px; }
}

/* ========== 响应式：2K 大屏 (≥2048px) ========== */
@media (min-width: 2048px) {
  .main-content {
    max-width: 1800px;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    padding: 0 40px 40px;
  }
  .search-section { padding: 40px 40px 28px; max-width: 900px; }
  .search-box input { font-size: 16px; padding: 14px 16px; }
  .top-bar { padding: 20px 40px; }
  .clock-time { font-size: 48px; }
  .clock-date { font-size: 16px; }
  .clock-weekday { font-size: 18px; }
  .greeting, .user-name { font-size: 18px; }
  .bm-col { width: 130px; min-width: 130px; }
  .bookmark-multi-col { height: 420px; }
  .bm-badge { font-size: 13px; padding: 6px 12px 6px 14px; }
  .bm-badge-action { width: 20px; height: 20px; font-size: 11px; }
  .notes-grid { max-height: 600px; gap: 12px; }
  .note-item { padding: 16px; }
  .note-item .note-content { font-size: 14px; }
  .weather-temp { font-size: 42px; }
  .weather-emoji { font-size: 44px; }
  .weather-meta { font-size: 13px; }
  .forecast-row { padding: 8px 10px; }
  .forecast-row .fc-label { font-size: 12px; width: 64px; }
  .forecast-row .fc-text { font-size: 13px; }
  .forecast-row .fc-temp { font-size: 13px; }
  .hot-item a { font-size: 13px; }
  .panel-header h3 { font-size: 16px; }
  .quick-tools a { font-size: 13px; padding: 7px 18px; }
}

/* ========== 响应式：4K 大屏 (≥2560px) ========== */
@media (min-width: 2560px) {
  .main-content {
    max-width: 2200px;
    grid-template-columns: 440px 1fr;
    gap: 36px;
    padding: 0 56px 56px;
  }
  .search-section { padding: 48px 56px 32px; max-width: 1000px; }
  .search-box input { font-size: 17px; padding: 16px 20px; }
  .top-bar { padding: 24px 56px; }
  .clock-time { font-size: 56px; }
  .clock-date { font-size: 17px; }
  .clock-weekday { font-size: 20px; }
  .clock-quote { font-size: 14px; }
  .greeting, .user-name { font-size: 20px; }
  .bm-col { width: 150px; min-width: 150px; }
  .bookmark-multi-col { height: 480px; }
  .bm-badge { font-size: 14px; padding: 7px 14px 7px 16px; }
  .bm-badge-action { width: 22px; height: 22px; font-size: 12px; }
  .bm-folder-item, .bm-col-item { font-size: 13px; padding: 8px 12px; }
  .notes-grid { max-height: 700px; gap: 14px; }
  .note-item { padding: 18px; }
  .note-item .note-content { font-size: 15px; }
  .note-title { font-size: 16px; }
  .weather-temp { font-size: 48px; }
  .weather-emoji { font-size: 50px; }
  .weather-meta { font-size: 14px; gap: 8px 12px; }
  .forecast-row { padding: 10px 12px; gap: 12px; }
  .forecast-row .fc-label { font-size: 13px; width: 70px; }
  .forecast-row .fc-text { font-size: 14px; }
  .forecast-row .fc-temp { font-size: 14px; }
  .forecast-row .fc-emoji { font-size: 22px; }
  .hot-item a { font-size: 14px; }
  .hot-item .hot-rank { width: 26px; height: 26px; font-size: 12px; }
  .panel-header h3 { font-size: 18px; }
  .panel-btn { font-size: 14px; padding: 7px 16px; }
  .quick-tools a { font-size: 14px; padding: 8px 20px; }
  .engine-tag { font-size: 13px; padding: 5px 12px; }
}
