/* ============================================================
   编织乐趣 KNIT FUN — 首页样式
   配色：米色底 / 珊瑚橙主色 / 棕色文字
   ============================================================ */

:root {
  --bg: #fdfdf1;            /* 页面米色背景 */
  --bg-soft: #F7E9D4;       /* 插画背景米橙 */
  --coral: #E8734A;         /* 主色 珊瑚橙 */
  --coral-dark: #D15C33;    /* 深珊瑚橙 */
  --coral-soft: #FBE8DD;    /* 浅珊瑚（标签底） */
  --teal: #7FA99B;          /* 辅助 蓝绿 */
  --teal-soft: #E4EFE9;     /* 浅蓝绿（标签底） */
  --brown: #4A3426;         /* 标题/正文棕 */
  --brown-light: #8C7462;   /* 次要文字棕 */
  --cream: #F5E6D3;         /* 米白 */
  --card: #FFFFFF;
  --footer: #3B2A1F;        /* 页脚深棕 */
  --shadow: 0 12px 32px rgba(74, 52, 38, 0.10);
  --radius: 20px;
  --font-stack: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-round: "ZCOOL QingKe HuangYou", "PingFang SC", "Microsoft YaHei", sans-serif; /* 圆体标题字 */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--brown);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

::selection { background: var(--coral); color: #fff; }

.container {
  width: min(1360px, 92%);
  margin: 0 auto;
}

/* ==================== 按钮 ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 20px rgba(232, 115, 74, 0.35);
}
.btn-primary:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(232, 115, 74, 0.42);
}

.btn-ghost {
  border-color: var(--brown);
  color: var(--brown);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--brown);
  color: var(--bg);
  transform: translateY(-2px);
}

.btn-small { padding: 9px 24px; font-size: 14px; }

/* ==================== 顶部导航 ==================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(0,0,0,0.1)
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  height: 48px;
}

.brand-text { line-height: 1.25; }
.brand-text strong {
  display: block;
  font-family: var(--font-round);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--brown);
}
.brand-text small {
  display: block;
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--brown-light);
}

.main-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.main-nav a {
  font-size: 15px;
  color: var(--brown-light);
  padding: 6px 2px;
  transition: color 0.2s ease;
  position: relative;
}
.main-nav a:hover { color: var(--coral); }
.main-nav a.active {
  color: var(--coral);
  font-weight: 700;
}
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -2px;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--coral);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(74, 52, 38, 0.25);
  background: transparent;
  color: var(--brown);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--coral); color: var(--coral); }

/* ==================== 首屏 ==================== */

.hero { overflow: hidden; background:url(banner.jpg) no-repeat center center; background-size:auto 100%; height:1200px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 24px;
  padding: 44px 0 24px;
}

.hero-copy h1 {
  font-family: var(--font-round);
  font-size: 62px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 3px;
  margin-bottom: 18px;
}

.hero-copy p {
  font-size: 16.5px;
  color: var(--brown-light);
  margin-bottom: 30px;
}

.hero-actions { display: flex; gap: 16px; }

.hero-art img,
.hero-art svg { width: 100%; max-width: 500px; height: auto; margin: 0 auto; }

/* ==================== 数据栏 ==================== */

.stats { padding: 18px 0 0; top:-320px; position:relative; }

.stats-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap:40px;
}

.stat { text-align: center; flex: 1; background:#fdf6e4;padding:20px; border-radius:20px; 
  box-shadow: 0 8px 20px rgba(74, 52, 38, 0.12);
  display:flex;
  flex-direction: column;
  align-items: center;
}
.stat .knitfont { font-size: 64px;  }

.stat2 {
  background:#fef2e2;
}
.stat3 {
  background:#fdf0db;
}
.stat4 {
  background:#fdeed6;
}
.stat:hover{
  background:#fdd2a7;
  box-shadow: 0 18px 20px rgba(253, 210, 167, 0.5);
  transform: translateY(-4px) scale(1.05);

}

.stat em {
 font-weight: 600;
 font-style:normal;
  font-size: 18px;
  color: var(--brown-light);
  color:#333;
}

/* ==================== 通用小节 ==================== */

