@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* ========================================
   MD2Card 特殊主题样式
   ======================================== */

/* 苹果备忘录风格 */
.theme-apple-notes {
  background: #fff9c4 !important;
  background-image: 
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      rgba(0, 0, 0, 0.03) 27px,
      rgba(0, 0, 0, 0.03) 28px
    ) !important;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05),
    inset 0 4px 0 0 linear-gradient(90deg, #ffc107 0%, #ff9800 100%) !important;
  position: relative;
}

.theme-apple-notes::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* 线圈记事本风格 */
.theme-spiral-notebook {
  position: relative;
  background: #fefefe !important;
  background-image: 
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      #e0e0e0 27px,
      #e0e0e0 28px
    ) !important;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.1),
    inset -2px 0 0 #3b82f6 !important;
}

.theme-spiral-notebook::before {
  content: '';
  position: absolute;
  left: 20px;
  top: -10px;
  bottom: -10px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 8px,
    #d1d5db 8px,
    #d1d5db 18px,
    transparent 18px,
    transparent 28px
  );
}

.theme-spiral-notebook .markdown-content {
  margin-left: 20px;
}

/* 玻璃拟态风格 */
.theme-glassmorphism {
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  box-shadow: 
    0 8px 32px rgba(31, 38, 135, 0.37),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
}

/* 霓虹灯风格 */
.theme-neon {
  background: #0a0a0a !important;
  border: 2px solid #00ffff !important;
  box-shadow: 
    0 0 10px #00ffff,
    0 0 20px #00ffff,
    0 0 40px #00ffff,
    inset 0 0 20px rgba(0, 255, 255, 0.1) !important;
}

.theme-neon h1,
.theme-neon h2,
.theme-neon h3 {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 20px currentColor;
}

.theme-neon strong {
  color: #ff00ff;
  text-shadow: 
    0 0 5px #ff00ff,
    0 0 10px #ff00ff;
}

/* 报纸风格 */
.theme-newspaper {
  background: #f5f0e6 !important;
  font-family: 'Times New Roman', Times, serif !important;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

.theme-newspaper h1 {
  font-size: 1.8em !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 3px double currentColor;
  padding-bottom: 0.5rem;
}

/* 黑板风格 */
.theme-chalkboard {
  background: #2a5a3a !important;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%) !important;
  box-shadow: 
    inset 0 0 50px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(0, 0, 0, 0.3) !important;
  border: 8px solid #8b4513 !important;
}

.theme-chalkboard h1,
.theme-chalkboard h2,
.theme-chalkboard h3 {
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

/* 复古波浪风格 */
.theme-retro-wave {
  background: linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%) !important;
  position: relative;
  overflow: hidden;
}

.theme-retro-wave::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 10px,
    #ff6ec7 10px,
    #ff6ec7 20px,
    transparent 20px,
    transparent 30px
  );
  opacity: 0.3;
  pointer-events: none;
}

