
:root {
  --primary: #1a365d; --primary-2: #112846; --accent: #e8712b; --accent-2: #c95f1f;
  --ink: #17324a; --muted: #5d7085; --line: #d9e3ee; --bg: #f4f8fc;
  --white: #ffffff; --radius-lg: 24px; --radius-md: 18px; --radius-sm: 12px;
  --shadow-soft: 0 16px 34px rgba(18, 40, 70, 0.1); --shadow-pop: 0 20px 48px rgba(14, 33, 57, 0.18);
  --container: 1180px; --nav-h: 78px; --ease: 0.3s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.container { width: min(calc(100% - 40px), var(--container)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 1000; width: 100%; background: var(--primary-2); border-bottom: 1px solid rgba(255,255,255,0.1); }
.nav-wrap { min-height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; text-decoration: none; font-size: 1.2rem; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.lang-switch { display: flex; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; overflow: hidden; }
.lang-btn { min-width: 44px; height: 32px; border: none; background: transparent; color: #fff; cursor: pointer; font-weight: 700; font-size: 0.75rem; }
.lang-btn.active { background: var(--accent); }
.epc-main { flex: 1; padding: 30px 0; }
.epc-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.card { background: var(--white); border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: var(--shadow-soft); overflow: hidden; }
.sidebar-head { padding: 18px; border-bottom: 1px solid var(--line); background: #fcfdfe; }
.sidebar-head h2 { font-size: 1rem; color: var(--primary); }
.model-list { list-style: none; max-height: 520px; overflow-y: auto; }
.model-item { padding: 12px 20px; border-bottom: 1px solid #f8f9fa; cursor: pointer; font-size: 0.88rem; color: var(--muted); transition: all var(--ease); }
.model-item:hover { background: #f0f7ff; color: var(--primary); }
.model-item.active { background: #eef6ff; border-left: 4px solid var(--accent); color: var(--accent); font-weight: 700; }
.model-section-header { padding: 10px 20px 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); background: #fdf5f0; border-bottom: 1px solid #fde8d8; }
.search-box { padding: 20px; margin-bottom: 20px; }
.search-wrap { display: flex; gap: 10px; }
input { flex: 1; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 18px; outline: none; font-size: 0.95rem; }
input:focus { border-color: var(--accent); background: #fff; }
.btn-primary { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0 24px; font-weight: 700; cursor: pointer; display: flex; align-items: center; }
.btn-primary:hover { background: var(--accent-2); }
#statusInfo { margin-top: 10px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th { background: #f8fafc; padding: 14px 18px; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--line); text-align: left; }
.results-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 0.9rem; vertical-align: middle; }
.oe-num { font-family: monospace; font-weight: 700; color: var(--primary); background: #f0f4f8; padding: 3px 6px; border-radius: 4px; }
.action-btn { padding: 8px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; cursor: pointer; border: 1px solid var(--line); text-decoration: none; margin: 2px; display: inline-flex; align-items: center; gap: 4px; }
.btn-photo { color: #e31212; background: #fff5f5; border-color: #feb2b2; }
.btn-photo:hover { background: #e31212; color: #fff; }
.btn-diag { color: #1a365d; background: #f0f7ff; border-color: #bee3f8; }
.btn-diag:hover { background: #1a365d; color: #fff; }

/* No Result Contact Card */
.no-result-card {
  padding: 40px 30px;
  text-align: center;
}
.no-result-card h3 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.no-result-card .desc {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.no-result-card .query-info {
  font-family: 'Courier New', monospace;
  color: var(--accent);
  background: #fff5f0;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  word-break: break-all;
  font-size: 0.85rem;
}
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 200px;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.contact-btn:hover {
  transform: translateY(-3px);
}
.contact-btn.whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}
.contact-btn.whatsapp:hover {
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5);
}
.contact-btn.telegram {
  background: linear-gradient(135deg, #0088cc, #0077b5);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.4);
}
.contact-btn.telegram:hover {
  box-shadow: 0 12px 32px rgba(0, 136, 204, 0.5);
}
.contact-btn.email {
  background: linear-gradient(135deg, #e8712b, #c95f1f);
  color: #fff;
  box-shadow: 0 8px 24px rgba(232, 113, 43, 0.4);
}
.contact-btn.email:hover {
  box-shadow: 0 12px 32px rgba(232, 113, 43, 0.5);
}

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal-content { background: #fff; border-radius: var(--radius-lg); max-width: 900px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: #eee; border-radius: 50%; border: none; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 20px; text-align: center; }
.modal-body img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.modal-foot { padding: 15px; background: #f8fafc; text-align: center; font-weight: 700; border-top: 1px solid var(--line); }
.site-footer { text-align: center; background: var(--primary); color: #fff; padding: 20px; font-size: 0.85rem; }
.footer-note { background: #f0f7ff; padding: 14px 16px; border-top: 1px solid var(--line); text-align: center; font-size: 0.8rem; color: var(--muted); }
.loading { padding: 80px; text-align: center; font-weight: 700; color: var(--muted); }
.empty { padding: 80px; text-align: center; color: var(--muted); }

@media (max-width: 900px) { .epc-grid { grid-template-columns: 1fr; } .model-list { max-height: 250px; } }
@media (max-width: 600px) { .contact-buttons { flex-direction: column; } .contact-btn { width: 100%; } }

/* EPC Inline Inquiry Form */
.epc-inquiry-wrap { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; text-align: left; }
.epc-inquiry-wrap h4 { font-size: 1.05rem; color: var(--primary); margin-bottom: 6px; }
.epc-inquiry-wrap p { font-size: 0.86rem; color: var(--muted); margin-bottom: 16px; }
.epc-iq-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 540px) { .epc-iq-row { grid-template-columns: 1fr; } }
.epc-iq-row input, .epc-iq-row textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 0.88rem; color: var(--ink); background: #f8fafd; outline: none; font-family: inherit; width: 100%; box-sizing: border-box; transition: border-color 0.2s, box-shadow 0.2s; }
.epc-iq-row input:focus, .epc-iq-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,113,43,0.12); background:#fff; }
.epc-iq-row textarea { resize: vertical; min-height: 70px; }
.epc-iq-row.full { grid-template-columns: 1fr; }
.epc-iq-btn { width: 100%; min-height: 48px; margin-top: 10px; border: none; border-radius: 12px; cursor: pointer; font-size: 0.95rem; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 22px rgba(232,113,43,0.28); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.epc-iq-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(232,113,43,0.36); }
.epc-iq-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.epc-iq-msg { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 0.87rem; font-weight: 600; display: none; }
.epc-iq-msg.success { background: rgba(37,211,102,0.1); color: #0e7a35; border: 1px solid rgba(37,211,102,0.3); }
.epc-iq-msg.error { background: rgba(220,38,38,0.08); color: #b91c1c; border: 1px solid rgba(220,38,38,0.2); }

.crumbs { max-width: 1180px; margin: 0 auto; padding: 14px 24px 0; font-size: 0.82rem; color: var(--muted, #64748b); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span.sep { opacity: .55; margin: 0 6px; }
.crumbs strong { font-weight: 600; color: var(--ink, #0f172a); }


/* brand mark: use the real QIFAN logo in the header */
.logo-mark{
  width:34px;height:34px;border-radius:9px;
  background-color:#000;
  background-image:url('/assets/brand-mark-128.webp');
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  color:transparent;font-size:0;line-height:0;overflow:hidden;
  box-shadow:0 0 0 1.5px rgba(255,255,255,.30), 0 2px 8px rgba(0,0,0,.45);
  flex:0 0 auto;
}


/* mobile: the coverage list must stack, and the model sidebar must not overflow */
.epc-grid > * { min-width: 0; }
.epc-list, .model-list, .model-item, .model-item a { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .epc-grid { grid-template-columns: 1fr; }
  .epc-grid > aside { width: 100%; max-width: 100%; }
}
@media (max-width: 640px) {
  #epc-index ul { columns: 1 !important; }
}


/* anchors must clear the fixed header */
:target { scroll-margin-top: 92px; }
#epc-index, #contact, #faq, #quote { scroll-margin-top: 92px; }
