/* ==========================================================================
   Stage 3B-1 · Tianfu Textile · Shared Styles
   B2B manufacturer look — clean, natural, trusted
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f4f0;
  --color-bg-dark: #2a2a2a;
  --color-text: #1f1f1f;
  --color-text-muted: #5a5a5a;
  --color-text-light: #8a8a8a;
  --color-border: #e2ded7;
  --color-accent: #3d5a4a;       /* muted deep green */
  --color-accent-dark: #2b4236;
  --color-tag-ready: #3d7a3d;    /* muted green for ready stock */
  --color-tag-custom: #8a6d2b;   /* muted amber for custom */
  --color-tag-ai: #a8322b;       /* soft red for AI disclosure */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;
  --shadow-s: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-m: 0 4px 16px rgba(0,0,0,0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.1; }
h2 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }

p { margin: 0 0 1em; color: var(--color-text-muted); }

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

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}
.brand a { color: var(--color-text); }
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--color-bg-alt);
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--color-border);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 17px;
  color: var(--color-text-muted);
  max-width: 560px;
  margin-bottom: 28px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius-s);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  background: transparent;
  border-color: var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover {
  background: var(--color-text);
  color: #fff;
  text-decoration: none;
}
.hero-media {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-m);
  aspect-ratio: 4/3;
  background: var(--color-bg);
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Section / Breadcrumb ---------- */
.section {
  padding: 72px 0;
}
.section--tight { padding: 48px 0; }
.section--alt { background: var(--color-bg-alt); }

.breadcrumb {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 12px;
  padding-left: 0;
}
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb .sep { margin: 0 6px; }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 12px;
}
.section-lede {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 760px;
  margin-bottom: 40px;
}

/* ---------- Application Grid (homepage) ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.app-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
  border-color: var(--color-accent);
  text-decoration: none;
}
.app-card-thumb {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  overflow: hidden;
  position: relative;
}
.app-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.app-card:hover .app-card-thumb img {
  transform: scale(1.04);
}
.app-card-body {
  padding: 20px 20px 22px;
}
.app-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}
.app-card-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}
/* AI note moved to card body — now uses .ai-note-inline style (see above) */

/* ---------- Bucket switcher (list pages) ---------- */
.bucket-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.bucket-chip {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  text-decoration: none;
  transition: all 0.15s ease;
}
.bucket-chip:hover { text-decoration: none; border-color: var(--color-accent); }
.bucket-chip.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ---------- Series Card Grid (list pages) ---------- */
.series-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.series-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
a.series-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
a.series-card-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}
a.series-card-link:hover .series-card-title {
  color: var(--color-accent);
}
a.series-card-link:hover .link-arrow {
  text-decoration: underline;
}
.series-card-media {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  position: relative;
  overflow: hidden;
}
.series-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.series-card-media .tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-s);
  color: #fff;
  background: rgba(32, 32, 32, 0.78);
}
.series-card-media .tag.ready { background: var(--color-tag-ready); }
.series-card-media .tag.custom { background: var(--color-tag-custom); }

/* AI note moved out of media — now inline in card body */
.ai-note-inline {
  background: #f5f0e6;
  color: #5a4632;
  font-size: 12px;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border-left: 3px solid #c9a84c;
  margin-bottom: 10px;
}

.series-card-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.series-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}
.series-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.series-card-meta .avail {
  font-weight: 500;
  color: var(--color-text);
}
.series-card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.detail-placeholder {
  font-size: 12px;
  color: var(--color-text-light);
  font-style: italic;
  flex: 1;
}
.link-arrow {
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 500;
}
.link-arrow::after {
  content: " →";
}

/* ---------- Application root page (new layout) ---------- */
.app-root-section {
  margin-bottom: 48px;
}
.app-root-section .section-copy {
  font-size: 15px;
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: 20px;
}
.app-root-section .empty-state {
  grid-column: 1 / -1;
}

.procurement-tip {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  padding: 20px 24px;
  margin-top: 32px;
}
.procurement-tip h4 {
  font-size: 15px;
  margin: 0 0 6px;
}
.procurement-tip p {
  font-size: 14px;
  margin: 0;
}

/* ---------- Application entry page: two buckets (legacy, kept for ref) ---------- */
.two-buckets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 28px;
}
.bucket-block {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.bucket-block h3 {
  font-size: 20px;
  font-family: var(--font-serif);
  margin-bottom: 4px;
}
.bucket-block p {
  font-size: 14px;
  margin-bottom: 20px;
}
.bucket-block .btn {
  align-self: flex-start;
}

/* ---------- Procurement / MOQ strip ---------- */
.procurement {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 56px 0;
}
.procurement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
.proc-item h4 {
  font-size: 15px;
  margin-bottom: 6px;
}
.proc-item p {
  font-size: 14px;
  margin: 0;
}
.cta-row {
  text-align: center;
  margin-top: 16px;
}
.cta-row .btn-primary {
  font-size: 16px;
  padding: 16px 40px;
}

/* ---------- Page footer ---------- */
.site-footer {
  background: var(--color-bg-dark);
  color: #bfbfbf;
  padding: 36px 0;
  font-size: 13px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer a { color: #d8d8d8; }
.site-footer a:hover { color: #fff; }

/* ---------- Status ribbon (working candidate) ---------- */
.status-ribbon {
  background: #fff4e5;
  color: #8a5a00;
  border-bottom: 1px solid #f1c97a;
  padding: 5px 0;
  font-size: 12px;
}
.status-ribbon .container {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.status-ribbon strong { font-weight: 600; }

/* ---------- Image-missing card ---------- */
.image-missing-card .series-card-media {
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}
.image-missing-card .series-card-media svg { width: 80%; height: 80%; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .series-grid { grid-template-columns: repeat(2, 1fr); }
  .procurement-grid { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 48px; }
  .two-buckets { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-grid { grid-template-columns: 1fr; gap: 16px; }
  .series-grid { grid-template-columns: 1fr; gap: 20px; }
  .procurement-grid { grid-template-columns: 1fr; gap: 20px; }
  .main-nav ul { gap: 20px; }
  .hero { padding: 40px 0; }
  .section { padding: 48px 0; }
  .section--tight { padding: 32px 0; }
  .container { padding: 0 16px; }
  .site-header .container { flex-direction: column; gap: 10px; align-items: flex-start; }
  .main-nav ul { flex-wrap: wrap; }
  .status-ribbon .container {
    flex-wrap: wrap;
    white-space: normal;
    gap: 4px;
  }
  .status-ribbon {
    font-size: 11px;
    line-height: 1.3;
  }
}