/* ========================================
   AI创意工坊 - 全局样式
   ======================================== */

/* 防止 Vue 模板闪烁 */
[v-cloak] {
  display: none !important;
}

/* CSS 变量 */
:root {
  --primary: #FE8D16;
  --primary-light: #FFB347;
  --primary-dark: #FF6B35;
  --gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FE8D16 50%, #FFB347 100%);
  --gradient-hero: linear-gradient(135deg, #FF6B35 0%, #FE8D16 30%, #FFB347 100%);
  --bg-dark: #0D0D12;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-sidebar: #141419;
  --text-primary: #FFFFFF;
  --text-secondary: #8B8B9A;
  --text-muted: #5A5A6A;
  --glow-orange: rgba(254, 141, 22, 0.5);
  --border-default: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(254, 141, 22, 0.3);
}

/* 重置样式 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { 
  scroll-behavior: smooth; 
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

#app { 
  min-height: 100vh; 
  max-width: 100%;
  overflow-x: hidden;
}

/* ========================================
   背景效果
   ======================================== */

.bg-effects {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(254, 141, 22, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 179, 71, 0.1) 0%, transparent 60%);
  animation: bgFloat 15s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(3%, 2%) rotate(2deg); }
  66% { transform: translate(-2%, 3%) rotate(-2deg); }
}

.grid-overlay {
  position: absolute;
  width: 100%; height: 100%;
  background-image: 
    linear-gradient(rgba(254, 141, 22, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(254, 141, 22, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.particles { position: absolute; width: 100%; height: 100%; }

.particle {
  position: absolute;
  background: var(--gradient-orange);
  border-radius: 50%;
  opacity: 0;
  animation: particleFlow 8s infinite;
}

@keyframes particleFlow {
  0% { opacity: 0; transform: translateX(-100px) translateY(100vh); }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(100vw) translateY(-100px); }
}

.cursor-glow {
  position: fixed;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(254, 141, 22, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
}

/* ========================================
   布局
   ======================================== */

.app-layout { 
  display: flex; 
  min-height: 100vh; 
  position: relative; 
  z-index: 2; 
  max-width: 100%;
  overflow-x: hidden;
}

/* ========================================
   侧边栏
   ======================================== */

.sidebar {
  width: 260px;
  background: rgba(20, 20, 25, 0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
}

/* 隐藏滚动条但允许滚动 */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox 隐藏滚动条 */
.sidebar {
  scrollbar-width: none; /* Firefox 64+ */
  -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-header { padding: 24px 20px; border-bottom: 1px solid var(--border-default); }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient-orange);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--glow-orange);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
  animation: iconShine 3s infinite;
}

@keyframes iconShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.logo-icon svg { width: 22px; height: 22px; stroke: white; position: relative; z-index: 1; }
.logo-text { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; }

.create-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--gradient-orange);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(254, 141, 22, 0.3);
  position: relative;
  overflow: hidden;
}

.create-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.create-btn:hover::before { left: 100%; }
.create-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(254, 141, 22, 0.5); }
.create-btn svg { width: 18px; height: 18px; }

/* 新建创作下拉菜单 */
.create-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 8px;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.create-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.create-menu-item:hover {
  background: rgba(254, 141, 22, 0.15);
  color: var(--primary);
}

