/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基础样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部导航 */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  gap: 10px;
}

nav a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.logo {
  font-size: 26px;
  font-weight: bold;
  color: #2563eb !important;
  flex: 0 0 auto;
  margin-right: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.logo:hover {
  color: #1d4ed8 !important;
}

/* 主内容区 */
main {
  padding: 40px 0;
  min-height: calc(100vh - 200px);
}

h1 {
  font-size: 32px;
  margin-bottom: 25px;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  font-size: 24px;
  margin: 35px 0 20px;
  color: #334155;
  font-weight: 600;
  border-left: 4px solid #2563eb;
  padding-left: 15px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 10px;
}

/* 介绍区块 */
.intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 35px;
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
  line-height: 1.8;
}

.intro p {
  font-size: 16px;
  margin: 0;
}

/* 区块 */
section {
  background: white;
  padding: 30px;
  margin-bottom: 35px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 卡片列表 */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.card {
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #2563eb 0%, #7c3aed 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleY(1);
}

.card:hover {
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
  transform: translateY(-4px);
  border-color: #cbd5e1;
}

.card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #2563eb;
  font-weight: 600;
  line-height: 1.4;
}

.card h3 a {
  color: inherit;
}

.card h3 a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.card .meta {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card .desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* 文章详情 */
article section {
  margin-bottom: 30px;
}

article p {
  margin-bottom: 15px;
  line-height: 1.8;
  font-size: 15px;
  color: #334155;
}

article strong {
  color: #1e293b;
  font-weight: 600;
}

/* 页脚 */
footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  text-align: center;
  padding: 30px 0;
  margin-top: 60px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav {
    padding: 12px 0;
    gap: 5px;
  }

  nav a {
    padding: 8px 4px;
    font-size: 12px;
  }

  .logo {
    font-size: 20px;
    margin-right: 10px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 20px;
    margin: 25px 0 15px;
  }

  .card-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .intro {
    padding: 20px;
  }

  section {
    padding: 20px;
  }

  main {
    padding: 25px 0;
  }
}

/* UI样式变体（基于时间的16种风格）*/
.ui-style-0 { --primary: #2563eb; --secondary: #7c3aed; }
.ui-style-1 { --primary: #dc2626; --secondary: #ea580c; }
.ui-style-2 { --primary: #059669; --secondary: #0891b2; }
.ui-style-3 { --primary: #7c3aed; --secondary: #c026d3; }
.ui-style-4 { --primary: #0891b2; --secondary: #06b6d4; }
.ui-style-5 { --primary: #ea580c; --secondary: #f59e0b; }
.ui-style-6 { --primary: #0d9488; --secondary: #059669; }
.ui-style-7 { --primary: #4f46e5; --secondary: #6366f1; }
.ui-style-8 { --primary: #be123c; --secondary: #e11d48; }
.ui-style-9 { --primary: #0369a1; --secondary: #0284c7; }
.ui-style-10 { --primary: #7e22ce; --secondary: #9333ea; }
.ui-style-11 { --primary: #ca8a04; --secondary: #eab308; }
.ui-style-12 { --primary: #16a34a; --secondary: #22c55e; }
.ui-style-13 { --primary: #c2410c; --secondary: #ea580c; }
.ui-style-14 { --primary: #0e7490; --secondary: #0891b2; }
.ui-style-15 { --primary: #6d28d9; --secondary: #7c3aed; }

/* 返回顶部按钮 */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
  font-size: 24px;
  border: none;
}

#backToTop:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.6);
}

@media (max-width: 768px) {
  #backToTop {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}
