/* ============================================================
   style.css — 轻时 LightTime v3.0
   Golden Hour Companion — 暖琥珀 · 书房灯光
   ============================================================ */

/* ===== 字体引入 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

/* ===== CSS 变量 ===== */
:root {
  /* 主色调 — 暖琥珀系 */
  --rest-moss: #8BA87D;
  --rest-moss-dark: #6B8A5E;
  --rest-moss-light: #A8C49A;
  --work-amber: #D4914A;
  --work-amber-dark: #B87535;
  --work-amber-light: #E8B87A;
  --accent-terracotta: #C17D60;
  --accent-cream: #F5E6D3;

  /* 背景 — 暖棕书房 */
  --bg-primary: #1A1210;
  --bg-secondary: #241915;
  --bg-tertiary: #2E2018;
  --bg-surface: rgba(36, 25, 21, 0.75);
  --bg-surface-hover: rgba(46, 32, 24, 0.85);
  --bg-card: rgba(30, 20, 16, 0.65);
  --bg-input: rgba(24, 16, 12, 0.8);

  /* 文字 */
  --text-primary: #F0E6D8;
  --text-secondary: #C4B5A5;
  --text-muted: #8A7A6A;
  --text-inverse: #1A1210;

  /* 边框 */
  --border: rgba(196, 181, 165, 0.1);
  --border-light: rgba(196, 181, 165, 0.18);

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-amber: 0 0 24px rgba(212, 145, 74, 0.2);
  --shadow-glow-moss: 0 0 24px rgba(139, 168, 125, 0.15);

  /* 字体 */
  --font-display: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space: 12px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;

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

/* ===== 全局重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-body);
  font-size: 14px; line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

/* ===== 纹理背景层 ===== */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(196, 181, 165, 0.5) 2px, rgba(196, 181, 165, 0.5) 3px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(196, 181, 165, 0.5) 2px, rgba(196, 181, 165, 0.5) 3px);
}

/* ===== 粒子背景 ===== */
#particle-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ===== 应用容器 ===== */
#app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh; max-width: 800px; margin: 0 auto;
  background: transparent;
}

/* 顶部暖光 */
#app::before {
  content: '';
  position: fixed; top: -15%; left: 50%; transform: translateX(-50%);
  width: 500px; height: 350px;
  background: radial-gradient(ellipse, rgba(212, 145, 74, 0.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* 底部冷光对比 */
#app::after {
  content: '';
  position: fixed; bottom: -10%; left: 50%; transform: translateX(-50%);
  width: 400px; height: 250px;
  background: radial-gradient(ellipse, rgba(139, 168, 125, 0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ===== 头部 ===== */
#app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space) var(--space-md);
  background: rgba(26, 18, 16, 0.75);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border-bottom: 1px solid var(--border);
  z-index: 10; flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: var(--space-sm); }

.logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--work-amber-light), var(--work-amber-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-inverse);
  position: relative;
  box-shadow: 0 2px 12px rgba(212, 145, 74, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.logo::after {
  content: '';
  position: absolute; top: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--work-amber);
  border: 2px solid var(--bg-primary);
  animation: logo-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes logo-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 145, 74, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(212, 145, 74, 0); }
}

.app-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 1px;
}

.header-right { display: flex; align-items: center; gap: var(--space-sm); }

/* 连接状态指示器 */
.conn-indicator {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(36, 25, 21, 0.6);
  border: 1px solid var(--border);
  cursor: default; transition: var(--transition);
}

.conn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.conn-indicator.conn-online .conn-dot {
  background: #6B8A5E;
  box-shadow: 0 0 8px rgba(107, 138, 94, 0.5);
}

.conn-indicator.conn-offline .conn-dot {
  background: #c45a4a;
  box-shadow: 0 0 8px rgba(196, 90, 74, 0.5);
}

.conn-indicator.conn-checking .conn-dot {
  background: var(--work-amber);
  animation: conn-pulse 1s ease-in-out infinite;
}

