/* ============================================================
   新嵩跨境贸易平台 - 全站共享母版样式
   PC + Mobile 响应式布局
   ============================================================ */

/* ===== CSS Variables (Design Tokens) ===== */
:root {
  --red: #c0392b;
  --red-dark: #a93226;
  --blue: #1a3a5c;
  --gold: #f39c12;
  --gold-dark: #e67e22;
  --green: #27ae60;
  --bg: #f8f9fa;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e0e0e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.25,0.8,0.25,1);
}

/* ===== Reset (scoped: only inside .global-nav and .global-footer) ===== */
html { scroll-behavior:smooth; }
a { text-decoration:none; color:inherit; }

/* Page body — only set defaults, don't override page-specific body styles */
body {
  min-height:100vh;
  overflow-x:hidden;
}

/* Only reset inside shared components, not globally */
.global-nav *, .global-footer * { box-sizing:border-box; }
.global-nav img, .global-footer img { max-width:100%; height:auto; }

/* ===== GLOBAL NAVBAR (Master Layout) ===== */
.global-nav {
  background:#fff;
  box-shadow:0 2px 12px rgba(0,0,0,0.06);
  position:sticky; top:0; z-index:1000;
  transition:box-shadow 0.3s;
}
.global-nav.scrolled { box-shadow:0 4px 20px rgba(0,0,0,0.12); }
.nav-inner {
  max-width:1300px; margin:0 auto;
  padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
}
.nav-logo { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.nav-logo img { height:38px; border-radius:8px; }
.nav-logo span { font-weight:700; font-size:17px; color:var(--red); white-space:nowrap; }

/* Navigation Links */
.nav-links { display:flex; align-items:center; gap:2px; flex:1; justify-content:center; flex-wrap:wrap; }
.nav-links a {
  padding:8px 12px; border-radius:8px; font-size:13px; font-weight:600;
  color:var(--text); transition:0.2s; white-space:nowrap; display:flex; align-items:center; gap:5px;
}
.nav-links a:hover, .nav-links a.active { background:#fff5f5; color:var(--red); }
.nav-links a i { font-size:16px; }

/* Right side: language + hamburger */
.nav-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.lang-btn {
  padding:6px 12px; border:1.5px solid var(--border); background:#fff;
  border-radius:6px; cursor:pointer; font-size:11px; font-weight:600; transition:0.2s;
}
.lang-btn.active-lang { border-color:var(--red); color:var(--red); background:#fff5f5; }
.lang-btn:hover { border-color:var(--red); }

/* Hamburger (Mobile) */
.hamburger {
  display:none; background:none; border:none; font-size:26px;
  cursor:pointer; padding:4px 8px; color:var(--text);
  line-height:1; transition:transform 0.3s;
}
.hamburger.open { transform:rotate(90deg); }

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4);
  z-index:998; opacity:0; transition:opacity 0.3s;
}
.mobile-nav-overlay.show { display:block; opacity:1; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width:900px) {
  .hamburger { display:block; }
  .nav-links {
    display:flex; flex-direction:column; gap:0;
    position:fixed; top:0; right:-320px; width:300px; max-width:85vw; height:100vh;
    background:#fff; padding:72px 12px 12px;
    box-shadow:-4px 0 20px rgba(0,0,0,0.15);
    z-index:999; transition:right 0.3s cubic-bezier(0.25,0.8,0.25,1);
    overflow-y:auto; justify-content:flex-start;
  }
  .nav-links.open { right:0; }
  .nav-links a {
    padding:14px 16px; border-radius:8px; font-size:14px;
    border-bottom:1px solid #f5f5f5;
  }
  .nav-links a:last-child { border-bottom:none; }
  /* Language buttons inside mobile menu */
  .nav-right { gap:4px; }
  .lang-btn { padding:5px 10px; font-size:10px; }
  /* Logo smaller on mobile */
  .nav-logo span { font-size:14px; }
  .nav-logo img { height:30px; }
}

@media (max-width:480px) {
  .nav-inner { padding:10px 14px; }
  .nav-logo span { font-size:13px; }
  .lang-btn { padding:4px 8px; font-size:9px; }
}

/* ===== GLOBAL FOOTER ===== */
.global-footer {
  background:#0f1a2e; color:rgba(255,255,255,0.7);
  padding:32px 20px; margin-top:auto;
}
.footer-inner {
  max-width:1300px; margin:0 auto;
  display:grid; grid-template-columns:repeat(3,1fr); gap:24px;
}
.footer-inner h5 { color:#fff; margin-bottom:10px; font-size:14px; }
.footer-inner a { color:rgba(255,255,255,0.6); font-size:12px; display:block; margin-bottom:4px; transition:0.2s; }
.footer-inner a:hover { color:#fff; }
.footer-copyright { text-align:center; margin-top:20px; padding-top:16px; border-top:1px solid rgba(255,255,255,0.1); font-size:11px; }

@media (max-width:768px) {
  .footer-inner { grid-template-columns:1fr; text-align:center; }
}

/* ===== PAGE TRANSITION ===== */
.page-content {
  animation:fadeSlideIn 0.3s ease;
  min-height:60vh;
}
@keyframes fadeSlideIn {
  from { opacity:0; transform:translateY(8px); }
  to { opacity:1; transform:translateY(0); }
}

/* ===== SECTION COMMON ===== */
.section { padding:56px 20px; }
@media (max-width:768px) { .section { padding:36px 16px; } }
.section-inner { max-width:1300px; margin:0 auto; }
.section-title { text-align:center; margin-bottom:36px; }
.section-title h2 { font-size:28px; font-weight:800; margin-bottom:8px; }
.section-title .en-sub { display:block; font-size:13px; color:var(--muted); font-weight:400; letter-spacing:0.5px; text-transform:uppercase; }

/* ===== UTILITY CLASSES ===== */
.container { max-width:1300px; margin:0 auto; padding:0 20px; }
@media (max-width:768px) { .container { padding:0 16px; } }
.hide-mobile { display:block; }
@media (max-width:768px) { .hide-mobile { display:none; } }
.show-mobile { display:none; }
@media (max-width:768px) { .show-mobile { display:block; } }

/* ===== CARD COMMON ===== */
.card {
  background:var(--card); border-radius:var(--radius-lg);
  padding:24px; box-shadow:var(--shadow-sm);
  transition:var(--transition); border:2px solid transparent;
}
.card:hover { box-shadow:var(--shadow-lg); }
.card-clickable { cursor:pointer; }
.card-clickable:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:rgba(192,57,43,0.2); }

/* ===== BUTTONS ===== */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 24px; border-radius:8px; font-weight:700; font-size:13px;
  transition:var(--transition); cursor:pointer; border:none; white-space:nowrap;
}
.btn:hover { transform:translateY(-2px); }
.btn-red { background:var(--red); color:#fff; box-shadow:0 2px 8px rgba(192,57,43,0.3); }
.btn-red:hover { background:var(--red-dark); box-shadow:0 4px 14px rgba(192,57,43,0.45); }
.btn-outline { border:2px solid var(--border); background:transparent; }
.btn-outline:hover { border-color:var(--red); color:var(--red); }
.btn-gold { background:var(--gold); color:#1a1a2e; box-shadow:0 2px 8px rgba(243,156,18,0.3); }
.btn-gold:hover { background:var(--gold-dark); }
.btn-lg { padding:14px 32px; font-size:15px; border-radius:10px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--text); }
.form-input {
  width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:8px;
  font-size:14px; transition:0.2s; background:var(--card);
}
.form-input:focus { outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(192,57,43,0.1); }
.form-input.error { border-color:#e74c3c; }

/* ===== BADGES / TAGS ===== */
.badge {
  display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:700; line-height:1.5;
}
.badge-red { background:#fff5f5; color:var(--red); }
.badge-green { background:#f0fff4; color:var(--green); }
.badge-gold { background:#fffcf0; color:var(--gold); }
.badge-blue { background:#f0f4ff; color:#1976d2; }
.badge-gray { background:#f5f5f5; color:var(--muted); }

/* ===== ALERT / TOAST ===== */
.toast {
  position:fixed; top:80px; right:20px; z-index:9999;
  padding:14px 20px; border-radius:10px; font-size:14px; font-weight:600;
  box-shadow:var(--shadow-md); animation:slideInRight 0.3s ease;
  max-width:400px;
}
.toast-success { background:#f0fff4; color:#27ae60; border:1px solid #c6f6d5; }
.toast-error { background:#fff5f5; color:#c0392b; border:1px solid #fed7d7; }
.toast-warning { background:#fffcf0; color:#f39c12; border:1px solid #fefcbf; }
@keyframes slideInRight {
  from { transform:translateX(100%); opacity:0; }
  to { transform:translateX(0); opacity:1; }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  display:inline-block; width:20px; height:20px;
  border:2px solid rgba(0,0,0,0.1); border-top-color:var(--red);
  border-radius:50%; animation:spin 0.6s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ===== DOWNLOAD BUTTON ===== */
.download-group { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.download-btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600;
  border:1.5px solid var(--border); background:var(--card);
  cursor:pointer; transition:var(--transition);
}
.download-btn:hover { border-color:var(--red); color:var(--red); background:#fff5f5; transform:translateY(-1px); }
.download-btn i { font-size:16px; }

/* ===== IMAGE EDITOR (Merchant) ===== */
.img-editor-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:2000;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
}
.img-editor-modal {
  background:var(--card); border-radius:var(--radius-lg);
  padding:28px; max-width:700px; width:100%; max-height:90vh;
  overflow-y:auto; box-shadow:var(--shadow-lg);
}
.img-editor-canvas-wrap {
  border:1px dashed var(--border); border-radius:8px;
  margin:16px 0; display:flex; align-items:center; justify-content:center;
  min-height:300px; background:#fafafa;
}
.img-editor-canvas-wrap canvas { max-width:100%; max-height:450px; }
.img-editor-tools { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.img-editor-tools button {
  padding:6px 14px; border:1px solid var(--border); border-radius:6px;
  background:var(--card); cursor:pointer; font-size:12px; font-weight:600;
  transition:0.15s;
}
.img-editor-tools button:hover { background:#f5f5f5; border-color:var(--muted); }
.img-editor-tools button.active { background:#fff5f5; border-color:var(--red); color:var(--red); }

/* ===== RESPONSIVE GRID ===== */
.responsive-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:20px; }

/* ===== MOBILE TABLE (Finance) ===== */
@media (max-width:768px) {
  .table-responsive { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .table-responsive table { min-width:600px; }
}

/* ===== SPA PAGE WRAPPER ===== */
.page-wrapper {
  display:flex; flex-direction:column; min-height:100vh;
}
.page-main { flex:1; }
