*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #00897b;
    --primary-dark: #00695c;
    --primary-light: #e0f2f1;
    --secondary: #ffb300;
    --warning: #fb8c00;
    --danger: #e53935;
    --text: #222222;
    --text-light: #6b7280;
    --bg: #fdf7f0;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 14px 45px rgba(0, 0, 0, 0.12);
    --radius: 18px;
    --radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at 0 0, #ffe0b2 0, #fdf7f0 40%, #b2dfdb 100%);
    opacity: 0.25;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-dark);
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

main {
    padding-top: 70px;
}

.hero {
    background: linear-gradient(135deg, #00897b 0%, #26a69a 50%, #80cbc4 100%);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.calculator-section {
    padding: 3rem 2rem;
    margin-top: -2rem;
    position: relative;
    z-index: 10;
}

.calculator-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calculator-card,
.result-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header,
.result-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: var(--white);
}

.card-header h2,
.result-header h3 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.card-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.bmi-form {
    padding: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 4rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-wrapper .unit {
    position: absolute;
    right: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

.input-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.btn-calculate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
}

.result-content {
    padding: 2rem;
}

.bmi-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.bmi-number {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.bmi-label {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.bmi-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

.status-text {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text-light);
}

.status-text.thin {
    background: #e3f2fd;
    color: #1565c0;
}

.status-text.normal {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-text.overweight {
    background: #fff3e0;
    color: #ef6c00;
}

.status-text.obese {
    background: #ffebee;
    color: #c62828;
}

.bmi-gauge {
    margin: 1.5rem 0;
}

.gauge-track {
    position: relative;
    height: 12px;
    background: linear-gradient(to right, #80cbc4 0%, #4db6ac 25%, #4db6ac 45%, #ffca28 60%, #f57c00 100%);
    border-radius: 6px;
    overflow: visible;
}

.gauge-fill {
    height: 100%;
    border-radius: 6px;
}

.gauge-pointer {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 3px solid var(--text);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.5s ease;
    left: 0;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.health-tips {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.health-tips h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.health-tips p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.info-section {
    padding: 4rem 0;
    background: var(--white);
}

.info-section h2,
.formula-section h2,
.features-section h2,
.faq-section h2,
.knowledge-section h2,
.related-section h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.table-wrapper {
    overflow-x: auto;
}

.bmi-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.bmi-table caption {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    background: var(--bg);
}

.bmi-table th,
.bmi-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.bmi-table th {
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: var(--white);
    font-weight: 600;
}

.bmi-table tbody tr:hover {
    background: var(--bg);
}

.table-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-light);
}

.level-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.level-badge.thin {
    background: #e3f2fd;
    color: #1565c0;
}

.level-badge.normal {
    background: #e8f5e9;
    color: #2e7d32;
}

.level-badge.overweight {
    background: #fff3e0;
    color: #ef6c00;
}

.level-badge.obese {
    background: #ffebee;
    color: #c62828;
}

.formula-section {
    padding: 4rem 0;
    background: var(--bg);
}

.formula-card {
    max-width: 800px;
    margin: 2rem auto 0;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.formula-display {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

.formula-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.formula-detail {
    margin-bottom: 2rem;
}

.formula-detail h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.formula-detail ul {
    list-style: none;
    padding-left: 0;
}

.formula-detail li {
    padding: 0.5rem 0;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border);
}

.formula-example h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.formula-example p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.example-steps {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step-num {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #00897b 0%, #26a69a 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.example-result {
    color: var(--secondary);
    font-weight: 600;
    margin-top: 1rem;
    padding: 1rem;
    background: #e8f5e9;
    border-radius: var(--radius-sm);
}

.features-section {
    padding: 4rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.knowledge-section {
    padding: 4rem 0;
    background: var(--bg);
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.knowledge-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    border-top: 4px solid;
    border-image: linear-gradient(135deg, #00897b, #26a69a) 1;
}

.knowledge-card h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.knowledge-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

.faq-section {
    padding: 4rem 0;
    background: var(--white);
}

.faq-list {
    max-width: 900px;
    margin: 2rem auto 0;
}

.faq-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    list-style: none;
    transition: var(--transition);
}

.faq-item summary:hover {
    background: var(--white);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-question {
    flex: 1;
    font-size: 1rem;
}

.faq-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: var(--text);
    transition: var(--transition);
}

.faq-icon::before {
    width: 14px;
    height: 2px;
    top: 11px;
    left: 5px;
}

.faq-icon::after {
    width: 2px;
    height: 14px;
    top: 5px;
    left: 11px;
}

.faq-item[open] .faq-icon::after {
    transform: rotate(90deg);
    opacity: 0;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.faq-answer p {
    font-size: 0.95rem;
}

.related-section {
    padding: 4rem 0;
    background: var(--bg);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.related-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.related-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.related-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

footer {
    background: linear-gradient(135deg, #0f2f2b 0%, #0b3b35 100%);
    color: var(--white);
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .site-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-brand .site-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-nav h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-nav ul {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--white);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom .copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.footer-bottom .icp a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-bottom .icp a:hover {
    color: var(--white);
}

@media (max-width: 900px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .bmi-form {
        padding: 1.5rem;
    }

    .result-content {
        padding: 1.5rem;
    }

    .bmi-number {
        font-size: 3rem;
    }

    .container {
        padding: 0 1rem;
    }

    .features-grid,
    .knowledge-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-links {
        display: none;
    }

    .calculator-section {
        padding: 2rem 1rem;
    }

    .input-wrapper input {
        padding: 0.875rem 1rem;
        padding-right: 3.5rem;
        font-size: 0.95rem;
    }

    .formula-text {
        font-size: 1.1rem;
    }
}

.section-image {
    max-width: 800px;
    margin: 2rem auto 0;
    text-align: center;
}

.section-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.input-wrapper input.error {
    border-color: var(--danger);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card,
.result-card {
    animation: fadeInUp 0.6s ease forwards;
}

.result-card {
    animation-delay: 0.2s;
}