@keyframes conn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 状态徽章 */
.status-badge {
  padding: 4px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; font-family: var(--font-body);
  transition: var(--transition);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.status-idle {
  background: rgba(36, 25, 21, 0.5);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.status-working {
  background: rgba(212, 145, 74, 0.1);
  color: var(--work-amber);
  border: 1px solid rgba(212, 145, 74, 0.25);
  box-shadow: 0 0 14px rgba(212, 145, 74, 0.08);
}

.status-resting {
  background: rgba(139, 168, 125, 0.1);
  color: var(--rest-moss);
  border: 1px solid rgba(139, 168, 125, 0.25);
  box-shadow: 0 0 14px rgba(139, 168, 125, 0.08);
}

/* 设置按钮 */
.settings-btn {
  width: 32px; height: 32px; border: none; border-radius: var(--radius);
  background: rgba(36, 25, 21, 0.5); color: var(--text-secondary);
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.settings-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: rotate(30deg);
}

/* ===== 离线提示横幅 ===== */
.offline-banner {
  display: flex; align-items: center; gap: 12px;
  margin: var(--space-sm) var(--space-md);
  padding: 12px 16px;
  background: rgba(196, 90, 74, 0.08);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 90, 74, 0.2);
  border-radius: var(--radius);
  animation: banner-shake 0.5s ease-in-out;
}

.offline-banner-icon { font-size: 24px; flex-shrink: 0; }

.offline-banner-text {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}

.offline-banner-text strong { color: #e0a090; font-size: 14px; }

.offline-banner-text code {
  background: rgba(196, 90, 74, 0.12); padding: 1px 6px;
  border-radius: 4px; font-size: 12px; color: #e0a090;
}

@keyframes banner-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===== 聊天区域 ===== */
#chat-area { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space);
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 145, 74, 0.15); border-radius: var(--radius-full);
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 145, 74, 0.3);
}

