/* ========================================
   SIXYAO Blog Theme - 晨曦金 Dawn Gold 配色
   与主站 MergeSixYao 保持一致
   ======================================== */

:root {
  /* 基础结构色 - 浅色模式 */
  --bg-primary: #fefefe;
  --bg-secondary: #faf8f5;
  --bg-tertiary: #f5f3ef;
  --bg-card: #ffffff;
  --bg-hover: #faf0e6;
  
  /* 主色系统 (棕褐标题) */
  --primary: #8b7355;
  --primary-secondary: #a08060;
  --primary-hover: #7a6248;
  
  /* 强调色 (暖金行为引导) */
  --accent-primary: #d4a373;
  --accent-primary-hover: #c49366;
  --accent-primary-light: #faf0e6;
  --accent-secondary: #e9c46a;
  
  /* 文字系统 */
  --text-primary: #5c5c5c;
  --text-secondary: #7a7a7a;
  --text-muted: #9a9a9a;
  --text-heading: #8b7355;
  --text-inverse: #ffffff;
  
  /* 边框与分隔 */
  --border: #e8e4dc;
  --border-light: #f2efe8;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(139, 115, 85, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(139, 115, 85, 0.08), 0 2px 4px -2px rgba(139, 115, 85, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(139, 115, 85, 0.08), 0 4px 6px -4px rgba(139, 115, 85, 0.04);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif SC', 'SimSun', serif;
  --font-mono: 'Fira Code', 'Monaco', monospace;
}

/* 深色模式 */
[data-theme="dark"] {
  --bg-primary: #1a1410;
  --bg-secondary: #221c17;
  --bg-tertiary: #2d2520;
  --bg-card: #2d2520;
  --bg-hover: #3d3530;
  
  --primary: #e9c46a;
  --primary-secondary: #d4a373;
  --primary-hover: #f4d58d;
  
  --accent-primary: #e9c46a;
  --accent-primary-hover: #f4d58d;
  --accent-primary-light: #3d3530;
  --accent-secondary: #f4d58d;
  
  --text-primary: #e0d8c8;
  --text-secondary: #b0a090;
  --text-muted: #8a7a6a;
  --text-heading: #e9c46a;
  --text-inverse: #1a1410;
  
  --border: #3d3530;
  --border-light: #4d4540;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #f5f0e8 0%, #e8e0d0 50%, #dbd3c3 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #1a1410 0%, #221c17 50%, #1a1410 100%);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-heading);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.5rem;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========================================
   Header / Navigation (matches main site)
   ======================================== */
.header {
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

[data-theme="dark"] .header {
  background: rgba(26, 20, 16, 0.85);
}

.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  color: var(--accent-primary);
}

.logo-text {
  background: linear-gradient(180deg, #D4AF37 0%, #AA8A29 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

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

.nav-link svg {
  flex-shrink: 0;
}

.nav-link .dropdown-arrow {
  margin-left: -0.25rem;
  opacity: 0.6;
}


/* ========================================
   Main Content
   ======================================== */
.main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

/* ========================================
   Post Card (List View)
   ======================================== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card .post-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-card .post-title a {
  color: var(--text-heading);
}

.post-card .post-title a:hover {
  color: var(--accent-primary);
}

.post-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.post-excerpt {
  color: var(--text-secondary);
  line-height: 1.8;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.read-more:hover {
  color: var(--accent-primary-hover);
}

/* ========================================
   Single Post
   ======================================== */
.post-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 3rem;
}

.post-content .post-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1rem;
}

.post-content .post-meta {
  justify-content: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-body {
  font-size: 1.1rem;
  line-height: 2;
}

.post-body h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.post-body h3 {
  margin-top: 2rem;
}

.post-body ul, 
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body blockquote {
  border-left: 4px solid var(--accent-primary);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.post-body pre {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-body pre code {
  background: none;
  padding: 0;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--accent-primary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
}

.pagination .current {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* ========================================
   Tags & Categories
   ======================================== */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* ========================================
   Theme Toggle Button
   ======================================== */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .header .container {
    flex-wrap: wrap;
  }
  
  .nav {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    gap: 1rem;
  }
  
  .post-content {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }
  
  .post-card {
    padding: 1.5rem;
  }
}

/* ========================================
   Header Actions & Language Switcher
   ======================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  position: relative;
}

.lang-switcher .lang-icon {
  position: absolute;
  left: 0.75rem;
  pointer-events: none;
  color: var(--text-secondary);
}

.lang-switcher select {
  appearance: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.5rem 2rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1em 1em;
}

.lang-switcher select:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.lang-switcher select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Theme Toggle - matches main site */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Show sun icon in light mode, moon icon in dark mode */
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (max-width: 768px) {
  .header-actions {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .nav {
    order: 3;
    flex-wrap: wrap;
  }
}
