/* ===== internetbillcalc.com - Global Styles ===== */
/* Primary: #165DFF (Tech Blue) | Secondary: #0E42D2 | BG: #F5F7FA | Card: #FFFFFF */

/* === CSS Variables (for Dark Mode) === */
:root {
  --bg: #F5F7FA;
  --bg-card: #FFFFFF;
  --text: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e8ecf1;
  --border-input: #d1d9e6;
  --nav-bg: #fff;
  --nav-shadow: rgba(22,93,255,0.06);
  --card-shadow: rgba(22,93,255,0.06);
  --card-shadow-hover: rgba(22,93,255,0.10);
  --result-bg: #F0F4FF;
  --primary: #165DFF;
  --primary-hover: #0E42D2;
  --primary-light: #EEF2FF;
  --footer-bg: #1a1a2e;
  --footer-text: #a0aec0;
  --toast-bg: #1a1a2e;
  --toast-text: #fff;
  --sticky-btn-bg: #165DFF;
  --sticky-btn-text: #fff;
}
body.dark-mode {
  --bg: #0f1117;
  --bg-card: #1a1d29;
  --text: #e4e6eb;
  --text-secondary: #b0b3b8;
  --text-muted: #8a8d94;
  --text-light: #6b7080;
  --border: #2d3045;
  --border-input: #3a3d52;
  --nav-bg: #1a1d29;
  --nav-shadow: rgba(0,0,0,0.3);
  --card-shadow: rgba(0,0,0,0.2);
  --card-shadow-hover: rgba(22,93,255,0.15);
  --result-bg: #1a2332;
  --primary-light: #1a2744;
  --footer-bg: #0a0c14;
  --footer-text: #6b7080;
  --toast-bg: #2d3045;
  --toast-text: #e4e6eb;
  --sticky-btn-bg: #1a1d29;
  --sticky-btn-text: #e4e6eb;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; -webkit-font-smoothing: antialiased; transition: background 0.3s, color 0.3s; }

/* === Container === */
.container { max-width: 1200px; width: 92%; margin: 0 auto; }

/* === Navigation === */
.site-nav { background: var(--nav-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px var(--nav-shadow); transition: background 0.3s; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.nav-logo img { height: 34px; width: auto; }
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: 0.88rem; padding: 8px 14px; border-radius: 6px; transition: all 0.2s; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { background: var(--primary-light); color: var(--primary); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* Dark mode toggle button */
.dark-toggle { background: none; border: 1.5px solid var(--border); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; transition: all 0.2s; margin-left: 8px; }
.dark-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* === Hero Section === */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #0E42D2 100%); color: #fff; padding: 60px 0 50px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%); pointer-events: none; }
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 700px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(255,255,255,0.15); padding: 4px 16px; border-radius: 20px; font-size: 0.8rem; margin-bottom: 16px; backdrop-filter: blur(4px); }

/* === Section === */
.section { padding: 48px 0; }
.section-title { font-size: 1.7rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.section-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 32px; }
.section-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 0; }

/* === Cards === */
.card { background: var(--bg-card); border-radius: 14px; box-shadow: 0 2px 12px var(--card-shadow); padding: 28px; transition: transform 0.2s, box-shadow 0.2s, background 0.3s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px var(--card-shadow-hover); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card-grid a { display: block; text-decoration: none; color: inherit; }
.card-icon { font-size: 2rem; margin-bottom: 10px; display: inline-block; }
.card-icon svg { width: 40px; height: 40px; stroke: var(--primary); fill: none; stroke-width: 1.8; }
.card h3 a { text-decoration: none; color: var(--text); font-size: 1.05rem; }
.card h3 a:hover { color: var(--primary); }

/* === Tabs === */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn { padding: 12px 24px; background: none; border: none; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); cursor: pointer; position: relative; transition: color 0.2s; }
.tab-btn::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: transparent; transition: 0.2s; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after { background: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Calculator Box === */
.calculator-box { padding: 2rem; border-radius: 14px; background: var(--bg-card); border: 2px solid var(--primary); margin: 2rem 0; box-shadow: 0 4px 20px rgba(22, 93, 255, 0.10), 0 1px 3px rgba(0,0,0,0.06); transition: background 0.3s; scroll-margin-top: 80px; }

/* === Calculator Form Layout === */
.calc-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 8px; }
.calc-form .calc-btn { grid-column: 1 / -1; justify-self: start; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-input); border-radius: 8px; font-size: 0.95rem; transition: border-color 0.2s, background 0.3s; background: var(--bg-card); color: var(--text); box-sizing: border-box; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,93,255,0.10); }
.calc-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.calc-field { flex: 1; min-width: 200px; }
.calc-field label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.calc-field input, .calc-field select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-input); border-radius: 8px; font-size: 0.95rem; transition: border-color 0.2s, background 0.3s; background: var(--bg-card); color: var(--text); }
.calc-field input:focus, .calc-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,93,255,0.10); }
.calc-btn { background: var(--primary); color: #fff; border: none; padding: 12px 32px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.calc-btn:hover { background: var(--primary-hover); }
.calc-btn:active { transform: scale(0.98); }
.calc-btn-secondary { background: var(--bg-card); color: var(--primary); border: 1.5px solid var(--primary); }
.calc-btn-secondary:hover { background: var(--primary-light); }
.calc-result { margin-top: 20px; padding: 20px; background: var(--result-bg); border-radius: 10px; border-left: 4px solid var(--primary); transition: background 0.3s; }
.calc-result .amount { font-size: 2rem; font-weight: 800; color: var(--primary); }
.calc-result .label { font-size: 0.85rem; color: var(--text-muted); }
.calc-note { font-size: 0.83rem; color: var(--text-light); margin-top: 8px; font-style: italic; }
.rate-note { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; color: #92400E; margin-top: 12px; }

/* === Floating Action Button (FAB) === */
.fab { position: fixed; bottom: 24px; right: 24px; z-index: 1000; }
.fab-main { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 16px rgba(22,93,255,0.35); transition: transform 0.3s, background 0.2s; display: flex; align-items: center; justify-content: center; }
.fab-main:hover { background: var(--primary-hover); transform: scale(1.05); }
.fab.open .fab-main { transform: rotate(45deg); background: #DC2626; }
.fab-menu { display: none; flex-direction: column; align-items: flex-end; gap: 10px; position: absolute; bottom: 64px; right: 0; }
.fab.open .fab-menu { display: flex; }
.fab-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 1.2rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: transform 0.2s, background 0.2s; display: flex; align-items: center; justify-content: center; position: relative; }
.fab-btn:hover { background: var(--primary-hover); transform: scale(1.1); }
.fab-btn .tooltip { display: none; position: absolute; right: 52px; background: var(--toast-bg); color: var(--toast-text); padding: 5px 10px; border-radius: 6px; font-size: 0.78rem; white-space: nowrap; pointer-events: none; }
.fab-btn:hover .tooltip { display: block; }

/* === Charts === */
.chart-container { margin-top: 20px; padding: 16px; background: var(--bg-card); border-radius: 10px; border: 1px solid var(--border); transition: background 0.3s; }
.chart-container canvas { max-height: 350px; }

/* === FAQ === */
.faq-section { margin-top: 2rem; }
.faq-section h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; padding: 20px 24px; transition: background 0.3s, box-shadow 0.2s; }
.faq-item:hover { box-shadow: 0 2px 8px rgba(22,93,255,0.06); }
.faq-item h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.faq-item p { font-size: 0.93rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }

/* FAQ Accordion (used on homepage) */
.faq-q { padding: 16px 20px; font-weight: 600; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); transition: background 0.2s; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 10px; overflow: hidden; }
.faq-q:hover { background: var(--bg); }
.faq-q .icon { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.3s; }
.faq-q .icon svg { width: 100%; height: 100%; stroke: var(--primary); stroke-width: 2; fill: none; }
.faq-item.open .faq-q .icon { transform: rotate(180deg); }
.faq-a { padding: 0 20px 16px; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.7; display: none; }
.faq-item.open .faq-a { display: block; }