/* ===== 消息气泡 ===== */
.message {
  display: flex; gap: var(--space-sm);
  opacity: 0; transform: translateY(14px);
  animation: msgSlideIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes msgSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

.message.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.ai-avatar {
  background: linear-gradient(135deg, rgba(139, 168, 125, 0.2), rgba(139, 168, 125, 0.08));
  color: var(--rest-moss);
  box-shadow: 0 2px 8px rgba(139, 168, 125, 0.12);
}

.user-avatar {
  background: linear-gradient(135deg, rgba(212, 145, 74, 0.2), rgba(212, 145, 74, 0.08));
  color: var(--work-amber);
  box-shadow: 0 2px 8px rgba(212, 145, 74, 0.12);
}

.msg-content {
  max-width: 75%; padding: var(--space) var(--space-md);
  border-radius: var(--radius-lg); line-height: 1.7;
}

.message.ai .msg-content {
  background: rgba(36, 25, 21, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(196, 181, 165, 0.06);
  border-top-left-radius: var(--radius-sm);
  color: var(--text-primary);
}

.message.user .msg-content {
  background: linear-gradient(135deg, rgba(212, 145, 74, 0.7), rgba(184, 117, 53, 0.5));
  color: #FFF8F0;
  border-top-right-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(212, 145, 74, 0.15);
}

.message-card .msg-content {
  padding: 0; background: transparent; border: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  max-width: 90%;
}

.msg-text { white-space: pre-wrap; word-break: break-word; }

/* ===== 选项按钮 ===== */
.msg-options {
  display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space);
}

.option-btn {
  padding: 8px 16px;
  border: 1px solid rgba(196, 181, 165, 0.15);
  border-radius: var(--radius-full);
  background: rgba(30, 20, 16, 0.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  cursor: pointer; font-size: 13px; font-family: var(--font-body);
  transition: all var(--transition-smooth);
}

.option-btn:hover {
  border-color: var(--rest-moss);
  color: var(--rest-moss);
  background: rgba(139, 168, 125, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 168, 125, 0.1);
}

.option-btn.selected {
  border-color: var(--rest-moss);
  background: linear-gradient(135deg, var(--rest-moss-dark), var(--rest-moss));
  color: var(--text-inverse);
}

.option-btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

/* ===== 智能按钮栏 ===== */
.smart-buttons {
  display: flex; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto; flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(26, 18, 16, 0.75);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.smart-buttons::-webkit-scrollbar { height: 0; }

.smart-btn {
  padding: 9px 18px;
  border: 1px solid rgba(196, 181, 165, 0.12);
  border-radius: var(--radius-full);
  background: rgba(36, 25, 21, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  cursor: pointer; font-size: 13px; font-family: var(--font-body);
  white-space: nowrap; transition: all var(--transition-smooth); flex-shrink: 0;
}

.smart-btn:hover {
  border-color: var(--rest-moss);
  color: var(--rest-moss);
  background: rgba(139, 168, 125, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 168, 125, 0.1);
}

.smart-btn:active { transform: scale(0.96); }

/* 主操作按钮 */
.smart-btn.primary {
  padding: 14px 24px;
  font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--radius);
  flex: 3; min-width: 120px;
  text-align: center; justify-content: center;
  letter-spacing: 0.5px; font-family: var(--font-body);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

.smart-btn.primary::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: btn-shimmer 3.5s ease-in-out infinite;
}

@keyframes btn-shimmer {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

.smart-btn.primary.work {
  background: linear-gradient(135deg, var(--work-amber), var(--work-amber-dark));
  color: #FFF8F0;
  box-shadow: 0 2px 14px rgba(212, 145, 74, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: work-glow 2.5s ease-in-out infinite;
}

@keyframes work-glow {
  0%, 100% { box-shadow: 0 2px 14px rgba(212, 145, 74, 0.35), inset 0 1px 0 rgba(255,255,255,0.15); }
  50% { box-shadow: 0 4px 24px rgba(212, 145, 74, 0.55), inset 0 1px 0 rgba(255,255,255,0.2); }
}

.smart-btn.primary.work:hover {
  background: linear-gradient(135deg, var(--work-amber-light), var(--work-amber));
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 145, 74, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.smart-btn.primary.work:active { transform: translateY(0) scale(0.97); }

.smart-btn.primary.rest {
  background: linear-gradient(135deg, var(--rest-moss), var(--rest-moss-dark));
  color: #FFF8F0;
  box-shadow: 0 2px 14px rgba(139, 168, 125, 0.35), inset 0 1px 0 rgba(255,255,255,0.12);
  animation: rest-glow 2.5s ease-in-out infinite;
}

@keyframes rest-glow {
  0%, 100% { box-shadow: 0 2px 14px rgba(139, 168, 125, 0.35), inset 0 1px 0 rgba(255,255,255,0.12); }
  50% { box-shadow: 0 4px 24px rgba(139, 168, 125, 0.55), inset 0 1px 0 rgba(255,255,255,0.18); }
}

.smart-btn.primary.rest:hover {
  background: linear-gradient(135deg, var(--rest-moss-light), var(--rest-moss));
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(139, 168, 125, 0.5), inset 0 1px 0 rgba(255,255,255,0.18);
}

.smart-btn.primary.rest:active { transform: translateY(0) scale(0.97); }

/* ===== 输入区域 ===== */
.input-area {
  display: flex; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  flex-shrink: 0;
  background: rgba(26, 18, 16, 0.75);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1; padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(30, 20, 16, 0.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-size: 14px; font-family: var(--font-body);
  outline: none; transition: all var(--transition-smooth);
}

#chat-input::placeholder { color: var(--text-muted); }

#chat-input:focus {
  border-color: rgba(212, 145, 74, 0.45);
  background: rgba(36, 25, 21, 0.7);
  box-shadow: 0 0 0 3px rgba(212, 145, 74, 0.08),
              0 0 22px rgba(212, 145, 74, 0.06);
  animation: input-focus-pulse 2.5s ease-in-out infinite;
}

@keyframes input-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(212, 145, 74, 0.08), 0 0 22px rgba(212, 145, 74, 0.06); }
  50% { box-shadow: 0 0 0 5px rgba(212, 145, 74, 0.04), 0 0 32px rgba(212, 145, 74, 0.1); }
}

#send-btn {
  width: 42px; height: 42px; border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--work-amber), var(--work-amber-dark));
  color: #FFF8F0; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px rgba(212, 145, 74, 0.25);
  flex-shrink: 0;
}

#send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 18px rgba(212, 145, 74, 0.45);
}

#send-btn:active { transform: scale(0.9); }

/* ===== 空状态 / 欢迎页 ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; min-height: 100%;
  padding: 40px 20px; text-align: center;
  animation: welcomeFadeIn 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  position: relative;
}

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

.empty-glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(212, 145, 74, 0.1) 0%, rgba(139, 168, 125, 0.04) 50%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
}

.empty-logo {
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--work-amber-light), var(--work-amber-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin-bottom: 22px; position: relative; z-index: 1;
  box-shadow: 0 8px 36px rgba(212, 145, 74, 0.3), inset 0 2px 0 rgba(255,255,255,0.2);
  animation: iconFloat 3.5s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; margin-bottom: 8px;
  position: relative; z-index: 1;
  background: linear-gradient(135deg, var(--work-amber-light), var(--accent-cream));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-tagline {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 30px; position: relative; z-index: 1;
}

.empty-capabilities {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 320px; position: relative; z-index: 1;
}

.empty-cap-item {
  display: flex; align-items: center; gap: var(--space);
  padding: 12px 16px;
  background: rgba(36, 25, 21, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text-secondary);
  transition: all var(--transition-smooth);
  animation: capItemIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.empty-cap-item:nth-child(1) { animation-delay: 0.2s; }
.empty-cap-item:nth-child(2) { animation-delay: 0.35s; }
.empty-cap-item:nth-child(3) { animation-delay: 0.5s; }

@keyframes capItemIn {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

.empty-cap-item:hover {
  border-color: rgba(212, 145, 74, 0.25);
  background: rgba(212, 145, 74, 0.05);
  transform: translateX(4px);
}

.empty-cap-icon { font-size: 20px; flex-shrink: 0; }

/* ===== 面板（能力/设置） ===== */
.panel-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 8, 6, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100; display: none;
  align-items: flex-end; justify-content: center;
}

