/*
  每日复盘 - 全局样式
  温暖治愈风格配色
*/

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ========== 自定义设计系统 ========== */
:root {
  /* 主色系 */
  --primary: #4a9c7f;
  --primary-light: #5fb496;
  --primary-dark: #3d8569;

  /* 背景色 */
  --bg-main: #f8f5f0;
  --bg-card: #ffffff;
  --bg-hover: #f0ebe4;

  /* 文字色 */
  --text-main: #2f2f2f;
  --text-muted: #6b6b6b;
  --text-light: #9a9a9a;

  /* 辅助色 */
  --accent: #e8d5b8;
  --accent-light: #f3e9d6;
  --border: #e5e0d8;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 过渡 */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式 */
[data-theme="dark"] {
  --bg-main: #1a1a1a;
  --bg-card: #252525;
  --bg-hover: #333333;
  --text-main: #e8e6e3;
  --text-muted: #a0a0a0;
  --text-light: #6b6b6b;
  --border: #3a3a3a;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
}

/* ========== 导航栏 ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 10px 18px;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--primary);
  background: var(--accent-light);
}

/* 移动端导航 */
@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 16px;
  }

  .nav-links {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
    gap: 4px;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  .nav-link {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 12px;
    gap: 4px;
  }

  .nav-link i {
    font-size: 20px;
  }
}

/* 移动端底部导航图标 */
.nav-icon-mobile {
  display: none;
}

@media (max-width: 768px) {
  .nav-icon-mobile {
    display: block;
    font-size: 20px;
  }

  .nav-link span:not(.sr-only) {
    display: none;
  }
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-hover);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
  margin-left: 8px;
}

.theme-toggle:hover {
  background: var(--accent);
  transform: rotate(15deg);
}

/* ========== 主容器 ========== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

@media (max-width: 768px) {
  .main-container {
    padding: 24px 16px 120px;
  }
}

/* ========== 卡片组件 ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--accent);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ========== 页面标题 ========== */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 17px;
  color: var(--text-muted);
}

/* ========== 输入框 ========== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-main);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(74, 156, 127, 0.15);
}

.form-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.7;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 15px;
  color: var(--text-muted);
}

/* ========== 动画 ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* 延迟动画 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 13px;
}

/* ========== 实用工具 ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.hidden { display: none; }

/* 屏幕阅读器 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  width: 100%;
  border-radius: var(--radius-lg);
  animation: fadeIn 0.3s ease;
}

/* ========== 日历 ========== */
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