.section { padding: 54px 0 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.section-head h2 {
  font-family: var(--font-round);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 1.5px;
}
.section-head h2::before {
  content: "";
  display: block;
  width: 42px;
  height: 6px;
  border-radius: 3px;
  background: var(--coral);
  margin-bottom: 12px;
}
.section-head p {
  color: var(--brown-light);
  font-size: 15px;
  margin-top: 6px;
}

.more-link {
  color: var(--coral);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}
.more-link:hover { color: var(--coral-dark); transform: translateX(4px); }

/* ==================== 热门教程 ==================== */

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

.course-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 44px rgba(74, 52, 38, 0.16);
}

.course-media { position: relative; }
.course-media img,
.course-media svg { width: 100%; height: 180px; object-fit: cover; }

.tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
}
.tag-orange { background: var(--coral); color: #fff; }
.tag-green  { background: var(--teal);  color: #fff; }

.course-body { padding: 18px 22px 20px; }

.course-body h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 7px;
}

.course-meta {
  font-size: 13.5px;
  color: var(--brown-light);
  margin-bottom: 14px;
}

.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed rgba(74, 52, 38, 0.18);
}

.price { font-size: 22px; font-weight: 800; color: var(--coral); }
.price s { font-size: 14px; font-weight: 400; color: var(--brown-light); margin-left: 6px; }
.price-free { font-size: 20px; }

.go-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 15px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(232, 115, 74, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}
.course-card:hover .go-btn {
  background: var(--coral-dark);
  transform: rotate(-45deg);
}

/* ==================== 材料工具 ==================== */

.materials-inner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 48px;
}

.materials-copy h2 {
  font-family: var(--font-round);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.materials-copy h2::before {
  content: "";
  display: block;
  width: 42px;
  height: 6px;
  border-radius: 3px;
  background: var(--coral);
  margin-bottom: 12px;
}

.materials-lead { color: var(--brown-light); margin-bottom: 28px; }

.feature-list { margin-bottom: 28px; display: grid; gap: 18px; }

.feature-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  display: grid;
  place-items: center;
  margin-top: 3px;
}

.feature-list strong { display: block; font-size: 16.5px; font-weight: 700; }
.feature-list em {
  font-style: normal;
  font-size: 14px;
  color: var(--brown-light);
}

.materials-art img,
.materials-art svg {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin-left: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

/* ==================== 作品展示 ==================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.work-card {
  background: var(--card);
  border-radius: 18px;
  padding: 12px 12px 14px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(74, 52, 38, 0.15);
}

.work-media {
  border-radius: 999px 999px 12px 12px;
  overflow: hidden;
}
.work-media img,
.work-media svg { width: 100%; height: 232px; object-fit: cover; }

.work-card figcaption { padding-top: 12px; }
.work-card strong { display: block; font-size: 15.5px; font-weight: 700; }
.work-card em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--brown-light);
}

/* ==================== 页脚 ==================== */

.site-footer {
  margin-top: 56px;
  background: var(--footer);
  color: #CBB9A8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.3fr 1fr;
  gap: 40px;
  padding: 46px 0 36px;
}

.footer-brand p {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.9;
}

.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text small { color: #B39C88; }
.brand-light .brand-logo { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }

.footer-col h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.footer-col ul { display: grid; gap: 12px; }

.footer-col a {
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-col a:hover { color: #F0A583; padding-left: 4px; }

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.contact-list svg { flex-shrink: 0; color: #F0A583; }

.social-row { display: flex; gap: 12px; }

.social-row a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #E8D8C8;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-row a:hover {
  background: var(--coral);
  color: #fff;
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: #A08D7B;
}

/* ==================== 响应式 ==================== */

@media (max-width: 1024px) {
  .main-nav { display: none; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 48px;
  }
  .hero-copy h1 { font-size: 46px; }
  .hero-actions { justify-content: center; }
  .hero-art { max-width: 520px; margin: 0 auto; }

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

  .materials-inner { grid-template-columns: 1fr; gap: 40px; }
  .materials-art { max-width: 560px; }

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

@media (max-width: 640px) {
  .section { padding-top: 44px; }
  .section-head { flex-direction: column; align-items: flex-start; }

  .hero-copy h1 { font-size: 36px; letter-spacing: 1px; }
  .hero-copy p br { display: none; }

  .stats-inner { flex-wrap: wrap; gap: 18px; padding: 24px 12px; }
  .stat { flex: 1 1 40%; }
  .stat + .stat { border-left: none; }
  .stat strong { font-size: 30px; }

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

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

  .header-actions .btn-small { display: none; }
}