.panel-content {
  width: 100%; max-width: 500px; max-height: 70vh; overflow-y: auto;
  background: rgba(30, 20, 16, 0.96);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  animation: panelSlideUp 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
}

@keyframes panelSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-md);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: var(--text-primary);
}

.panel-close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(36, 25, 21, 0.5); color: var(--text-secondary);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.panel-close:hover { background: rgba(196, 90, 74, 0.15); color: #e0a090; }

.panel-section { margin-bottom: var(--space-md); }

.panel-section-title {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: var(--space-sm); padding-left: 4px;
  font-family: var(--font-body);
}

.panel-btn {
  width: 100%; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(36, 25, 21, 0.4); color: var(--text-primary);
  cursor: pointer; font-size: 14px; font-family: var(--font-body);
  transition: all var(--transition-smooth); text-align: left;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.panel-btn:hover {
  border-color: var(--rest-moss);
  background: rgba(139, 168, 125, 0.06);
  transform: translateY(-1px);
}

.panel-btn.warning:hover {
  border-color: #c45a4a;
  background: rgba(196, 90, 74, 0.06);
  color: #e0a090;
}

/* ===== 能力列表 ===== */
.capability-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.capability-item {
  display: flex; align-items: center; gap: var(--space);
  padding: var(--space) var(--space-md);
  border-radius: var(--radius);
  background: rgba(36, 25, 21, 0.35);
  transition: all var(--transition-smooth);
  cursor: pointer; border: 1px solid transparent;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.capability-item:hover {
  background: rgba(139, 168, 125, 0.06);
  border-color: rgba(139, 168, 125, 0.2);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(139, 168, 125, 0.08);
}

.capability-item:active { transform: scale(0.98); }

.cap-icon { font-size: 22px; flex-shrink: 0; }
.cap-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.cap-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}

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

.cap-arrow {
  margin-left: auto; color: var(--text-muted); font-size: 14px;
  transition: all var(--transition-smooth);
}

.capability-item:hover .cap-arrow {
  color: var(--rest-moss);
  transform: translateX(4px);
}

/* ===== 卡片（时间线/热力图/规划/周报/节奏环） ===== */
.card {
  background: rgba(36, 25, 21, 0.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-md);
  margin-top: var(--space-sm); overflow: hidden;
}

.card-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--space); padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600; color: var(--text-primary);
}

.card-date, .card-subtitle { font-size: 12px; color: var(--text-muted); }

.card-stats { display: flex; gap: var(--space); margin-bottom: var(--space); }

.stat-item {
  flex: 1; text-align: center;
  padding: var(--space-sm); background: rgba(24, 16, 12, 0.4);
  border-radius: var(--radius); border: 1px solid var(--border);
}

.stat-value {
  display: block; font-size: 20px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 2px;
}

.stat-label { font-size: 11px; color: var(--text-muted); }

.card-empty {
  text-align: center; padding: var(--space-xl) 0; color: var(--text-muted);
}

.card-empty p { margin-bottom: var(--space-xs); }

.card-hint { font-size: 11px; color: var(--text-muted); margin-top: var(--space-sm); }

.card-footer {
  margin-top: var(--space); padding-top: var(--space-sm);
  border-top: 1px solid var(--border); text-align: center;
}

/* ===== 时间线 ===== */
.card-timeline { padding-bottom: var(--space-sm); }

.tl-item {
  display: flex; gap: var(--space);
  padding: var(--space-sm) 0; position: relative;
}

.tl-item:not(:last-child)::after {
  content: '';
  position: absolute; left: 6px; top: 28px; bottom: 0;
  width: 2px; background: var(--border);
}

.tl-dot {
  width: 14px; height: 14px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px; position: relative; z-index: 1;
}