/* === Trust Bar === */
.trust-bar { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; padding: 20px 0; }
.trust-item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; }
.trust-item svg { width: 18px; height: 18px; stroke: var(--primary); fill: none; }

/* === Feature Grid === */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* === Content Styles === */
.content-body { }
.content-body h2 { font-size: 1.5rem; margin: 32px 0 12px; color: var(--text); }
.content-body h3 { font-size: 1.15rem; margin: 24px 0 8px; color: var(--text); }
.content-body p { margin-bottom: 16px; color: var(--text-secondary); font-size: 0.95rem; }
.content-body ul, .content-body ol { margin: 0 0 16px 20px; color: var(--text-secondary); }
.content-body li { margin-bottom: 6px; }
.content-body a { color: var(--primary); }
.content-body strong { color: var(--text); }

/* === Inner Page Hero (shared by calculators, state guides, static pages) === */
.page-hero { background: linear-gradient(135deg, var(--primary) 0%, #0E42D2 100%); color: #fff; padding: 48px 0 40px; text-align: center; }
.page-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.page-hero p { opacity: 0.9; max-width: 680px; margin: 0 auto; }


/* === External Links Section === */
.ext-links { background: var(--bg-card); border-radius: 12px; padding: 24px; border: 1px solid var(--border); margin: 24px 0; transition: background 0.3s; }
.ext-links h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.ext-links ul { list-style: none; }
.ext-links li { margin-bottom: 8px; }
.ext-links a { color: var(--primary); text-decoration: none; font-size: 0.9rem; }
.ext-links a:hover { text-decoration: underline; }

/* === Site Network === */
.site-network { background: var(--bg-card); border-radius: 12px; padding: 24px; border: 1px solid var(--border); margin: 24px 0; transition: background 0.3s; }
.site-network h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.network-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.network-grid a { color: var(--primary); text-decoration: none; font-size: 0.88rem; padding: 6px 10px; border-radius: 6px; transition: background 0.2s; }
.network-grid a:hover { background: var(--primary-light); text-decoration: underline; }

/* === Footer === */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 40px 0 24px; margin-top: 48px; transition: background 0.3s; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--footer-text); text-decoration: none; font-size: 0.85rem; padding: 3px 0; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2d2d4a; padding-top: 20px; text-align: center; font-size: 0.82rem; }
.footer-bottom .disclaimer { margin-top: 8px; font-size: 0.78rem; color: #6b7280; font-style: italic; }

/* === AdSense Hide Empty === */
/* 谷歌官方标准代码：无广告自动隐藏空白，有广告自动显示 */
/* 广告未填充：直接隐藏广告容器，消除所有留白 */
ins.adsbygoogle[data-ad-status="unfilled"],
iframe[src*="adsbygoogle"][data-ad-status="unfilled"] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* 广告填充成功：自动恢复正常广告展示 */
ins.adsbygoogle[data-ad-status="filled"],
iframe[src*="adsbygoogle"][data-ad-status="filled"] {
  display: block !important;
}

/* === Page-specific === */
.page-header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 32px 0 24px; transition: background 0.3s; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; }