/* 牛皮纸风格 */
.theme-kraft-paper {
  background: #c4a574 !important;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

/* Notion 风格 */
.theme-notion {
  background: #ffffff !important;
  box-shadow: 
    rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,
    rgba(15, 15, 15, 0.1) 0px 3px 6px,
    rgba(15, 15, 15, 0.2) 0px 9px 24px !important;
}

.theme-notion h1 {
  font-size: 2em !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.5rem;
}

/* 奢华金风格 */
.theme-luxury-gold {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.theme-luxury-gold::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
  z-index: -1;
  border-radius: inherit;
}

.theme-luxury-gold h1,
.theme-luxury-gold h2 {
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* 像素风 */
.theme-pixel-art {
  background: #1e1e1e !important;
  image-rendering: pixelated;
  border: 4px solid #00ff00 !important;
  box-shadow: 
    4px 4px 0 #00ff00,
    8px 8px 0 #008000 !important;
}

.theme-pixel-art h1,
.theme-pixel-art h2,
.theme-pixel-art h3,
.theme-pixel-art p,
.theme-pixel-art li {
  font-family: 'Courier New', monospace;
  text-shadow: 2px 2px 0 #008000;
}

/* 画布风格 */
.theme-canvas {
  background: #f5f5dc !important;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 10px,
      rgba(0, 0, 0, 0.02) 10px,
      rgba(0, 0, 0, 0.02) 11px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 10px,
      rgba(0, 0, 0, 0.02) 10px,
      rgba(0, 0, 0, 0.02) 11px
    ) !important;
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid #d4c4a8 !important;
}

/* 霓虹灯闪烁动画 */
@keyframes neonFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow: 
      0 0 5px currentColor,
      0 0 10px currentColor,
      0 0 20px currentColor;
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

.theme-neon h1 {
  animation: neonFlicker 2s infinite;
}

/* ========================================
   新增主题样式
   ======================================== */

/* 微信朋友圈风格 */
.theme-wechat {
  background: #ffffff !important;
  border-left: 4px solid #07c160 !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

.theme-wechat h1 {
  font-weight: 600 !important;
  color: #1a1a1a !important;
}

/* 知乎风格 */
.theme-zhihu {
  background: #ffffff !important;
  border-top: 3px solid #0066ff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

.theme-zhihu h1 {
  font-weight: 600 !important;
}

/* Twitter/X 风格 */
.theme-twitter {
  background: #000000 !important;
  border: 1px solid #333 !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.theme-twitter h1 {
  font-weight: 800 !important;
}

/* Netflix 风格 */
.theme-netflix {
  background: #141414 !important;
  border: 2px solid #e50914 !important;
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.3) !important;
}

.theme-netflix h1 {
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #e50914;
}

/* YouTube 风格 */
.theme-youtube {
  background: #ffffff !important;
  border-bottom: 4px solid #ff0000 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.theme-youtube h1 {
  font-weight: 700 !important;
}

/* 邮票风格 */
.theme-stamp {
  background: #fff8e7 !important;
  border: 8px dashed #c41e3a !important;
  box-shadow: 
    inset 0 0 0 4px #fff8e7,
    inset 0 0 0 8px #c41e3a,
    0 4px 12px rgba(0, 0, 0, 0.1) !important;
  position: relative;
}

.theme-stamp::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 8px,
    #fff8e7 8px,
    #fff8e7 16px
  );
  z-index: -1;
}

/* 明信片风格 */
.theme-postcard {
  background: #fefae0 !important;
  border: 2px solid #bc6c25 !important;
  box-shadow: 
    4px 4px 0 #bc6c25,
    0 8px 16px rgba(0, 0, 0, 0.1) !important;
  position: relative;
}

.theme-postcard::before {
  content: '✉';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  opacity: 0.3;
}

/* 电影票风格 */
.theme-ticket {
  background: #fffef0 !important;
  border: 2px dashed #d4a373 !important;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.theme-ticket::before,
.theme-ticket::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: transparent;
  border-radius: 50%;
  border: 2px dashed #d4a373;
}

.theme-ticket::before {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-left: none;
}

.theme-ticket::after {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-right: none;
}

/* 老照片风格 */
.theme-old-photo {
  background: #d4c4a8 !important;
  box-shadow: 
    inset 0 0 50px rgba(0, 0, 0, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.3) !important;
  filter: sepia(20%);
}

.theme-old-photo h1,
.theme-old-photo h2 {
  font-family: 'Georgia', serif !important;
}

/* 星空风格 */
.theme-starry {
  position: relative;
  overflow: hidden;
}

