* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #222;
    background: #fff;
    line-height: 1.6;
}

a { color: #2563eb; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo {
    color: #111;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
}
.main-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.main-nav a {
    color: #444;
    text-decoration: none;
    font-size: 14px;
}
.main-nav a:hover { text-decoration: underline; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 25px 0;
    color: #777;
    font-size: 14px;
}
.breadcrumb a { text-decoration: none; }

.home-intro { padding: 60px 0 45px; max-width: 850px; }
.home-intro h1 { margin-bottom: 20px; font-size: 36px; }
.home-intro p { margin: 12px 0; line-height: 1.8; color: #555; }
.home-section { margin: 55px 0; }
.home-section h2 { margin-bottom: 15px; }
.home-section > p { max-width: 800px; line-height: 1.8; color: #555; }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.section-heading h2 { margin: 0; }

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.calculator-card {
    display: block;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s ease, transform .2s ease;
}
.calculator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,.07);
}
.calculator-card h2,
.calculator-card h3 { margin: 0 0 10px; font-size: 19px; }
.calculator-card p { margin: 0; color: #666; line-height: 1.6; }

.calculator-page {
    max-width: 850px;
    margin: 0 auto;
    padding-bottom: 60px;
}
.calculator-description { color: #666; }

.calculator-form {
    margin-top: 25px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
}
.form-help { margin-top: 6px; color: #777; font-size: 13px; }

.btn {
    border: 0;
    border-radius: 7px;
    padding: 12px 18px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font: inherit;
}
.btn:hover { opacity: .9; }

.alert {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
}
.alert-error { background: #fef2f2; color: #991b1b; }

.result-box {
    margin-top: 25px;
    padding: 25px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
}
.result-box h2 { margin-top: 0; }

.calculator-info,
.calculator-notice {
    margin-top: 40px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}
.calculator-info h2,
.calculator-notice h2 { margin-top: 0; }
.calculator-info p,
.calculator-notice p { color: #555; line-height: 1.8; }

.calculator-category { margin-top: 50px; }
.calculator-category h2 { margin-bottom: 20px; }

.home-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}
.home-links a {
    display: block;
    padding: 17px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.static-page {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px 0 60px;
}
.static-page h1 { margin-bottom: 35px; }
.static-page h2 { margin-top: 40px; margin-bottom: 15px; }
.static-page p { line-height: 1.85; color: #444; }
.static-page ul { padding-left: 22px; line-height: 1.9; }

.site-footer {
    margin-top: 80px;
    padding: 35px 0;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.footer-links a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}
.footer-copy {
    margin-top: 20px;
    color: #888;
    font-size: 13px;
}

@media (max-width: 900px) {
    .calculator-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .container { width: min(100% - 28px, 1120px); }
    .header-inner { align-items: flex-start; padding: 16px 0; flex-direction: column; }
    .home-intro { padding: 40px 0 30px; }
    .home-intro h1 { font-size: 30px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .home-links,
    .calculator-grid { grid-template-columns: 1fr; }
}
