/* ===== 应用布局 ===== */
.app { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.nav {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.nav-header { margin-bottom: 32px; padding: 0 4px; }
.nav-header .brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-header .brand-mark [data-icon] {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}
.nav-header h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.4px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition-slow);
}

.nav nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border: 1px solid transparent;
}
.nav-tab [data-icon] { width: 18px; height: 18px; flex-shrink: 0; }
.nav-tab:hover {
  background: var(--accent-gradient-soft);
  color: var(--accent);
}
.nav-tab.active {
  background: var(--accent-gradient-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

/* 侧边栏底部 */
.nav-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition-slow);
}

.nav-footer p:last-child {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: 0.3px;
  opacity: 0.7;
}

/* 主题切换按钮 */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-accent);
}
.theme-toggle [data-icon] { width: 16px; height: 16px; }
.theme-toggle .icon-light { display: none; }
.theme-toggle .icon-dark { display: inline; }
[data-theme="dark"] .theme-toggle .icon-light { display: inline; }
[data-theme="dark"] .theme-toggle .icon-dark { display: none; }

/* 统计信息 */
.stats-info {
  font-size: 11px;
  color: var(--text-subtle);
  text-align: center;
  margin: 0;
  line-height: 1.5;
  transition: color var(--transition-slow);
}
.stats-info strong {
  color: var(--accent);
  font-weight: 650;
}
.stats-info [data-icon] {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

/* 侧边栏遮罩 (移动端) */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  animation: fadeIn 0.2s ease;
}
.nav-backdrop.open { display: block; }

/* ===== 主内容区 ===== */
.page { flex: 1; padding: 24px 36px; min-width: 0; }

.tab-content {
  display: none;
  animation: fadeSlideIn .3s ease;
}
.tab-content.active { display: block; }

/* ===== 顶部栏 ===== */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ===== 搜索框 ===== */
.search { flex: 1; min-width: 200px; }
.search input {
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface-soft);
  color: var(--text);
  transition: all var(--transition);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}
.search input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--ring), inset 0 1px 3px rgba(0, 0, 0, 0.04);
}
.search input::placeholder {
  color: var(--text-subtle);
  font-weight: 400;
}