.theme-starry::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #ffd700, transparent),
    radial-gradient(2px 2px at 40px 70px, #ffffff, transparent),
    radial-gradient(1px 1px at 90px 40px, #ffd700, transparent),
    radial-gradient(2px 2px at 130px 80px, #ffffff, transparent),
    radial-gradient(1px 1px at 160px 30px, #ffd700, transparent),
    radial-gradient(2px 2px at 200px 60px, #ffffff, transparent),
    radial-gradient(1px 1px at 250px 40px, #ffd700, transparent),
    radial-gradient(2px 2px at 300px 90px, #ffffff, transparent);
  background-size: 320px 100px;
  animation: twinkle 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 樱花风格 */
.theme-cherry {
  position: relative;
  overflow: hidden;
}

.theme-cherry::before {
  content: '🌸';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 40px;
  opacity: 0.3;
  transform: rotate(15deg);
}

.theme-cherry::after {
  content: '🌸';
  position: absolute;
  bottom: -10px;
  left: -10px;
  font-size: 30px;
  opacity: 0.3;
  transform: rotate(-15deg);
}

/* 霓虹粉风格 */
.theme-neon-pink {
  background: #1a1a2e !important;
  border: 2px solid #ff6b9d !important;
  box-shadow: 
    0 0 10px #ff6b9d,
    0 0 20px #ff6b9d,
    0 0 40px #ff6b9d40 !important;
}

.theme-neon-pink h1,
.theme-neon-pink h2 {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor;
}

/* 全息镭射风格 */
.theme-holographic {
  position: relative;
  overflow: hidden;
}

.theme-holographic::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* 打字机风格 */
.theme-typewriter {
  background: #f5f5dc !important;
  background-image: 
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      #ccc 27px,
      #ccc 28px
    ) !important;
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.theme-typewriter h1,
.theme-typewriter h2,
.theme-typewriter p,
.theme-typewriter li {
  font-family: 'Courier New', 'Courier', monospace !important;
}

/* 羊皮纸风格 */
.theme-parchment {
  background: #f4e4bc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.1'/%3E%3C/svg%3E") !important;
  box-shadow: 
    inset 0 0 30px rgba(139, 69, 19, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.2) !important;
  border: 1px solid #d4c4a8 !important;
}

.theme-parchment h1 {
  font-family: 'Georgia', 'Times New Roman', serif !important;
  border-bottom: 2px solid currentColor;
}

/* 赛博朋克风格 */
.theme-cyberpunk {
  background: #0a0a0a !important;
  border: 1px solid #00ff88 !important;
  box-shadow: 
    0 0 5px #00ff88,
    0 0 10px #00ff8840,
    inset 0 0 30px rgba(0, 255, 136, 0.1) !important;
  position: relative;
}

.theme-cyberpunk::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ff88, transparent);
  animation: scanline 2s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(300px); opacity: 0; }
}

.theme-cyberpunk h1 {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    2px 2px 0 #ff0080;
}

/* ========================================
   三栏布局样式
   ======================================== */

.main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  height: calc(100vh - 120px);
}

.editor-panel,
.settings-panel,
.preview-panel {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.editor-content,
.settings-content,
.preview-content {
  flex: 1;
  overflow: auto;
  padding: 1.25rem;
}

/* 编辑器样式 */
.editor-content textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--foreground);
}

.editor-content textarea::placeholder {
  color: var(--muted-foreground);
}

/* 设置面板样式 */
.settings-content {
  padding: 0;
}

.tabs {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tabs-list {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.tab-btn.active {
  background: var(--background);
  color: var(--foreground);
  border-bottom: 2px solid var(--primary);
}

.tab-content {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: none;
}

.tab-content.active {
  display: block;
}

/* 预览面板样式 */
.panel-header.with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.header-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--foreground);
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.preview-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.8125rem;
  min-height: 36px;
}

.preview-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  padding-top: 2rem;
  flex: 1;
  overflow: auto;
  position: relative;
}

.card-wrapper {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

/* ========================================
   静态文件额外样式
   ======================================== */

/* 主题网格 - 小尺寸 */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .main {
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto 1fr;
  }
  
  .editor-panel {
    grid-column: 1 / 3;
  }
  
  .preview-panel {
    grid-row: 2;
    grid-column: 1;
  }
  
  .settings-panel {
    grid-row: 2;
    grid-column: 2;
  }
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    gap: 1rem;
  }
  
  .editor-panel,
  .settings-panel,
  .preview-panel {
    grid-column: 1;
  }
  
  .theme-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.theme-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.check-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary);
  border-radius: 4px;
  padding: 3px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-btn.active .check-icon {
  opacity: 1;
  transform: scale(1);
}