.tl-work .tl-dot {
  background: var(--work-amber);
  box-shadow: 0 0 8px rgba(212, 145, 74, 0.4);
}

.tl-rest .tl-dot {
  background: var(--rest-moss);
  box-shadow: 0 0 8px rgba(139, 168, 125, 0.4);
}

.tl-content { flex: 1; min-width: 0; }

.tl-top { display: flex; align-items: center; gap: var(--space-sm); }

.tl-icon { font-size: 14px; }

.tl-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.tl-duration { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.tl-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.tl-meta {
  font-size: 11px; color: var(--rest-moss); margin-top: 2px; display: inline-block;
}

/* ===== 热力图 ===== */
.heatmap-grid { overflow-x: auto; padding-bottom: var(--space-sm); }

.heatmap-header { display: flex; gap: 2px; margin-bottom: 2px; }

.heatmap-label { width: 36px; flex-shrink: 0; }

.heatmap-col-label {
  width: 28px; flex-shrink: 0; font-size: 9px;
  color: var(--text-muted); text-align: center;
}

.heatmap-row { display: flex; gap: 2px; margin-bottom: 2px; }

.heatmap-row-label {
  width: 36px; flex-shrink: 0; font-size: 11px;
  color: var(--text-secondary); line-height: 20px;
}

.heatmap-cell {
  width: 28px; height: 20px; border-radius: 3px; flex-shrink: 0;
}

.heatmap-cell.level-0 { background: rgba(36, 25, 21, 0.4); }
.heatmap-cell.level-1 { background: rgba(212, 145, 74, 0.2); }
.heatmap-cell.level-2 { background: rgba(212, 145, 74, 0.4); }
.heatmap-cell.level-3 { background: rgba(212, 145, 74, 0.65); }
.heatmap-cell.level-4 { background: rgba(212, 145, 74, 0.9); }

.heatmap-legend {
  display: flex; align-items: center; gap: 4px;
  margin-top: var(--space-sm); font-size: 11px; color: var(--text-muted);
}

.legend-cell {
  width: 16px; height: 12px; border-radius: 3px;
}

.legend-cell.level-0 { background: rgba(36, 25, 21, 0.4); }
.legend-cell.level-1 { background: rgba(212, 145, 74, 0.2); }
.legend-cell.level-2 { background: rgba(212, 145, 74, 0.4); }
.legend-cell.level-3 { background: rgba(212, 145, 74, 0.65); }
.legend-cell.level-4 { background: rgba(212, 145, 74, 0.9); }

/* ===== 规划 ===== */
.plan-segments { display: flex; flex-direction: column; gap: 6px; }

.plan-segment {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); transition: var(--transition);
}

.plan-segment:hover {
  border-color: rgba(196, 181, 165, 0.25);
  background: rgba(36, 25, 21, 0.4);
}

.plan-work { border-left: 3px solid var(--work-amber); }
.plan-rest { border-left: 3px solid var(--rest-moss); }

.plan-icon { font-size: 16px; flex-shrink: 0; }

.plan-time {
  font-size: 12px; color: var(--text-secondary);
  flex-shrink: 0; min-width: 100px;
}

.plan-label {
  font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1;
}

.plan-duration { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ===== 节奏环 ===== */
.ring-container {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space) 0;
}

.ring-wrap { position: relative; width: 240px; height: 240px; }

.ring-svg { width: 100%; height: 100%; }

.ring-center-text {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}

.ring-work-hours {
  display: block; font-size: 28px; font-weight: 700;
  color: var(--text-primary); line-height: 1.1;
}

.ring-work-label {
  display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

.ring-rest-count {
  display: block; font-size: 12px; color: var(--rest-moss);
  margin-top: 4px; font-weight: 500;
}

.ring-legend {
  display: flex; gap: var(--space-md); margin-top: var(--space);
  flex-wrap: wrap; justify-content: center;
}

.ring-legend-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
}

.ring-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}

.ring-hour-label { font-size: 10px; fill: var(--text-muted); }

/* ===== 自定义输入（休息问题） ===== */
.custom-input:focus {
  border-color: rgba(139, 168, 125, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(139, 168, 125, 0.1) !important;
}

.custom-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(139, 168, 125, 0.3);
}

/* ===== 打字指示器 ===== */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }

.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(139, 168, 125, 0.5);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .empty-title { font-size: 24px; }
  .empty-logo { width: 64px; height: 64px; font-size: 34px; }
  .smart-btn.primary { padding: 12px 18px; font-size: 14px; min-width: 100px; }
  .msg-content { max-width: 85%; }
}