/* ============================================
   一千朵花开 · Garden — Global Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-page: #FBF5EE;
  --bg-card: #FFFFFF;
  --bg-code: #3D3530;
  --text-primary: #3D3529;
  --text-secondary: #7A7060;
  --text-muted: #B5A99A;
  --text-code: #E8DFD4;
  --accent: #5EAA80;
  --accent-hover: #4E9670;
  --accent-light: #EAF5EF;
  --accent-border: #A3D4BA;
  --border-light: #EDE6DC;
  --border-card: #EDE8E0;
  --warning-bg: #FFF9ED;
  --warning-border: #F0DCA0;
  --warning-icon: #D4A017;
  --shadow-card: 0 1px 4px rgba(60, 50, 30, 0.04);
  --shadow-card-hover: 0 6px 20px rgba(60, 50, 30, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-badge: 4px;
  --max-w: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

/* --- Page Edge Glow (the soft blue-pink gradient border) --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  box-shadow:
    inset 0  6px 30px rgba(160, 185, 220, 0.35),
    inset 0 -6px 30px rgba(160, 185, 220, 0.18),
    inset  6px 0 30px rgba(170, 190, 225, 0.30),
    inset -6px 0 30px rgba(170, 190, 225, 0.30);
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

/* --- Layout --- */
.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
}

/* --- Back Navigation --- */
.back-nav {
  padding: 18px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.back-nav a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.back-nav a:hover {
  color: var(--text-primary);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 70px 0 40px;
}

.hero-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 0.03em;
}

/* --- Subpage Hero (smaller) --- */
.hero--sub {
  padding: 50px 0 36px;
}

/* --- BETA Badge --- */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent-border);
  border-radius: var(--radius-badge);
  padding: 2px 8px;
  vertical-align: middle;
  line-height: 1.5;
}

/* --- Section Header --- */
.section-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.section-title-row .section-title {
  margin-bottom: 0;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 8px 0 24px;
}

/* --- Project Cards Grid (Homepage) --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.project-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 32px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  color: inherit;
}

.project-card .card-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}

.project-card .card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline;
}

.project-card .badge {
  margin-left: 10px;
  vertical-align: text-top;
}

.project-card .card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.7;
}

.project-card .card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.project-card.coming-soon {
  opacity: 0.55;
  cursor: default;
}
.project-card.coming-soon:hover {
  box-shadow: none;
  transform: none;
}

/* --- Feature Cards Grid (Skill-style 2x2) --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 50px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 28px 28px 32px;
}

.feature-card .feat-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  display: block;
}

.feature-card .feat-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-card .feat-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Capability Cards Grid (4-col) --- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 50px;
}

.cap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 22px;
}

.cap-card .cap-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

.cap-card .cap-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.cap-card .cap-example {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-muted);
  padding: 10px 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 500;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* --- Code Block --- */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: 28px 32px;
  position: relative;
  color: var(--text-code);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 36px;
  overflow-x: auto;
}

.code-block .copy-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-code);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.code-block .copy-btn.copied {
  color: #7CCC9F;
}

.code-block ol {
  padding-left: 20px;
}

.code-block li {
  margin-bottom: 14px;
}

.code-block code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  display: block;
  padding: 4px 0 0 12px;
  color: #C8B89A;
}

.code-intro {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* --- Warning / Tip Box --- */
.alert-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 22px 28px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
}

.alert-box .alert-label {
  color: var(--warning-icon);
  font-weight: 700;
}

/* --- Open Source Section --- */
.opensource {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 32px 36px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 50px;
}

.opensource .os-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
}

.opensource .os-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.opensource .os-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.opensource .os-link {
  font-size: 0.95rem;
  font-weight: 500;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn:active {
  transform: scale(0.97);
}

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

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

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.empty-state .empty-text {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.empty-state .empty-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 30px 0 36px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

/* --- Page Fade-In Animation --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.08s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.16s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.24s; opacity: 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    padding: 45px 0 28px;
  }
  .hero-icon {
    font-size: 2.6rem;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .cap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-wrapper {
    padding: 0 18px;
  }
  .project-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .cap-grid {
    grid-template-columns: 1fr;
  }
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .opensource {
    flex-direction: column;
    gap: 12px;
  }
}
