/* ============================================================
   3D Maker Saver — 3D printing supplies guide from China
   Shared stylesheet
   ============================================================ */

:root {
  --ink: #10251e;
  --ink-soft: #3d4f48;
  --paper: #f5fbf8;
  --paper-deep: #e8f2ed;
  --card: #ffffff;
  --line: #d8e5de;
  --amber: #10b981;
  --amber-deep: #0b7a54;
  --amber-soft: #e6f8f0;
  --teal: #f5a623;
  --teal-deep: #c77e0a;
  --teal-soft: #fdf1dc;
  --coral: #5dade2;
  --coral-soft: #e3f4fb;
  --display: "Bricolage Grotesque", "Avenir Next", "PingFang SC", sans-serif;
  --body: "Sora", "Avenir Next", "PingFang SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.2; }

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 30px; border-radius: 8px;
  background: var(--amber); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0;
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--ink-soft); font-size: 14.5px; font-weight: 500; }
.nav a:hover { color: var(--amber-deep); text-decoration: none; }
.nav .nav-cta {
  background: var(--ink); color: #fff !important;
  padding: 8px 16px; border-radius: 999px; font-size: 14px;
}
.nav .nav-cta:hover { background: var(--amber-deep); }

/* ---------- Language switch ---------- */
.lang-switch { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; font-family: var(--body); transition: border-color 0.15s ease;
}
.lang-current:hover { border-color: var(--amber-deep); }
.lang-current .caret { font-size: 10px; transition: transform 0.15s ease; }
.lang-switch.open .lang-current .caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 150px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(28, 26, 23, 0.12);
  padding: 6px; display: none; z-index: 100;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
  font-family: var(--body); transition: background 0.12s ease;
}
.lang-menu button:hover { background: var(--paper-deep); }
.lang-menu button.active { background: var(--amber-soft); color: var(--amber-deep); font-weight: 600; }
.lang-menu button.active::after { content: "✓"; font-size: 13px; }

.menu-toggle { display: none; background: none; border: none; font-size: 22px; color: var(--ink); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(ellipse 60% 90% at 85% 10%, var(--amber-soft) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 8% 90%, var(--teal-soft) 0%, transparent 60%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero-kicker {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber-deep); background: var(--amber-soft);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: 52px; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--amber-deep); }
.hero p.lead { font-size: 18px; color: var(--ink-soft); max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; transition: all 0.18s ease; cursor: pointer;
}
.btn-primary { background: var(--amber); color: #10251e; }
.btn-primary:hover { background: var(--amber-deep); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; text-decoration: none; }

.hero-stats { display: flex; gap: 40px; margin-top: 44px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; color: var(--teal-deep); }
.stat span { font-size: 13px; color: var(--ink-soft); }

/* Hero visual — filament spool illustration */
.hero-art { display: flex; align-items: center; justify-content: center; }
.spool-wrap { position: relative; width: 300px; height: 300px; }
.spool {
  width: 230px; height: 230px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f4ead6 0%, #e8d9b8 38%, #d9c499 62%, #c8ad7a 100%);
  border: 10px solid #efe9dc;
  box-shadow: inset 0 0 0 14px #f7f2e6, 0 20px 40px rgba(28, 26, 23, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.spool::after {
  content: ""; position: absolute;
  width: 78px; height: 78px; border-radius: 50%;
  background: #fbf9f3;
  border: 3px solid #ddd2b8;
}
.filament-tag {
  position: absolute; padding: 8px 14px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; color: #fff;
  box-shadow: 0 8px 20px rgba(28, 26, 23, 0.18);
}
.ft-1 { background: var(--amber); top: 6px; right: 8px; }
.ft-2 { background: var(--teal); bottom: 26px; left: -6px; }
.ft-3 { background: var(--coral); bottom: -6px; right: 40px; }

/* ---------- Section headers ---------- */
.section { padding: 76px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; gap: 24px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-deep); margin-bottom: 8px; }
.section h2 { font-size: 34px; letter-spacing: -0.015em; }

