/* GitWeb - GitHub 每日热门项目速览 */
/* 活泼、明快、有活力的阅读体验 */

:root {
  --bg: #fef9ef;
  --surface: #ffffff;
  --text: #2d1b69;
  --text-secondary: #7c6ba0;
  --accent: #ff6b6b;
  --accent2: #ffd93d;
  --accent3: #6bcb77;
  --accent4: #4d96ff;
  --gradient: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
  --gradient-header: linear-gradient(135deg, #2d1b69, #6c3fb5);
  --border: #f0e6d3;
  --shadow: 0 4px 20px rgba(45, 27, 105, 0.08);
  --shadow-hover: 0 8px 32px rgba(45, 27, 105, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 800px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(255, 107, 107, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 40%, rgba(77, 150, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(107, 203, 119, 0.05) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ===== Header ===== */

.header {
  background: var(--gradient-header);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(45, 27, 105, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.logo:hover {
  background: rgba(255, 255, 255, 0.25);
}

.subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
}

.header-badge {
  background: var(--accent2);
  color: #2d1b69;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ===== Hero ===== */

.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero::after {
  content: "✨";
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  letter-spacing: -0.5px;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== Article list (首页) ===== */

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 60px;
}

.article-card {
  display: block;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  background-size: 200% auto;
  animation: gradient-shift 4s ease infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.article-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.article-card:hover::before {
  opacity: 1;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 8px 0;
  line-height: 1.4;
  color: var(--text);
}

.card-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== Tag ===== */

.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.2s;
}

.tag:hover {
  transform: scale(1.08);
}

.lang-tag {
  background: #e8f4f8;
  color: #1a7a9e;
}

.lang-tag:nth-child(2n) {
  background: #fce4ec;
  color: #c62858;
}

.lang-tag:nth-child(3n) {
  background: #fff3e0;
  color: #bf5e00;
}

.lang-tag:nth-child(5n) {
  background: #e8f5e9;
  color: #2e7d32;
}

.star-tag {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  color: #b76e00;
  border: 1px solid #ffecb3;
}

/* ===== Empty state ===== */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== Article page ===== */

.article {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 44px;
  margin: 36px 0;
  box-shadow: var(--shadow);
  position: relative;
}

.article::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 6px;
  background: var(--gradient);
  background-size: 200% auto;
  animation: gradient-shift 4s ease infinite;
  border-radius: var(--radius) var(--radius) 0 0;
}

.article-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

.article-date {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 24px;
  background: var(--bg);
  padding: 2px 14px;
  border-radius: 999px;
  font-weight: 500;
}

.article-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px dashed var(--border);
  line-height: 1.8;
}

/* ===== Project card in article ===== */

.project-card {
  padding: 28px 0;
  border-bottom: 2px dashed var(--border);
  transition: padding 0.2s;
}

.project-card:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.project-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.project-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  color: #fff;
  transition: transform 0.2s;
}

.project-card:hover .project-number {
  transform: scale(1.12) rotate(-3deg);
}

/* Assign different gradient colors to each project number */
.project-card:nth-child(1) .project-number { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.project-card:nth-child(2) .project-number { background: linear-gradient(135deg, #ffd93d, #f9a825); }
.project-card:nth-child(3) .project-number { background: linear-gradient(135deg, #6bcb77, #2d7d46); }
.project-card:nth-child(4) .project-number { background: linear-gradient(135deg, #4d96ff, #1a56cc); }
.project-card:nth-child(5) .project-number { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.project-card:nth-child(6) .project-number { background: linear-gradient(135deg, #ec4899, #db2777); }
.project-card:nth-child(7) .project-number { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.project-card:nth-child(8) .project-number { background: linear-gradient(135deg, #f97316, #ea580c); }
.project-card:nth-child(9) .project-number { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.project-card:nth-child(10) .project-number { background: linear-gradient(135deg, #84cc16, #65a30d); }

.project-title-group {
  flex: 1;
}

.project-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.project-name a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.project-name a::after {
  content: " ↗";
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-block;
}

.project-name a:hover {
  color: var(--accent);
}

.project-name a:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

.project-one-liner {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

.project-detail {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 14px;
  color: #3d2a6b;
}

.project-highlights {
  font-size: 0.9rem;
  margin-bottom: 14px;
  background: #f8f5ff;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.project-highlights strong {
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.project-highlights ul {
  padding-left: 20px;
}

.project-highlights li {
  margin-bottom: 4px;
  color: #4a3a7a;
}

.project-highlights li::marker {
  color: var(--accent);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.meta-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-text::before {
  content: "👤 ";
}

/* ===== Editor comment ===== */

.editor-comment {
  margin-top: 36px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #f8f5ff, #fff5f5);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  position: relative;
}

.editor-comment::before {
  content: "💡";
  position: absolute;
  top: -12px;
  left: 24px;
  font-size: 1.3rem;
  background: var(--surface);
  padding: 0 8px;
}

.editor-comment h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.editor-comment p {
  font-size: 0.95rem;
  color: #4a3a7a;
  line-height: 1.8;
}

/* ===== Navigation ===== */

.article-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 12px;
}

.nav-link {
  padding: 12px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-link:only-child {
  margin-left: auto;
}

/* ===== Footer ===== */

.footer {
  padding: 28px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gradient);
  background-size: 200% auto;
  animation: gradient-shift 4s ease infinite;
  border-radius: 2px;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer a {
  color: var(--accent4);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-list {
    gap: 12px;
  }

  .article {
    padding: 28px 24px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 36px 16px 24px;
  }

  .hero::after {
    display: none;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
  }

  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .header-badge {
    font-size: 0.65rem;
  }

  .article {
    padding: 20px 16px;
    margin: 16px 0;
  }

  .article-title {
    font-size: 1.3rem;
  }

  .article-intro {
    font-size: 0.95rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .project-header {
    gap: 12px;
  }

  .project-number {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .project-name {
    font-size: 1.05rem;
  }

  .project-detail {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .project-highlights {
    font-size: 0.85rem;
    padding: 12px 14px;
  }

  .project-highlights ul {
    padding-left: 16px;
  }

  .project-card {
    padding: 20px 0;
  }

  .tag {
    font-size: 0.72rem;
    padding: 2px 10px;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-summary {
    font-size: 0.88rem;
  }

  .article-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-link {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .editor-comment {
    padding: 18px 16px;
    margin-top: 24px;
  }

  .editor-comment p {
    font-size: 0.88rem;
  }

  .footer p {
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  .project-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .article {
    padding: 16px 12px;
  }
}
