/* ============================================
   Filament B2B — Global Styles
   Theme: Dark Black / Gold / Red
   ============================================ */

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

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-nav: #0d0d0d;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --gold: #d4a853;
  --gold-dark: #b8923a;
  --gold-light: #e6c87a;
  --red: #c0392b;
  --red-hover: #e74c3c;
  --red-dark: #a93226;
  --border: #2a2a2a;
  --border-light: #3a3a3a;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.2s ease;

  /* Typography */
  --font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-zh: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-en);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 32px;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  border: 2px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  text-align: center; min-height: 44px;
  white-space: nowrap; user-select: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a1a; border-color: var(--gold);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 20px rgba(212,168,83,0.3);
}

.btn-red {
  background: var(--red); color: #fff; border-color: var(--red);
}
.btn-red:hover { background: var(--red-hover); border-color: var(--red-hover); }

.btn-outline {
  background: transparent; color: var(--gold); border-color: var(--gold);
}
.btn-outline:hover { background: rgba(212,168,83,0.1); }

.btn-danger {
  background: transparent; color: var(--red); border-color: var(--red);
}
.btn-danger:hover { background: rgba(192,57,43,0.15); }

.btn-sm { padding: 8px 18px; font-size: 0.875rem; min-height: 36px; }
.btn-lg { padding: 18px 40px; font-size: 1.1rem; min-height: 52px; }

/* --- Container --- */
.container {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
}

/* --- Navigation --- */
.navbar {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 1.3rem; font-weight: 800;
  color: var(--gold); letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-secondary); padding: 8px 16px;
  border-radius: 6px; font-size: 0.95rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold); background: rgba(212,168,83,0.08); }
.nav-toggle { display: none; }

/* --- Lang Toggle --- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-toggle {
  background: rgba(212,168,83,0.08);
  border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.lang-toggle:hover {
  background: rgba(212,168,83,0.16);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* --- Hero --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, #0d0d0d 0%, var(--bg-dark) 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  max-width: 800px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  color: var(--text-secondary); font-size: 1.15rem;
  max-width: 650px; margin: 0 auto 32px;
}
.hero .subtitle span { color: var(--gold); font-weight: 600; }

/* --- Section --- */
.section { padding: 64px 0; }
.section-title {
  text-align: center; margin-bottom: 12px; color: var(--text-primary);
}
.section-desc {
  text-align: center; color: var(--text-secondary);
  margin-bottom: 40px; font-size: 0.95rem;
}

/* --- Value Cards --- */
.value-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.value-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 24px;
  text-align: center; transition: all var(--transition);
}
.value-card:hover {
  border-color: var(--gold); transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(212,168,83,0.1);
}
.value-card .icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
}
.value-card .icon svg {
  width: 100%; height: 100%;
}
.value-card h3 { color: var(--gold); margin-bottom: 8px; }
.value-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Category Cards --- */
.category-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.category-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 20px;
  text-align: center; cursor: pointer; transition: all var(--transition);
  display: block; color: var(--text-primary);
}
.category-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(212,168,83,0.15);
  transform: translateY(-3px);
}
.category-card .material-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
}
.category-card .material-icon svg {
  width: 100%; height: 100%;
}
.category-card h3 { color: var(--gold); margin-bottom: 4px; }
.category-card p { color: var(--text-secondary); font-size: 0.85rem; }

/* --- CTA Section --- */
.cta-section {
  text-align: center; padding: 60px 20px;
  background: linear-gradient(135deg, rgba(212,168,83,0.05), rgba(192,57,43,0.05));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-section h2 { margin-bottom: 12px; }
.cta-section p { color: var(--text-secondary); margin-bottom: 24px; }

/* --- Products Page --- */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.filter-bar label { color: var(--text-secondary); font-weight: 500; }
.filter-bar select {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 16px; font-size: 0.95rem; min-width: 180px;
  cursor: pointer;
}
.filter-bar select:focus { outline: none; border-color: var(--gold); }
.product-count { color: var(--text-muted); font-size: 0.9rem; margin-left: auto; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition);
}
.product-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
/* 线轴产品图 — Real Product Photos */
.spool-img-wrap {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #111, #0a0a0a);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.card-spool-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  padding: 8px;
}

.product-card:hover .card-spool-img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .card-overlay {
  opacity: 1;
}

.card-overlay span {
  color: var(--gold-light);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 24px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  letter-spacing: 1px;
}

.product-img {
  width: 100%; height: 200px; background: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.product-img .placeholder {
  color: var(--text-muted); font-size: 2.5rem;
  text-align: center; line-height: 1.3;
}
.product-img .placeholder small {
  display: block; font-size: 0.75rem; margin-top: 4px;
}
.product-body { padding: 20px; }
.product-body h3 { margin-bottom: 4px; }
.product-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 12px;
}
.product-meta .tag {
  background: rgba(212,168,83,0.1); color: var(--gold);
  padding: 4px 10px; border-radius: 4px;
  font-size: 0.78rem; font-weight: 600;
}
.product-body .specs {
  color: var(--text-secondary); font-size: 0.88rem;
  margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 12px;
}
.product-body .specs span { white-space: nowrap; }
.product-body .specs strong { color: var(--text-primary); }
.product-body .moq {
  color: var(--red); font-weight: 700; font-size: 0.9rem;
  margin: 8px 0;
}
.product-body .price {
  font-size: 1.15rem; font-weight: 700; color: var(--gold-light);
  margin-bottom: 16px;
}
.product-body .btn { width: 100%; }

