/* ============================================
   口腔护理 - 样式表
   www.yachibaimei.cn
   ============================================ */

/* CSS 变量 */
:root {
  --primary-color: #2196f3;
  --primary-dark: #1976d2;
  --accent-color: #c62828;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #263238;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.2s;
}

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

ul {
  list-style: none;
}

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

/* ============================================
   布局组件
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部 */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 8px 16px;
  gap: 8px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 160px;
  font-size: 14px;
}

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-light);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* 页脚 */
.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: #b0bec5;
  margin-top: 12px;
  line-height: 1.8;
}

.footer h4 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #fff;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #b0bec5;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #37474f;
  padding-top: 24px;
  text-align: center;
  color: #78909c;
}

/* ============================================
   首页组件
   ============================================ */

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #fff;
  padding: 64px 0;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 48px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 36px;
  font-weight: 700;
}

.hero-stat .label {
  font-size: 14px;
  opacity: 0.8;
}

/* 快速入口 */
.quick-start {
  background: var(--bg-primary);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: -32px auto 48px;
  max-width: 800px;
  position: relative;
  z-index: 10;
}

.quick-start h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.category-card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s;
}

.category-card:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

.category-card:hover a {
  color: #fff;
}

.category-card .icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.category-card h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.category-card p {
  font-size: 12px;
  color: var(--text-light);
}

.category-card:hover p {
  color: rgba(255,255,255,0.8);
}

/* 内容区块 */
.section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-more {
  color: var(--primary-color);
  font-weight: 500;
}

/* 文章列表 */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  background: var(--bg-primary);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  transition: box-shadow 0.2s;
}

.article-item:hover {
  box-shadow: var(--shadow-hover);
}

.article-thumb {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
}

.article-content {
  flex: 1;
}

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

.article-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 三栏布局 */
.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.column-box {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.column-box h3 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-secondary);
}

.column-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.column-list li:last-child {
  border-bottom: none;
}

.column-list a {
  color: var(--text-primary);
  display: block;
}

.column-list a:hover {
  color: var(--primary-color);
}

.column-list .date {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ============================================
   分类页组件
   ============================================ */

/* 面包屑 */
.breadcrumb {
  background: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.breadcrumb li:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

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

/* 分类头部 */
.category-header {
  background: var(--bg-primary);
  padding: 32px 0;
  margin-bottom: 32px;
}

.category-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.category-header p {
  color: var(--text-secondary);
}

/* 分类内容区 */
.category-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.category-content {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* 端点列表样式 */
.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}

.endpoint-item:hover {
  border-color: var(--primary-color);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.endpoint-method {
  background: var(--primary-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.endpoint-path {
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.endpoint-desc {
  color: var(--text-secondary);
  font-size: 13px;
}

.endpoint-tags {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.endpoint-tag {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-box {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sidebar-box h4 {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-secondary);
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--text-primary);
  font-size: 14px;
  display: block;
}

.sidebar-list a:hover {
  color: var(--primary-color);
}

/* ============================================
   文章页组件
   ============================================ */

.article-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 32px;
}

.article-container {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--bg-secondary);
}

.article-header h1 {
  font-size: 28px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-info {
  display: flex;
  gap: 24px;
  color: var(--text-light);
  font-size: 14px;
}

.article-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 22px;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

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

.article-body code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
}

.article-body pre {
  background: #263238;
  color: #fff;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}

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

/* 参数表格 */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

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

.params-table th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.params-table code {
  background: #e3f2fd;
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 响应示例 */
.response-box {
  background: #263238;
  color: #aed581;
  padding: 16px;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 13px;
  overflow-x: auto;
  margin: 16px 0;
}

/* 错误响应 */
.error-list {
  margin: 16px 0;
}

.error-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #ffebee;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.error-code {
  background: var(--accent-color);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.error-msg {
  color: var(--text-secondary);
}

/* 相关文章 */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--bg-secondary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.related-item {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.related-item a {
  color: var(--text-primary);
  font-weight: 500;
}

.related-item a:hover {
  color: var(--primary-color);
}

/* ============================================
   404页面
   ============================================ */

.error-page {
  min-height: calc(100vh - var(--header-height) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}

.error-content {
  max-width: 500px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 28px;
  margin-bottom: 16px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 1024px) {
  .three-column {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-main,
  .article-main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav,
  .search-box {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-stats {
    gap: 32px;
  }

  .hero-stat .number {
    font-size: 28px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .three-column {
    grid-template-columns: 1fr;
  }

  .article-item {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
    height: 160px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .article-container {
    padding: 24px;
  }

  .error-code {
    font-size: 80px;
  }

  .error-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0;
  }

  .quick-start {
    margin: -24px 16px 32px;
    padding: 20px;
  }

  .section-title {
    font-size: 20px;
  }
}
