:root {
    --color-brand: #f97316;
    --color-cta: #22d3ee;
    --text-muted: #888;
    --border: #ddd;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

img, video, iframe, svg, canvas {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.cat-intro {
    padding: 64px 24px;
}

.cat-intro__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    align-items: start;
}

.cat-intro__text h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-brand);
    margin: 0 0 18px;
}

.cat-intro__text p {
    color: #444;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 14px;
}

.cat-intro__stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cat-stat {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 22px 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-stat__num {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-brand);
    line-height: 1.7;
}

.cat-stat__num, .cat-stat__label {
    color: #fff;
}

.cat-stat__num {
    color: var(--color-brand);
}

.cat-stat__label {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.7;
}

.cat-articles {
    padding: 0 24px 72px;
}

.cat-articles__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 36px;
}

.masonry-grid {
    columns: 3;
    column-gap: 20px;
}

.mcard {
    break-inside: avoid;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.mcard:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}

.mcard__img-wrap {
    overflow: hidden;
}

.mcard__img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.mcard--tall .mcard__img-wrap img {
    height: 280px;
}

.mcard:hover .mcard__img-wrap img {
    opacity: 0.9;
}

.mcard__body {
    padding: 18px 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mcard__date {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

.mcard__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.7;
}

.mcard__title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
}

.mcard__title a:hover {
    color: var(--color-brand);
}

.mcard__desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.cat-empty {
    padding: 64px 24px;
}

.cat-empty__box {
    background: #fff8f3;
    border-radius: 8px;
    padding: 48px 36px;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.cat-empty__box p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.cat-compare {
    padding: 64px 24px;
    background: #fafafa;
}

.cat-compare h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
}

.cat-compare > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 28px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead tr {
    background: var(--color-brand);
}

thead th {
    color: #fff;
    font-weight: 700;
    padding: 13px 16px;
    text-align: left;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    background: #fff;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: #fff8f3;
}

tbody td {
    padding: 12px 16px;
    color: #333;
    line-height: 1.7;
}

.cat-note {
    font-size: 13px;
    color: var(--text-muted);
    margin: 18px 0 0;
    line-height: 1.7;
}

.cat-calculator {
    padding: 64px 24px;
}

.cat-calculator h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
}

.cat-calculator > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 32px;
}

.calc-box {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 36px 40px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calc-box h2,
.calc-box p,
.calc-box label,
.calc-box output,
.calc-box span,
.calc-box strong {
    color: #fff;
}

.calc-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-row label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1.7;
}

.calc-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calc-input-row input[type="range"] {
    flex: 1;
    accent-color: var(--color-brand);
    height: 4px;
    cursor: pointer;
}

.calc-input-row output {
    min-width: 60px;
    text-align: right;
    font-weight: 700;
    color: var(--color-brand);
    font-size: 1rem;
    line-height: 1.7;
}

.calc-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #333;
    padding-top: 20px;
    margin-top: 4px;
}

.calc-result span {
    font-size: 1rem;
    color: #bbb;
    line-height: 1.7;
}

.calc-result strong {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-brand);
    line-height: 1.7;
}

.cat-timeline {
    padding: 64px 24px;
    background: #fafafa;
}

.cat-timeline h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
}

.cat-timeline > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 40px;
}

.timeline {
    position: relative;
    padding-left: 36px;
    max-width: 820px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #ddd;
}

.timeline__item {
    position: relative;
    margin-bottom: 36px;
}

.timeline__item:last-child {
    margin-bottom: 0;
}

.timeline__marker {
    position: absolute;
    left: -30px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-brand);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--color-brand);
}

.timeline__content {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.timeline__period {
    font-size: 13px;
    color: var(--color-brand);
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.7;
}

.timeline__content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 8px;
    line-height: 1.7;
}

.timeline__content p {
    font-size: 0.95rem;
    color: #555;
    margin: 0;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .cat-hero__content h1 {
        font-size: 1.9rem;
    }

    .cat-hero__content p {
        font-size: 1rem;
    }

    .cat-intro {
        padding: 40px 16px;
    }

    .cat-intro__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cat-intro__stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .cat-stat {
        flex: 1;
        min-width: 120px;
        padding: 16px 18px;
    }

    .cat-articles {
        padding: 0 16px 48px;
    }

    .masonry-grid {
        columns: 2;
        column-gap: 16px;
    }

    .cat-compare {
        padding: 40px 16px;
    }

    .cat-calculator {
        padding: 40px 16px;
    }

    .calc-box {
        padding: 24px 20px;
    }

    .cat-timeline {
        padding: 40px 16px;
    }

    .cat-articles__title,
    .cat-compare h2,
    .cat-calculator h2,
    .cat-timeline h2 {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .cat-hero__content h1 {
        font-size: 1.5rem;
    }

    .masonry-grid {
        columns: 1;
        column-gap: 0;
    }

    .mcard--tall .mcard__img-wrap img {
        height: 200px;
    }

    .cat-intro__stats {
        flex-direction: column;
    }

    .calc-result {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .timeline {
        padding-left: 28px;
    }

    .timeline__marker {
        left: -23px;
    }

    tbody td,
    thead th {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}