/* Knowledge Hub - 主题系统 CSS */

/* 主题变量定义 */
:root {
  --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --bg-card: rgba(255,255,255,0.1);
  --bg-card-hover: rgba(255,255,255,0.15);
  --text-primary: white;
  --text-secondary: rgba(255,255,255,0.7);
  --text-muted: rgba(255,255,255,0.5);
  --border-color: rgba(255,255,255,0.1);
  --shadow: rgba(0,0,0,0.05);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="light"] {
  --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 50%, #d1d8e0 100%);
  --bg-card: rgba(255,255,255,0.8);
  --bg-card-hover: rgba(255,255,255,0.95);
  --text-primary: #1a1a2e;
  --text-secondary: rgba(26,26,46,0.7);
  --text-muted: rgba(26,26,46,0.5);
  --border-color: rgba(0,0,0,0.1);
  --shadow: rgba(0,0,0,0.1);
}

/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  transition: all 0.3s ease;
  line-height: 1.8;
}

/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--shadow);
}

/* 通用容器 */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  margin-bottom: 24px;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

/* 头部样式 */
.header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px var(--shadow);
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.header-meta {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 列表样式 */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  display: block;
}

.list-item:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 16px var(--shadow);
}

.item-date {
  font-size: 12px;
  color: #667eea;
  font-weight: 600;
  margin-bottom: 8px;
}

.item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.item-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 文章正文样式 */
.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 2px 8px var(--shadow);
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #667eea;
}

.article-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.article-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.article-content ul, .article-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  color: #667eea;
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}

.article-content th, .article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.article-content th {
  background: #667eea;
  color: white;
  font-weight: 600;
}

.article-content tr:hover {
  background: var(--bg-card-hover);
}

.article-content code {
  background: var(--bg-card-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 14px;
  color: var(--text-primary);
}

.article-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* 底部时间 */
.update-time {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }
  
  .header {
    padding: 24px;
  }
  
  .header h1 {
    font-size: 24px;
  }
  
  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 16px;
    right: 16px;
  }
}