.ai-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.ai-icon.kimi { background: linear-gradient(135deg, #6B46C1, #A78BFA); }
.ai-icon.chatgpt { background: linear-gradient(135deg, #10a37f, #1a7f64); }
.ai-icon.deepseek { background: linear-gradient(135deg, #1e40af, #3b82f6); }

.sidebar-section { padding: 20px 16px; }
.sidebar-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-left: 12px; }
.nav-menu { list-style: none; }
.nav-item { margin-bottom: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--gradient-orange);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.nav-link:hover::before { transform: scaleY(1); }
.nav-link.active { background: rgba(254, 141, 22, 0.15); color: var(--primary); }
.nav-link.active::before { transform: scaleY(1); }
.nav-link svg { width: 20px; height: 20px; stroke-width: 1.5; }

.nav-link .badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--gradient-orange);
  border-radius: 20px;
  font-size: 0.7rem;
  color: white;
  font-weight: 600;
}

/* 二级菜单 */
.nav-submenu {
  margin-left: 32px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nav-submenu.open {
  max-height: 200px;
}

.nav-submenu .nav-link {
  padding: 5px 12px;
  font-size: 0.85rem;
  margin: 3px 0;
}

.nav-submenu .nav-link svg {
  width: 16px;
  height: 16px;
}

.has-submenu {
  position: relative;
}

.has-submenu > .nav-link::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  transition: transform 0.3s ease;
}

.has-submenu.open > .nav-link::after {
  transform: translateY(-50%) rotate(180deg);
}

/* ========================================
   主内容区域
   ======================================== */

.main-content { flex: 1; margin-left: 260px; min-height: 100vh; }

/* 主容器 - 用于带侧边栏的页面 */
.main-container {
  display: flex;
  flex: 1;
  margin-left: 260px;
  padding-top: 70px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* 页面内容区域 */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 100%;
  overflow-x: hidden;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .main-container {
    margin-left: 0;
  }
  
  .page-content {
    padding: 16px;
  }
}

/* 顶部导航 - 用于内页 */
.header {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 70px;
  background: rgba(13, 13, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}

.menu-toggle {
  display: none;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .header {
    left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
}

/* 顶部导航 */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 13, 18, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  overflow: visible;
}

.header-search { position: relative; width: 400px; max-width: 100%; flex-shrink: 1; }
.header-search input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
  max-width: 100%;
}

.header-search input:focus { border-color: var(--primary); box-shadow: 0 0 20px rgba(254, 141, 22, 0.15); }
.header-search input::placeholder { color: var(--text-muted); }
.header-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.header-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.header-btn:hover { border-color: var(--primary); color: var(--primary); }

.chat-btn {
  background: rgba(254, 141, 22, 0.1);
  border-color: rgba(254, 141, 22, 0.3);
  color: var(--primary);
}

.chat-btn:hover {
  background: var(--gradient-orange);
  color: white;
  border-color: var(--primary);
}

.login-btn {
  padding: 8px 20px;
  background: var(--gradient-orange);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(254, 141, 22, 0.3);
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(254, 141, 22, 0.5); }

.user-avatar {
  width: 36px; height: 36px;
  background: var(--gradient-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(254, 141, 22, 0.3);
}

.content-area { padding: 24px 32px 40px; max-width: 100%; overflow-x: hidden; }

/* 确保所有容器都不会超出宽度 */
.app-layout,
.content-area {
  max-width: 100%;
  overflow-x: hidden;
}
.main-content {
  max-width: 100%;
  overflow: visible;
}

/* 底部版权 */
.footer {
    text-align: center;
    padding: 24px 32px;
    border-top: 1px solid var(--border-default);
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========================================
   Hero Banner
   ======================================== */

.hero-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(254, 141, 22, 0.12) 0%, rgba(255, 107, 53, 0.08) 50%, rgba(20, 20, 25, 0.9) 100%);
  border: 1px solid rgba(254, 141, 22, 0.2);
  border-radius: 24px;
  padding: 56px;
  margin-bottom: 40px;
  overflow: hidden;
  max-width: 100%;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 70%; height: 200%;
  background: radial-gradient(ellipse, rgba(254, 141, 22, 0.25) 0%, transparent 70%);
  animation: bannerGlow 4s ease-in-out infinite;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -50%; left: -10%;
  width: 50%; height: 150%;
  background: radial-gradient(ellipse, rgba(255, 107, 53, 0.15) 0%, transparent 70%);
  animation: bannerGlow2 6s ease-in-out infinite;
}

@keyframes bannerGlow {
  0%, 100% { opacity: 0.6; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(3deg); }
}

@keyframes bannerGlow2 {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.light-line {
  position: absolute;
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: lightLine 3s linear infinite;
}

.light-line:nth-child(1) { top: 20%; animation-delay: 0s; }
.light-line:nth-child(2) { top: 50%; animation-delay: 1s; }
.light-line:nth-child(3) { top: 80%; animation-delay: 2s; }

@keyframes lightLine {
  0% { left: -200px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.hero-content { position: relative; z-index: 1; max-width: 650px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(254, 141, 22, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(254, 141, 22, 0); }
}

.hero-banner h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
  animation: fadeInUp 0.8s ease-out;
}

.hero-banner h1 .highlight {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.hero-banner h1 .highlight::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 4px;
  background: var(--gradient-orange);
  border-radius: 2px;
  animation: underlineGrow 2s ease-out infinite;
}

@keyframes underlineGrow {
  0%, 100% { width: 0; opacity: 0; }
  50% { width: 100%; opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-desc { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 32px; max-width: 500px; animation: fadeInUp 0.8s ease-out 0.2s backwards; }

.hero-stats { display: flex; gap: 40px; animation: fadeInUp 0.8s ease-out 0.4s backwards; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; position: relative; padding-right: 20px; }
.hero-stat::after { content: ''; position: absolute; right: 0; top: 50%; width: 1px; height: 60%; background: var(--border-default); }
.hero-stat:last-child::after { display: none; }

.hero-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.hero-stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ========================================
   分类标签
   ======================================== */

.category-tabs { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }

.category-tab {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-orange);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-tab span { position: relative; z-index: 1; }
.category-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }
.category-tab.active { border-color: var(--primary); color: white; }
.category-tab.active::before { opacity: 1; }

/* ========================================
   工具卡片
   ======================================== */

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.section-title svg { width: 22px; height: 22px; stroke: var(--primary); }

.view-all {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-all:hover { color: var(--primary); }
.view-all svg { transition: transform 0.3s ease; }
.view-all:hover svg { transform: translateX(4px); }

.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; max-width: 100%; overflow: hidden; }

.tool-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-orange);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(254, 141, 22, 0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tool-card:hover::after { opacity: 1; }
.tool-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px rgba(254, 141, 22, 0.2);
}
.tool-card:hover::before { transform: scaleX(1); }

.tool-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }

.tool-icon {
  width: 52px; height: 52px;
  background: var(--gradient-orange);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(254, 141, 22, 0.3);
}

.tool-card:hover .tool-icon { transform: scale(1.1) rotate(5deg); box-shadow: 0 8px 25px rgba(254, 141, 22, 0.5); }
.tool-icon svg { width: 26px; height: 26px; stroke: white; }

.tool-tag {
  padding: 4px 12px;
  background: rgba(254, 141, 22, 0.15);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}

.tool-tag.hot { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.tool-tag.new { background: rgba(34, 197, 94, 0.15); color: #22C55E; }

.tool-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; }
.tool-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tool-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-default); }
.tool-users { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
.tool-users svg { width: 14px; height: 14px; }

.tool-arrow {
  width: 32px; height: 32px;
  background: rgba(254, 141, 22, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.tool-card:hover .tool-arrow { opacity: 1; transform: translateX(0); }
.tool-arrow svg { width: 18px; height: 18px; stroke: var(--primary); }

.breathing { animation: breathing 3s ease-in-out infinite; }

@keyframes breathing {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ========================================
   移动端适配
   ======================================== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(13, 13, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
}

.mobile-menu-toggle { background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 8px; flex-shrink: 0; }
.mobile-menu-toggle svg { width: 24px; height: 24px; }

.mobile-header .logo { text-decoration: none; }

.mobile-login-btn {
  padding: 6px 12px;
  background: var(--gradient-orange);
  border-radius: 8px;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
}

.mobile-header .logo-text {
  font-size: 1rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  flex-shrink: 0;
}

.mobile-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 140px);
  overflow: hidden;
}

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); z-index: 99; }
.sidebar-overlay.active { display: block; }

@media (max-width: 1200px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open .sidebar-header { padding-top: 70px; }
  .main-content { margin-left: 0; max-width: 100%; }
  .mobile-header { display: flex; }
  .top-header { display: none; }
  .content-area { padding-top: 80px; max-width: 100%; }
}

@media (max-width: 900px) {
  .header-search { width: 250px; }
  .header-actions { gap: 12px; }
  .header-btn { padding: 6px 12px; font-size: 0.8rem; }
  .login-btn { padding: 6px 14px; font-size: 0.85rem; }
}

@media (max-width: 768px) {
  .top-header { padding: 12px 16px; }
  .header-search { width: 180px; }
}

@media (max-width: 768px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 100%; }
  .hero-banner { padding: 32px 16px; margin-left: 0; margin-right: 0; width: 100%; max-width: 100%; }
  .hero-banner h1 { font-size: 1.75rem; word-wrap: break-word; }
  .hero-stats { gap: 24px; }
  .hero-stat-value { font-size: 1.5rem; }
  .content-area { padding: 80px 12px 32px; margin: 0; }
  .category-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .category-tab { white-space: nowrap; flex-shrink: 0; }
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-title { font-size: 1.1rem; }
  .footer { padding: 20px 12px; font-size: 0.8rem; }
  .section-title svg { flex-shrink: 0; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; width: 100%; max-width: 100%; }
  .hero-stats { flex-direction: row; gap: 12px; justify-content: space-between; align-items: center; width: 100%; }
  .hero-stat { padding-right: 0; flex: 1; text-align: center; }
  .hero-stat::after { display: none; }
  .hero-banner { padding: 24px 16px; margin-left: 0; margin-right: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
  .hero-banner h1 { font-size: 1.5rem; word-wrap: break-word; }
  .hero-desc { font-size: 0.9rem; max-width: 100%; }
  .tool-card { width: 100%; }
  .mobile-header { padding: 10px 12px; }
  .mobile-header .logo-icon { width: 32px; height: 32px; }
  .mobile-header .logo-icon svg { width: 18px; height: 18px; }
  .mobile-header .logo-text { font-size: 0.9rem; max-width: 80px; }
  .mobile-header .mobile-login-btn { padding: 5px 10px; font-size: 0.8rem; }
  .mobile-menu-toggle { padding: 6px; }
  .mobile-menu-toggle svg { width: 20px; height: 20px; }
}

/* 极小屏幕适配 */
@media (max-width: 360px) {
  .mobile-header .logo-text { 
    display: none; 
  }
  .mobile-header .logo {
    max-width: 50px;
  }
}

/* ========================================
   AI模型选择弹窗
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.model-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.model-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.model-option.selected {
  background: rgba(254, 141, 22, 0.1);
  border-color: var(--primary);
}

.model-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.model-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

.model-icon.chatgpt {
  background: linear-gradient(135deg, #10a37f, #1a7f64);
  box-shadow: 0 4px 15px rgba(16, 163, 127, 0.3);
}

.model-icon.kimi {
  background: linear-gradient(135deg, #6B46C1, #A78BFA);
  box-shadow: 0 4px 15px rgba(107, 70, 193, 0.3);
}

.model-icon.deepseek {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.model-info {
  flex: 1;
  min-width: 0;
}

.model-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.model-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.model-check svg {
  width: 14px;
  height: 14px;
  stroke: white;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.model-option.selected .model-check {
  background: var(--gradient-orange);
  border-color: var(--primary);
}

.model-option.selected .model-check svg {
  opacity: 1;
  transform: scale(1);
}

.modal-footer {
  display: flex;
  justify-content: center;
}

.modal-btn {
  padding: 14px 40px;
  background: var(--gradient-orange);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(254, 141, 22, 0.4);
}

.modal-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(254, 141, 22, 0.5);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .modal-content {
    padding: 24px;
    border-radius: 20px;
    margin: 16px;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .model-option {
    padding: 12px;
    gap: 12px;
  }

  .model-icon {
    width: 40px;
    height: 40px;
  }

  .model-icon svg {
    width: 24px;
    height: 24px;
  }

  .model-name {
    font-size: 0.95rem;
  }

  .model-desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
  }

  .modal-btn {
    padding: 12px 32px;
    font-size: 0.95rem;
    width: 100%;
  }
}

/* ========================================
   卡密兑换弹窗
   ======================================== */

.redeem-modal {
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 0;
  max-width: 420px;
  width: 90%;
  animation: slideUp 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.redeem-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 0;
}

.redeem-modal .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.redeem-modal .modal-header h3 svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
}

.redeem-modal .modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.redeem-modal .modal-close:hover {
  color: var(--text-primary);
}

.redeem-modal .modal-close svg {
  width: 20px;
  height: 20px;
}

.redeem-modal .modal-body {
  padding: 24px;
}

.redeem-info {
  background: rgba(254, 141, 22, 0.1);
  border: 1px solid rgba(254, 141, 22, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.redeem-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.redeem-form .form-group {
  margin-bottom: 16px;
}

.redeem-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.redeem-form input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.redeem-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(254, 141, 22, 0.05);
}

.redeem-form input[type="text"]::placeholder {
  color: var(--text-muted);
}

.verify-code-group {
  display: flex;
  gap: 12px;
}

.verify-code-group input {
  flex: 1;
}

.verify-code-img {
  width: 100px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: #333;
  transition: border-color 0.2s;
}

.verify-code-img:hover {
  border-color: var(--primary);
}

.redeem-result {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

.redeem-result.success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.redeem-result.error {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.redeem-modal .modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-redeem {
  padding: 10px 28px;
  background: var(--gradient-orange);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(254, 141, 22, 0.3);
}

.btn-redeem:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 141, 22, 0.4);
}

.btn-redeem:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .redeem-modal {
    border-radius: 16px;
  }

  .redeem-modal .modal-header {
    padding: 16px 20px;
  }

  .redeem-modal .modal-body {
    padding: 20px;
  }

  .redeem-modal .modal-footer {
    padding: 12px 20px 20px;
    flex-direction: column;
  }

  .btn-cancel,
  .btn-redeem {
    width: 100%;
    text-align: center;
  }

  .verify-code-group {
    flex-direction: column;
    gap: 8px;
  }

  .verify-code-img {
    width: 100%;
    height: 44px;
  }
}
