/* ============================================
   Taste-Skill 审美加持 · 江小鱼个人博客
   ============================================ */

/* --- CSS 变量 & 深色模式 --- */
:root {
  --bg: #fafafa;
  --bg-alt: #f2f2f5;
  --text: #18181b;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --border: #e4e4e7;
  --border-light: #f0f0f2;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.06);
  --accent: #18181b;
  --accent-text: #ffffff;
  --nav-bg: rgba(250,250,250,0.82);
  --glass: rgba(250,250,250,0.6);
  --selection-bg: #18181b;
  --selection-text: #fafafa;
  --skeleton-from: #e4e4e7;
  --skeleton-to: #f4f4f5;
  --pulse-color: #e4e4e7;
  --scrollbar-track: #f0f0f2;
  --scrollbar-thumb: #d4d4d8;
  --input-bg: #ffffff;
  --input-border: #d4d4d8;
  --code-bg: #f4f4f5;
}

.dark {
  --bg: #0c0c0f;
  --bg-alt: #141417;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border: #27272a;
  --border-light: #1f1f23;
  --card-bg: #18181b;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
  --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.25);
  --accent: #f4f4f5;
  --accent-text: #18181b;
  --nav-bg: rgba(12,12,15,0.85);
  --glass: rgba(12,12,15,0.6);
  --selection-bg: #f4f4f5;
  --selection-text: #0c0c0f;
  --skeleton-from: #27272a;
  --skeleton-to: #1f1f23;
  --pulse-color: #27272a;
  --scrollbar-track: #1f1f23;
  --scrollbar-thumb: #3f3f46;
  --input-bg: #18181b;
  --input-border: #3f3f46;
  --code-bg: #1f1f23;
}

/* --- 基础重置 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'General Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}
::selection { background: var(--selection-bg); color: var(--selection-text); }

/* --- 滚动条 --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* --- 排版 --- */
.font-display { font-family: 'Satoshi', system-ui, sans-serif; }
h1, h2, h3, h4 { font-family: 'Satoshi', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- 工具类 --- */
.max-w-site { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 1024px) { .max-w-site { padding: 0 2.5rem; } }

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* --- 导航 --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 1024px) { .nav-inner { padding: 0 2.5rem; } }

.nav-logo {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* 导航链接 */
.nav-link {
  position: relative;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--text);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--text); }

/* 二级下拉菜单 */
.dropdown-group { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding-top: 0.75rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.dropdown-group:hover .dropdown-menu,
.dropdown-group:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.dropdown-inner {
  background: var(--card-bg);
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  padding: 0.375rem;
  min-width: 160px;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.dropdown-item {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.dropdown-item:hover { background: var(--bg-alt); color: var(--text); }

/* 深色模式切换按钮 */
.theme-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--text); transform: scale(1.05); }

/* --- 卡片系统(taste-skill: 轻border+悬停微抬升) --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: var(--card-shadow);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border);
}

/* --- 按钮 --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover { border-color: var(--text); color: var(--text); }
.btn-secondary:active { transform: scale(0.97); }

/* --- 标签(taste-skill: 小字号+字间距) --- */
.tag-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--bg-alt);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}
.tag-pill:hover { background: var(--accent); color: var(--accent-text); }
.tag-pill.active { background: var(--accent); color: var(--accent-text); }

/* --- Skeleton 加载骨架 --- */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--skeleton-to) 50%, var(--skeleton-from) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- 音乐播放器 (悬浮右下角) --- */
.music-player {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  transition: all 0.35s ease;
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.music-player:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.music-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}
.music-btn:hover { transform: scale(1.08); }
.music-info {
  font-size: 0.75rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.music-title { font-weight: 500; color: var(--text); }
.music-volume {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.music-player:hover .music-volume { width: 60px; }
.music-volume input[type="range"] {
  width: 50px; height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.music-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
}
.audio-wave span {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--accent);
  border-radius: 1px;
  animation: wave 0.8s ease-in-out infinite;
}
.audio-wave span:nth-child(2) { animation-delay: 0.2s; height: 8px; }
.audio-wave span:nth-child(3) { animation-delay: 0.4s; height: 6px; }
.audio-wave span:nth-child(4) { animation-delay: 0.1s; height: 10px; }
.audio-wave span:nth-child(5) { animation-delay: 0.3s; height: 5px; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* --- 时钟日历仪表盘(taste-skill: 3卡片不对称) --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 1.25rem;
  padding: 1.5rem;
  transition: all 0.35s ease;
  box-shadow: var(--card-shadow);
}
.dash-card:hover { border-color: var(--border); box-shadow: var(--card-shadow-hover); }

/* 时钟 */
.clock-display {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.clock-seconds { font-size: 1.25rem; font-weight: 400; opacity: 0.5; vertical-align: super; }
.clock-date { font-size: 0.875rem; color: var(--text-secondary); letter-spacing: 0.02em; }
.clock-greeting { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 0.5rem; }

/* 日历 */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.calendar-title { font-weight: 600; font-size: 0.9rem; }
.calendar-nav { display: flex; gap: 0.5rem; }
.calendar-nav button {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  transition: all 0.2s;
}
.calendar-nav button:hover { border-color: var(--text); color: var(--text); }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 2px;
}
.calendar-days span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 0.78rem;
  border-radius: 50%;
  cursor: default;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.calendar-days span.today {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.calendar-days span.other-month { opacity: 0.25; }

/* --- 动画 --- */
.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease-out forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- 文章页 Markdown 排版 --- */
.post-content h1 { font-size: 2rem; margin: 2rem 0 1rem; }
.post-content h2 { font-size: 1.5rem; margin: 1.75rem 0 0.75rem; }
.post-content h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; color: var(--text-secondary); line-height: 1.8; }
.post-content ul, .post-content ol { margin: 1rem 0; padding-left: 1.5rem; color: var(--text-secondary); }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}
.post-content pre {
  background: var(--code-bg);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
}
.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}
.post-content img { border-radius: 0.75rem; margin: 1.5rem 0; }
.post-content a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* --- 管理后台 --- */
.admin-panel {
  max-width: 900px;
  margin: 6rem auto 2rem;
  padding: 0 1.5rem;
}
.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.admin-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.2s;
  outline: none;
}
.admin-input:focus { border-color: var(--accent); }
.admin-textarea {
  width: 100%;
  min-height: 300px;
  padding: 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.admin-textarea:focus { border-color: var(--accent); }
.admin-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-btn-primary { background: var(--accent); color: var(--accent-text); }
.admin-btn-primary:hover { opacity: 0.9; }
.admin-btn-danger { background: #ef4444; color: white; }
.admin-btn-danger:hover { background: #dc2626; }
.admin-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.admin-btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* --- 响应式工具 --- */
.hidden-mobile { display: none; }
@media (min-width: 768px) { .hidden-mobile { display: initial; } }
.hidden-desktop { display: initial; }
@media (min-width: 768px) { .hidden-desktop { display: none; } }

/* --- 页面过渡 --- */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeUp 0.4s ease-out; }