/* --- Contact Page --- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 380px; gap: 40px;
  align-items: start;
}
.contact-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; margin-bottom: 6px;
  color: var(--text-secondary); font-weight: 500; font-size: 0.9rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-dark); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.95rem; font-family: inherit;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group .error-msg {
  color: var(--red); font-size: 0.82rem; margin-top: 4px; display: none;
}
.form-group.error input,
.form-group.error textarea { border-color: var(--red); }
.form-group.error .error-msg { display: block; }
.form-success {
  display: none; text-align: center; padding: 40px 20px;
}
.form-success .check-icon {
  font-size: 3rem; color: var(--gold); margin-bottom: 12px;
}

.form-error-msg {
  display: none; text-align: center; padding: 16px 20px; margin-top: 16px;
  background: rgba(192,57,43,0.12); border: 1px solid var(--red);
  border-radius: var(--radius); color: var(--red);
  font-size: 0.95rem;
}

.turnstile-container {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.contact-info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.contact-info-card h3 { color: var(--gold); margin-bottom: 16px; }
.contact-info-item {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.9rem;
}
.contact-info-item:last-child { border-bottom: none; }
.contact-info-item .label { color: var(--text-muted); min-width: 80px; }

/* --- Footer --- */
.footer {
  background: var(--bg-nav); border-top: 1px solid var(--border);
  padding: 40px 0 24px; margin-top: 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 30px; margin-bottom: 24px;
}
.footer-col h4 { color: var(--gold); margin-bottom: 12px; font-size: 0.95rem; }
.footer-col p, .footer-col a {
  color: var(--text-secondary); font-size: 0.85rem; line-height: 2;
}
.footer-bottom {
  text-align: center; color: var(--text-muted); font-size: 0.8rem;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* --- Admin Styles --- */
.admin-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: 40px 20px;
}
.admin-login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 32px;
  width: 100%; max-width: 400px; text-align: center;
}
.admin-login-card .logo { font-size: 1.5rem; color: var(--gold); margin-bottom: 24px; }
.admin-login-card input {
  width: 100%; padding: 14px;
  background: var(--bg-dark); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 1rem; text-align: center; margin-bottom: 16px;
}
.admin-login-card input:focus { outline: none; border-color: var(--gold); }
.login-error { color: var(--red); font-size: 0.85rem; margin-bottom: 12px; display: none; }

.admin-panel { display: none; }
.admin-header {
  background: var(--bg-nav); border-bottom: 1px solid var(--border);
  padding: 12px 0; position: sticky; top: 0; z-index: 100;
}
.admin-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.admin-header h2 { font-size: 1.1rem; color: var(--gold); }
.admin-header .btn-logout { font-size: 0.85rem; }

.admin-tabs {
  display: flex; gap: 4px; margin: 24px 0;
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.admin-tab {
  padding: 12px 20px; font-size: 0.9rem; font-weight: 600;
  color: var(--text-secondary); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; transition: all var(--transition); font-family: inherit;
}
.admin-tab:hover { color: var(--gold); }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

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

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* Admin Product Table */
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.admin-table th {
  text-align: left; padding: 12px 10px;
  background: var(--bg-card); color: var(--text-muted);
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 10px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.admin-table td:first-child { color: var(--text-primary); font-weight: 600; }
.admin-table .actions { display: flex; gap: 6px; }

/* Admin Form */
.admin-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; max-width: 600px;
}
.admin-form h3 { margin-bottom: 20px; color: var(--gold); }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form .form-full { grid-column: 1 / -1; }

.inquiry-list-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.inquiry-list-item .inquiry-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  color: var(--text-secondary); font-size: 0.85rem; margin: 8px 0;
}
.inquiry-list-item .inquiry-time {
  color: var(--text-muted); font-size: 0.8rem;
}

/* --- Table responsive wrapper --- */
.table-wrap { overflow-x: auto; }

/* --- Empty state --- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* --- Toast --- */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--gold); border-radius: 8px;
  padding: 14px 24px; box-shadow: var(--shadow);
  font-size: 0.9rem; display: none; align-items: center; gap: 10px;
  max-width: 380px;
}

/* --- Modal --- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 20px; color: var(--gold); }
.modal .btn-row { display: flex; gap: 12px; margin-top: 20px; justify-content: flex-end; }

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #1a1a1a; border-top: 1px solid var(--border);
  padding: 16px 20px; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
}
.cookie-banner.visible { display: flex; }
.cookie-banner p {
  color: var(--text-secondary); font-size: 0.88rem;
  max-width: 640px; line-height: 1.6;
}
.cookie-banner .cookie-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   Responsive — Tablet (≤768px)
   ============================================ */
@media (max-width: 768px) {
  .container .nav-right {
    position: static;
  }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-nav); border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .lang-toggle {
    font-size: 0.78rem;
    padding: 5px 10px;
  }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: none; border: none;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 24px; height: 2px;
    background: var(--text-primary); position: relative;
  }
  .nav-toggle span::before,
  .nav-toggle span::after {
    content: ''; display: block; width: 24px; height: 2px;
    background: var(--text-primary); position: absolute; transition: all 0.3s;
  }
  .nav-toggle span::before { top: -7px; }
  .nav-toggle span::after { top: 7px; }

  .value-cards { grid-template-columns: 1fr; }
  .category-cards { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}

/* ============================================
   Responsive — Phone (≤480px)
   ============================================ */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .btn { padding: 12px 20px; font-size: 0.9rem; }
  .btn-lg { padding: 14px 28px; font-size: 1rem; }
  .category-cards { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .hero h1 { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-tab { padding: 10px 14px; font-size: 0.82rem; }
  .contact-form { padding: 20px; }
}