.theme-info {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: var(--radius-md);
}

.setting-group {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--muted);
  border-radius: var(--radius-md);
}

.setting-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-group input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
}

.slider-group input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  min-width: 50px;
  text-align: right;
  background: var(--background);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.align-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.align-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  max-width: 80px;
}

.align-btn:hover {
  border-color: var(--primary);
  background: var(--primary)/10;
  transform: translateY(-1px);
}

.align-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 4px var(--primary)/30;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--background);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
  text-align: center;
}

.toggle-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.toggle-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 4px var(--primary)/30;
}

.watermark-input-group {
  margin-top: 1rem;
}

.watermark-input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.watermark-input-group input {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  transition: all 0.2s;
}

.watermark-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary)/20;
}

/* 底部样式补充 */
.footer-tips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
}

#charCount {
  font-weight: 600;
  color: var(--primary);
  background: var(--background);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* 水印样式 */
#watermark {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 20;
}

/* 小按钮样式 */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 32px;
  flex-shrink: 0;
}

/* 优化的按钮样式 */
.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 32px;
  min-width: 80px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-icon-text:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-icon-text:active {
  transform: translateY(0);
}

/* 重置按钮特殊样式 */
#previewResetBtn.btn-icon-text {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  border: 1px solid #5a6268;
  color: white;
}

#previewResetBtn.btn-icon-text:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  border-color: #495057;
}

/* 复制按钮特殊样式 */
#previewCopyBtn.btn-icon-text {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  border: 1px solid #218838;
  color: white;
}

#previewCopyBtn.btn-icon-text:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
  border-color: #1e7e34;
}

/* 导出按钮特殊样式 */
#previewExportBtn.btn-icon-text {
  background: linear-gradient(135deg, #007bff 0%, #0069d9 100%);
  border: 1px solid #0069d9;
  color: white;
}

#previewExportBtn.btn-icon-text:hover {
  background: linear-gradient(135deg, #0069d9 0%, #0062cc 100%);
  border-color: #0062cc;
}

/* 按钮组间距优化 */
.preview-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .btn-icon-text {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: 28px;
  }
  
  .preview-actions {
    gap: 0.5rem;
  }
}

/* 隐藏原始头部按钮 */
.header-actions {
  display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .preview-actions {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .preview-actions .btn {
    flex: none;
    min-width: 80px;
  }
}

/* 底部联系方式 */
.footer-inner {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-contact {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo 区域优化 */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #0066cc 100%);
  border-radius: 12px;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  align-items: center;
}

.logo-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo-title-group h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  font-weight: 500;
  white-space: nowrap;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .logo-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .logo-title-group h1 {
    font-size: 1.25rem;
  }
  
  .logo-subtitle {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .logo {
    gap: 0.5rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  
  .logo-title-group h1 {
    font-size: 1.1rem;
  }
  
  .logo-subtitle {
    font-size: 0.75rem;
  }
}

/* 字体选择器样式 */
.font-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  transition: all 0.2s;
  font-family: inherit;
}

.font-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary)/20;
}

.font-select option {
  padding: 0.5rem;
  background: var(--background);
  color: var(--foreground);
}

/* 水印输入框 */
.watermark-input-group {
  margin-top: 1rem;
}

.watermark-input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.watermark-input-group input {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  transition: all 0.2s;
}

.watermark-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary)/20;
}