/* === State Guide === */
.state-card { display: block; background: var(--bg-card); border-radius: 10px; padding: 18px; border: 1px solid var(--border); transition: box-shadow 0.2s, background 0.3s, transform 0.2s; text-decoration: none; color: inherit; }
.state-card:hover { box-shadow: 0 4px 16px rgba(22,93,255,0.12); transform: translateY(-2px); }
.state-card h3 { font-size: 1rem; margin-bottom: 6px; }
.state-card .price { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

/* === Loading === */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.loading::after { content: '...'; animation: dots 1.5s infinite; }
@keyframes dots { 0%,20% { content: '.'; } 40% { content: '..'; } 60%,100% { content: '...'; } }

/* === Toast Notification === */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--toast-bg); color: var(--toast-text); padding: 12px 24px; border-radius: 10px; font-size: 0.9rem; z-index: 9999; opacity: 0; transition: all 0.4s; pointer-events: none; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === Saved Scenarios === */
.saved-scenarios { margin-top: 20px; padding: 16px; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); transition: background 0.3s; }
.saved-scenarios h4 { font-size: 0.95rem; margin-bottom: 10px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.saved-scenarios h4 svg { width: 18px; height: 18px; stroke: var(--primary); }
.scenario-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; transition: background 0.2s; }
.scenario-item:hover { background: var(--bg); }
.scenario-item .scenario-name { font-weight: 500; color: var(--text); }
.scenario-item .scenario-value { font-weight: 700; color: var(--primary); }
.scenario-delete { background: none; border: none; color: #DC2626; cursor: pointer; padding: 4px; font-size: 0.9rem; border-radius: 4px; }
.scenario-delete:hover { background: #FEF2F2; }
.scenario-load { background: none; border: 1px solid var(--border); color: var(--primary); cursor: pointer; padding: 3px 10px; border-radius: 6px; font-size: 0.78rem; }
.scenario-load:hover { background: var(--primary-light); }

/* === Recent Estimates Feed === */
.recent-feed { margin-top: 24px; }
.recent-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; color: var(--text-secondary); }
.recent-item .recent-label { font-weight: 500; }
.recent-item .recent-value { color: var(--primary); font-weight: 600; }

/* === PWA Install Banner === */
.pwa-banner { display: none; background: var(--primary); color: #fff; padding: 10px 16px; text-align: center; font-size: 0.85rem; position: fixed; bottom: 0; left: 0; right: 0; z-index: 98; }
.pwa-banner button { background: #fff; color: var(--primary); border: none; padding: 6px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; margin-left: 10px; }

/* === Mobile === */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--nav-bg); flex-direction: column; padding: 16px 0; border-bottom: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .nav-links.open { display: flex; }
  .dark-toggle { margin: 8px 16px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 0.95rem; }
  .tabs { overflow-x: auto; }
  .tab-btn { white-space: nowrap; padding: 10px 16px; font-size: 0.85rem; }
  .calc-row { flex-direction: column; gap: 12px; }
  .calc-field { min-width: 100%; }
  .calc-form { grid-template-columns: 1fr; gap: 12px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 1.3rem; }
  .page-hero h1 { font-size: 1.5rem; }
  .trust-bar { gap: 16px; }
  body.has-sticky { padding-bottom: 0; }
}

/* === Print === */
@media print {
  .site-nav, .site-footer, .ad-banner, .calc-btn, .site-network,
  .saved-scenarios, .toast, .dark-toggle, .fab,
  .recent-feed, .pwa-banner { display: none !important; }
  .hero { background: #fff !important; color: #1a1a2e !important; padding: 20px 0; }
  .calculator-box { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body { padding-bottom: 0 !important; }
  .calc-result { break-inside: avoid; }
}
