/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f4f8; color: #1e293b; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; color: #1d4ed8; }

/* ===== Header ===== */
.site-header { background: #1e3a5f; color: white; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 800; color: white; letter-spacing: -0.5px; }
.logo-icon { width: 34px; height: 34px; flex-shrink: 0; }
.logo-text-wrap { color: white; }
.logo-dot-net { color: #60a5fa; }
.site-logo:hover { text-decoration: none; color: white; }

/* ===== Nav ===== */
.site-nav ul { display: flex; list-style: none; gap: 0; }
.site-nav a { color: #cbd5e1; padding: 18px 15px; display: block; font-size: 0.875rem; font-weight: 500; transition: color 0.15s, background 0.15s; }
.site-nav a:hover, .site-nav a.active { color: white; background: rgba(255,255,255,0.12); text-decoration: none; }

/* ===== Breadcrumb ===== */
.breadcrumb-bar { background: white; border-bottom: 1px solid #e2e8f0; }
.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 9px 20px; font-size: 0.82rem; color: #64748b; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.breadcrumb a { color: #2563eb; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; }
.breadcrumb .current { color: #475569; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%); color: white; padding: 52px 20px 48px; }
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; opacity: 0.85; max-width: 580px; }

/* ===== Page Container ===== */
.page-container { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }

/* ===== Section title ===== */
.section-title { font-size: 1.2rem; font-weight: 600; color: #1e293b; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }

/* ===== Homepage category cards ===== */
.categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.category-card { background: white; border-radius: 8px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; }
.category-card-title { font-size: 1rem; font-weight: 700; color: #1e3a5f; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #2563eb; }
.category-card-title a { color: inherit; }
.category-card-title a:hover { color: #2563eb; text-decoration: none; }
.tool-list { list-style: none; }
.tool-list li { border-bottom: 1px solid #f1f5f9; }
.tool-list li:last-child { border-bottom: none; }
.tool-list a { color: #374151; font-size: 0.875rem; padding: 6px 0; display: flex; align-items: center; gap: 6px; }
.tool-list a::before { content: "›"; color: #2563eb; font-size: 1rem; line-height: 1; }
.tool-list a:hover { color: #2563eb; text-decoration: none; }

/* ===== Category page ===== */
.cat-page-header { margin-bottom: 28px; }
.cat-page-header h1 { font-size: 1.75rem; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.cat-page-header p { color: #64748b; font-size: 0.95rem; max-width: 640px; }
.tool-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tool-card { background: white; border-radius: 8px; padding: 18px 20px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: box-shadow 0.2s, border-color 0.2s; display: block; }
.tool-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); border-color: #93c5fd; text-decoration: none; }
.tool-card h2 { font-size: 0.95rem; font-weight: 600; color: #1e3a5f; margin-bottom: 5px; }
.tool-card:hover h2 { color: #2563eb; }
.tool-card p { color: #64748b; font-size: 0.82rem; line-height: 1.5; }

/* ===== Tool page layout ===== */
.tool-layout { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }
.tool-main { min-width: 0; }
.tool-sidebar { position: sticky; top: 20px; }
.tool-section { background: white; border-radius: 10px; border: 1px solid #e2e8f0; padding: 28px 30px; margin-bottom: 24px; }
.tool-section h2 { font-size: 1.1rem; font-weight: 700; color: #1e3a5f; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }

/* ===== Calculator widget ===== */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.calc-field label { display: block; font-size: 0.8rem; font-weight: 600; color: #475569; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.calc-field input { width: 100%; padding: 10px 13px; border: 1.5px solid #e2e8f0; border-radius: 6px; font-size: 1rem; color: #1e293b; transition: border-color 0.15s; background: #f8fafc; }
.calc-field input:focus { outline: none; border-color: #2563eb; background: white; }
.calc-btn { grid-column: 1 / -1; background: #2563eb; color: white; border: none; padding: 12px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s; margin-top: 4px; }
.calc-btn:hover { background: #1d4ed8; }
.calc-result { grid-column: 1 / -1; background: #f0f7ff; border: 1.5px solid #bfdbfe; border-radius: 8px; padding: 16px 20px; margin-top: 4px; display: none; }
.calc-result.show { display: block; }
.calc-result-label { font-size: 0.8rem; font-weight: 600; color: #2563eb; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.calc-result-value { font-size: 2rem; font-weight: 700; color: #1e3a5f; line-height: 1.2; }
.calc-result-sub { font-size: 0.82rem; color: #64748b; margin-top: 4px; }

/* ===== Formula block ===== */
.formula-box { background: #f8fafc; border-left: 4px solid #2563eb; border-radius: 0 8px 8px 0; padding: 16px 20px; font-family: 'Courier New', monospace; font-size: 1.05rem; color: #1e3a5f; margin-bottom: 16px; }
.formula-vars { margin-top: 14px; }
.formula-vars dt { font-weight: 600; font-size: 0.875rem; color: #1e293b; margin-top: 8px; }
.formula-vars dd { font-size: 0.875rem; color: #64748b; margin-left: 0; }

/* ===== Example block ===== */
.example-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 18px 20px; }
.example-box .ex-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid #dcfce7; font-size: 0.9rem; }
.example-box .ex-row:last-child { border-bottom: none; }
.example-box .ex-label { color: #64748b; }
.example-box .ex-val { font-weight: 600; color: #1e293b; }
.example-box .ex-result { background: #16a34a; color: white; border-radius: 6px; padding: 10px 18px; text-align: center; margin-top: 14px; font-size: 1.1rem; font-weight: 700; }

/* ===== SEO content section ===== */
.seo-content h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 20px 0 8px; }
.seo-content h3:first-child { margin-top: 0; }
.seo-content p { font-size: 0.9rem; color: #475569; line-height: 1.75; margin-bottom: 10px; }
.seo-content ul, .seo-content ol { padding-left: 20px; margin-bottom: 10px; }
.seo-content li { font-size: 0.9rem; color: #475569; line-height: 1.75; }

/* ===== FAQ ===== */
.faq-item { border-bottom: 1px solid #f1f5f9; }
.faq-item:last-child { border-bottom: none; }
.faq-q { width: 100%; background: none; border: none; text-align: left; padding: 14px 0; font-size: 0.92rem; font-weight: 600; color: #1e293b; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q:hover { color: #2563eb; }
.faq-q .faq-icon { flex-shrink: 0; font-size: 1.2rem; color: #94a3b8; transition: transform 0.2s; }
.faq-q.open .faq-icon { transform: rotate(45deg); }
.faq-a { font-size: 0.875rem; color: #64748b; line-height: 1.75; padding-bottom: 14px; display: none; }

/* ===== Sidebar related links ===== */
.sidebar-card { background: white; border-radius: 10px; border: 1px solid #e2e8f0; padding: 20px; margin-bottom: 20px; }
.sidebar-card h4 { font-size: 0.85rem; font-weight: 700; color: #1e3a5f; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.sidebar-links { list-style: none; }
.sidebar-links li { border-bottom: 1px solid #f1f5f9; }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a { font-size: 0.85rem; color: #374151; padding: 7px 0; display: flex; align-items: center; gap: 5px; }
.sidebar-links a::before { content: "›"; color: #2563eb; }
.sidebar-links a:hover { color: #2563eb; text-decoration: none; }

@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-grid.cols-3 { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */
.site-footer { background: #0f172a; color: #94a3b8; margin-top: 0; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 44px 20px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand p { font-size: 0.82rem; line-height: 1.8; margin-top: 8px; }
.footer-brand .logo-text { font-size: 1.1rem; font-weight: 700; color: white; }
.footer-brand .logo-text span { color: #60a5fa; }
.footer-col h4 { color: #e2e8f0; font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: #94a3b8; font-size: 0.82rem; }
.footer-col a:hover { color: white; text-decoration: none; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; font-size: 0.8rem; text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .categories-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tool-cards-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.95rem; }
}