:root {
    --bg: #f5f7f4;
    --surface: #ffffff;
    --surface-strong: #14211f;
    --text: #17201d;
    --muted: #64706a;
    --line: #dfe6df;
    --green: #1e7b55;
    --green-dark: #14513e;
    --amber: #b46b18;
    --blue: #276d9a;
    --shadow: 0 18px 45px rgba(23, 32, 29, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header,
.site-footer,
main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--green);
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.top-nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.top-nav a:hover,
.pair-card:hover,
.amount-grid a:hover {
    border-color: rgba(30, 123, 85, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.tool-shell {
    min-height: 430px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    align-items: stretch;
    padding: 42px;
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(20, 33, 31, 0.92), rgba(30, 83, 70, 0.88)),
        url("data:image/svg+xml,%3Csvg width='900' height='520' viewBox='0 0 900 520' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='1'%3E%3Cpath d='M40 90h820M40 180h820M40 270h820M40 360h820M40 450h820'/%3E%3Cpath d='M120 45v430M260 45v430M400 45v430M540 45v430M680 45v430M820 45v430'/%3E%3C/g%3E%3Cpath d='M70 385c88-72 158-90 222-52 56 34 93 58 152 18 74-51 108-163 202-159 64 3 103 64 181 33' fill='none' stroke='%23e9b45b' stroke-width='8' stroke-linecap='round'/%3E%3Cpath d='M70 309c97 21 148-32 211-95 60-60 133-84 211-39 71 42 126 137 256 86' fill='none' stroke='%237bd0aa' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: cover;
    color: #fff;
}

.tool-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: #cde9dc;
    font-weight: 700;
    letter-spacing: 0;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    max-width: 780px;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.04;
}

h2 {
    font-size: 24px;
}

.lead {
    max-width: 760px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 20px;
}

.lead strong {
    color: #ffffff;
}

.converter {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    gap: 14px;
    align-self: center;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    box-shadow: var(--shadow);
}

.converter label:first-child,
.primary-button,
.live-result {
    grid-column: 1 / -1;
}

.converter label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.converter input,
.converter select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.converter input {
    font-size: 28px;
    font-weight: 800;
}

.swap-button,
.primary-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.swap-button {
    align-self: end;
    min-height: 48px;
    background: #eef4ef;
    color: var(--green-dark);
    font-size: 24px;
}

.primary-button {
    min-height: 50px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
}

.primary-button:hover {
    background: var(--green-dark);
}

.live-result {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff8ed;
    color: var(--amber);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
}

.rate-meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: -4px 0 0;
    color: #6b746e;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

.rate-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ef;
    white-space: nowrap;
}

.section {
    margin-top: 30px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.pair-grid,
.amount-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pair-card,
.amount-grid a {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.pair-card span,
.amount-grid span {
    color: var(--muted);
    font-size: 14px;
}

.pair-card strong,
.amount-grid strong {
    color: var(--green-dark);
    font-size: 17px;
    overflow-wrap: anywhere;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

th,
td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
}

td a {
    color: var(--blue);
    font-weight: 700;
}

.bank-rate-table {
    min-width: 860px;
}

.bank-rate-table th,
.bank-rate-table td {
    text-align: right;
    white-space: nowrap;
}

.bank-rate-table th:first-child,
.bank-rate-table td:first-child {
    text-align: left;
}

.table-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.table-note a {
    color: var(--blue);
    font-weight: 700;
}

.empty-note {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
    color: var(--muted);
}

.bank-rate-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.bank-rate-cards div {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.bank-rate-cards span {
    color: var(--muted);
    font-size: 14px;
}

.bank-rate-cards strong {
    color: var(--green-dark);
    font-size: 22px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.home-link-blocks {
    display: grid;
    gap: 28px;
}

.home-link-block + .home-link-block {
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.compact-head {
    align-items: center;
    margin-bottom: 16px;
}

.compact-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.content-icon {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.lookup-grid,
.article-link-grid {
    display: grid;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.lookup-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lookup-grid a,
.article-link-grid a {
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: #4f5e58;
    background: #fff;
    font-size: 17px;
    line-height: 1.35;
}

.lookup-grid a {
    justify-content: center;
    text-align: center;
}

.article-link-grid a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lookup-grid a:hover,
.article-link-grid a:hover {
    color: var(--green-dark);
    background: #fbfcfb;
}

.currency-focus {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    background: var(--surface-strong);
    color: #fff;
}

.currency-focus .lead {
    color: rgba(255, 255, 255, 0.78);
}

.currency-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.currency-symbol {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 48px;
    font-weight: 800;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 28px 0 34px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .tool-shell {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .pair-grid,
    .amount-grid,
    .bank-rate-cards,
    .lookup-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .article-link-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header,
    .site-footer,
    main {
        width: min(100% - 20px, 1180px);
    }

    .tool-shell,
    .section {
        padding: 20px;
    }

    h1 {
        font-size: 34px;
    }

    .lead {
        font-size: 17px;
    }

    .converter {
        grid-template-columns: 1fr;
    }

    .swap-button {
        min-height: 42px;
    }

    .pair-grid,
    .amount-grid,
    .bank-rate-cards,
    .lookup-grid,
    .article-link-grid {
        grid-template-columns: 1fr;
    }

    .lookup-grid a {
        justify-content: flex-start;
        text-align: left;
    }

    .section-head,
    .currency-focus {
        align-items: flex-start;
        flex-direction: column;
    }

    .currency-symbol {
        width: 92px;
        height: 92px;
        font-size: 38px;
    }
}