/* ---------- Article cards ---------- */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(28, 26, 23, 0.1); }
.ac-cover { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.ac-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.ac-cat { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.ac-title { font-size: 18px; margin-bottom: 8px; }
.ac-excerpt { font-size: 14px; color: var(--ink-soft); flex: 1; margin-bottom: 14px; }
.ac-meta { font-size: 12.5px; color: #9a938a; }

/* Cover tints */
.cov-amber { background: linear-gradient(135deg, var(--amber-soft), #eefaf4); }
.cov-teal { background: linear-gradient(135deg, var(--teal-soft), #fdf6e8); }
.cov-coral { background: linear-gradient(135deg, var(--coral-soft), #f0f8fd); }
.cov-paper { background: linear-gradient(135deg, #f4efe6, #eae2d2); }
.cov-gray { background: linear-gradient(135deg, #efede8, #e4e0d6); }

/* ---------- Platform comparison strip ---------- */
.platform-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.platform-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; transition: transform 0.18s ease;
}
.platform-card:hover { transform: translateY(-3px); }
.pc-logo { font-family: var(--display); font-weight: 700; font-size: 22px; margin-bottom: 10px; }
.pc-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.pc-desc { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 14px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.tag-amber { background: var(--amber-soft); color: var(--amber-deep); }
.tag-teal { background: var(--teal-soft); color: var(--teal-deep); }
.tag-coral { background: var(--coral-soft); color: var(--coral); }
.tag-gray { background: var(--paper-deep); color: var(--ink-soft); }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; }
.step-num {
  font-family: var(--display); font-size: 40px; font-weight: 700;
  color: var(--paper-deep); position: absolute; top: 14px; right: 20px;
}
.step h3 { font-size: 18px; margin-bottom: 10px; }
.step p { font-size: 14px; color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: #f6f2e9; border-radius: 24px;
  padding: 56px 48px; text-align: center; margin: 20px 0 0;
}
.cta-band h2 { font-size: 32px; margin-bottom: 12px; color: #fff; }
.cta-band p { color: #c9c2b4; margin-bottom: 26px; font-size: 15.5px; }

/* ---------- Footer ---------- */
.footer { background: #0e1f19; color: #9fb0a7; padding: 56px 0 32px; margin-top: 76px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #eaf3ee; font-size: 15px; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; font-size: 14px; }
.footer a { color: #9fb0a7; }
.footer a:hover { color: var(--teal); }
.footer .brand { color: #eaf3ee; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid #1c2f28; margin-top: 40px; padding-top: 22px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse 55% 100% at 90% 0%, var(--amber-soft) 0%, transparent 55%); }
.page-hero h1 { font-size: 40px; margin-bottom: 12px; }
.page-hero p { font-size: 17px; color: var(--ink-soft); max-width: 640px; }
.crumbs { font-size: 13px; color: #9a938a; margin-bottom: 18px; }
.crumbs a { color: #9a938a; }
.crumbs a:hover { color: var(--amber-deep); }

/* ---------- Prose / article body ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 26px; margin: 44px 0 14px; padding-top: 8px; }
.prose h3 { font-size: 19px; margin: 30px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 0 0 18px 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote { border-left: 4px solid var(--amber); background: var(--amber-soft); padding: 14px 20px; border-radius: 0 12px 12px 0; margin: 22px 0; font-size: 15px; }
.prose table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--paper-deep); font-weight: 600; }

/* ---------- Compare table ---------- */
.compare-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 1080px; }
.compare-table th, .compare-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; }
.compare-table thead th { background: var(--ink); color: #f6f2e9; font-weight: 600; }
.compare-table tbody tr:hover { background: var(--paper-deep); }
.best-badge { display: inline-block; font-size: 11px; font-weight: 700; background: var(--teal-soft); color: var(--teal-deep); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.warn-badge { display: inline-block; font-size: 11px; font-weight: 700; background: var(--coral-soft); color: var(--coral); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* ---------- Material guide (materials page) ---------- */
.mat-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.mat-tab {
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line);
  font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink-soft);
  transition: all 0.15s ease;
}
.mat-tab:hover { border-color: var(--amber-deep); color: var(--amber-deep); }
.mat-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.mat-intro {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 0 16px 16px 0; padding: 20px 24px; margin-bottom: 28px;
}
.mat-intro-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mat-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.mat-intro h2 { font-size: 22px; margin: 0; }
.mat-intro p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.mat-price { font-size: 16px; color: var(--teal-deep); }
.mat-price-forward { font-size: 16px; color: var(--amber-deep); }
.mat-original { font-size: 12.5px; color: #9a938a; text-decoration: line-through; margin-left: 5px; }
.mat-unit { font-size: 12.5px; color: #9a938a; margin-left: 3px; }
.mat-tags { min-width: 150px; }
.mat-tags .tag { display: inline-block; margin: 2px 3px 2px 0; }
.mat-table td { vertical-align: middle; }

/* Shipping mode badges */
.ship-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ship-direct { background: var(--teal-soft); color: var(--teal-deep); }
.ship-self { background: var(--amber-soft); color: var(--amber-deep); }
.ship-both { background: var(--coral-soft); color: var(--coral); }

/* AliExpress slot */
.ali-soon { font-size: 12px; color: #9a938a; font-style: italic; }

/* Legend under materials table */
.mat-legend { background: var(--paper-deep); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; margin-top: 22px; }
.mat-legend h4 { font-size: 15px; margin-bottom: 10px; }
.mat-legend ul { margin: 0; padding-left: 18px; }
.mat-legend li { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn-mini {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--amber); color: #10251e; font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: background 0.15s ease;
}
.btn-mini:hover { background: var(--amber-deep); color: #fff; text-decoration: none; }
.btn-ali { background: #ff6a00; color: #fff; }
.btn-ali:hover { background: #e25c00; color: #fff; text-decoration: none; }

/* ---------- Info / tip boxes ---------- */
.note { border-radius: 14px; padding: 18px 22px; margin: 22px 0; font-size: 14.5px; }
.note-tip { background: var(--teal-soft); border-left: 4px solid var(--teal); }
.note-warn { background: var(--coral-soft); border-left: 4px solid var(--coral); }
.note-info { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.note b { display: block; margin-bottom: 4px; }

/* ---------- Steps list (big number steps) ---------- */
.steps-ol { counter-reset: stepc; list-style: none; margin: 0 !important; padding: 0 !important; }
.steps-ol > li { counter-increment: stepc; position: relative; padding: 0 0 34px 62px; }
.steps-ol > li::before {
  content: counter(stepc);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--amber); color: #10251e;
  font-family: var(--display); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.steps-ol > li:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 46px; bottom: 8px;
  width: 2px; background: var(--line);
}
.steps-ol h3 { margin: 0 0 8px; font-size: 19px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 38px; }
  .articles-grid { grid-template-columns: 1fr 1fr; }
  .platform-strip { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--paper); flex-direction: column; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
}

@media (max-width: 560px) {
  .articles-grid { grid-template-columns: 1fr; }
  .platform-strip { grid-template-columns: 1fr; }
  .hero { padding: 56px 0; }
  .section { padding: 52px 0; }
  .cta-band { padding: 40px 26px; }
}

/* ---------- Ad modal (CTA 弹窗广告) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 37, 30, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card); border-radius: 20px;
  max-width: 460px; width: 100%;
  padding: 32px 32px 28px;
  position: relative;
  box-shadow: 0 24px 60px rgba(16, 37, 30, 0.28);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--paper-deep); color: var(--ink-soft);
  font-size: 18px; cursor: pointer; line-height: 1;
  transition: background 0.15s ease;
}
.modal-close:hover { background: var(--line); }
.modal-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber-deep); background: var(--amber-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.modal h2 { font-size: 22px; margin-bottom: 10px; }
.modal p { font-size: 15px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 12px; align-items: center; }
.modal-cta {
  flex: 1; display: inline-block; text-align: center;
  padding: 12px 20px; border-radius: 999px;
  background: var(--amber); color: #10251e; font-weight: 600; font-size: 15px;
  transition: background 0.15s ease;
}
.modal-cta:hover { background: var(--amber-deep); color: #fff; text-decoration: none; }
.modal-skip {
  padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--body); white-space: nowrap;
  transition: border-color 0.15s ease;
}
.modal-skip:hover { border-color: var(--ink-soft); }

/* ---------- Product image thumbnail in parts table ---------- */
.part-name-cell {
  display: flex; align-items: center; gap: 12px;
  min-width: 220px;
}
.part-thumb {
  flex: 0 0 64px; width: 64px; height: 64px;
  border-radius: 12px; overflow: hidden;
  background: var(--paper-deep); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.part-thumb:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,37,30,0.12); }
.part-thumb img { width: 100%; height: 100%; object-fit: cover; }
.part-name-cell strong { display: block; line-height: 1.35; }
.part-name-cell .best-badge { margin-top: 6px; }

.btn-ali {
  background: #ff4747 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(255,71,71,0.25);
}
.btn-ali:hover { background: #d93636 !important; color: #fff !important; }

/* Highlight AliExpress-only product rows */
tr.aliexpress-row { background: rgba(255,71,71,0.04); }

/* ===== Google AdSense slots ===== */
.ad-slot {
  width: 100%;
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 16px;
  text-align: center;
  min-height: 1px;
  box-sizing: border-box;
}
.ad-slot > .adsbygoogle,
.ad-slot ins {
  margin: 0 auto;
  display: block;
}
.ad-slot.ad-top {
  margin-top: 18px;
}
