/* ============================================================
   汇率查询网 - 主样式表
   设计风格：参照 ip.cn 实用工具风格 - 简洁、专业、清晰
   ============================================================ */

/* ------------- CSS Reset & Base ------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #f5f6f8;
    min-width: 320px;
    line-height: 1.6;
}

a {
    color: #1a6eb5;
    text-decoration: none;
}
a:hover {
    color: #e6550d;
    text-decoration: underline;
}

img { max-width: 100%; height: auto; }

/* ------------- 顶部导航 header ------------- */
.site-header {
    background: #1b3a5c;
    border-bottom: 3px solid #e6550d;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.logo:hover {
    color: #ffd04d;
    text-decoration: none;
}
.logo-icon {
    color: #ffd04d;
    font-size: 1.4rem;
}
.main-nav {
    display: flex;
    gap: 0;
}
.main-nav a {
    color: #c5d5e6;
    padding: 0 18px;
    line-height: 54px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.main-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.main-nav a.active {
    color: #ffd04d;
    background: rgba(255,255,255,0.06);
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
}

/* ------------- 面包屑 breadcrumb ------------- */
.breadcrumb {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}
.breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: #888;
}
.breadcrumb-inner a {
    color: #1a6eb5;
}
.breadcrumb-inner .sep {
    margin: 0 8px;
    color: #ccc;
}

/* ------------- 主内容区 ------------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ------------- 工具框 tool-box ------------- */
.tool-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 24px 28px;
    margin-bottom: 20px;
}
.tool-title {
    font-size: 1.35rem;
    color: #1b3a5c;
    margin-bottom: 6px;
    font-weight: 700;
}
.tool-desc {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 22px;
    line-height: 1.8;
}

/* 转换表单 */
.converter-form {
    background: #f9fafb;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 20px;
}
.form-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}
.form-input {
    width: 140px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-input:focus {
    border-color: #1a6eb5;
    box-shadow: 0 0 0 2px rgba(26,110,181,0.1);
}
.form-select {
    height: 40px;
    padding: 0 30px 0 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #333;
    outline: none;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 170px;
}
.form-select:focus {
    border-color: #1a6eb5;
    box-shadow: 0 0 0 2px rgba(26,110,181,0.1);
}

.swap-col {
    display: flex;
    align-items: flex-end;
    padding-bottom: 4px;
}
.swap-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #e6550d;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.swap-btn:hover {
    background: #e6550d;
    color: #fff;
    border-color: #e6550d;
}

.btn-col {
    display: flex;
    align-items: flex-end;
}
.btn-query {
    height: 40px;
    padding: 0 32px;
    background: #e6550d;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-query:hover {
    background: #cc4a0a;
}

/* 结果框 */
.result-box {
    margin-top: 20px;
    padding: 20px;
    background: #f0f7ff;
    border: 1px solid #cce0f5;
    border-radius: 4px;
    display: none;
}
.result-box.show {
    display: block;
}
.result-main {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1b3a5c;
    margin-bottom: 8px;
}
.result-amount {
    color: #e6550d;
}
.result-equals {
    color: #999;
    margin: 0 8px;
}
.result-to-amount {
    color: #e6550d;
    font-size: 1.5rem;
}
.result-rate {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 6px;
}
.result-rate strong {
    color: #1a6eb5;
}
.result-inverse {
    display: block;
    color: #999;
    font-size: 0.82rem;
    margin-top: 4px;
}
.result-time {
    font-size: 0.78rem;
    color: #aaa;
}

/* ------------- 常见币种汇率表 common-rates ------------- */
.common-rates {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px 28px;
    margin-bottom: 20px;
}
.section-title {
    font-size: 1.05rem;
    color: #1b3a5c;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6550d;
    font-weight: 700;
}
.table-wrapper {
    overflow-x: auto;
}
.rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.rate-table th {
    background: #f0f3f7;
    color: #555;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}
.rate-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}
.rate-table tbody tr:hover {
    background: #f8fafc;
}
.rate-table .currency-link {
    color: #1a6eb5;
    cursor: pointer;
    font-weight: 500;
}
.rate-table .currency-link:hover {
    color: #e6550d;
}
.rate-table .rate-val {
    color: #e6550d;
    font-weight: 600;
    font-family: "Consolas", "Monaco", monospace;
}
.rate-table .rate-reverse {
    color: #1a6eb5;
    font-family: "Consolas", "Monaco", monospace;
}
.rate-table .loading-cell {
    text-align: center;
    color: #999;
    padding: 24px;
}

.quick-links {
    margin-top: 14px;
    display: flex;
    gap: 16px;
}
.quick-link {
    font-size: 0.85rem;
    color: #1a6eb5;
    padding: 4px 12px;
    border: 1px solid #cce0f5;
    border-radius: 3px;
    background: #f7fafd;
}
.quick-link:hover {
    background: #e6550d;
    color: #fff;
    border-color: #e6550d;
    text-decoration: none;
}

/* ------------- 最近汇率查询 recent-queries ------------- */
.recent-queries {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px 28px;
    margin-bottom: 20px;
}
.query-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.query-tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #1a6eb5;
    background: #f5f8fb;
    border: 1px solid #dde8f3;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.query-tag:hover {
    background: #1a6eb5;
    color: #fff;
    border-color: #1a6eb5;
    text-decoration: none;
}

/* ------------- 热门货币对卡片 ------------- */
.section-sub {
    font-size: 0.85rem;
    color: #888;
    margin: -8px 0 16px;
}
.hot-pairs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.hot-pair-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fafcff 0%, #f5f8fb 100%);
    border: 1px solid #dde8f3;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    position: relative;
    transition: all 0.2s;
}
.hot-pair-card:hover {
    background: #fff4e6;
    border-color: #e6550d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(230,85,13,0.15);
    text-decoration: none;
}
.hpc-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.hpc-flag { font-size: 1.6rem; line-height: 1; }
.hpc-text { display: flex; flex-direction: column; }
.hpc-name { font-size: 0.95rem; font-weight: 600; color: #222; }
.hpc-code { font-size: 0.75rem; color: #888; }
.hpc-mid { font-size: 1.2rem; color: #e6550d; font-weight: 700; }
.hpc-right { text-align: right; }
.hpc-rate { font-size: 1.05rem; font-weight: 700; color: #e6550d; }
.hpc-sub { font-size: 0.7rem; color: #999; margin-top: 2px; }
.hpc-go {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: #1a6eb5;
    opacity: 0;
    transition: opacity 0.2s;
}
.hot-pair-card:hover .hpc-go { opacity: 1; }

.hot-pairs-reverse { margin-top: 10px; }
.hot-reverse-title { font-size: 0.85rem; color: #666; margin-bottom: 8px; }
.hot-reverse-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-reverse-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    color: #444;
    background: #fff;
    border: 1px solid #e0e6ec;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.15s;
}
.hot-reverse-tag:hover {
    background: #e6550d;
    color: #fff;
    border-color: #e6550d;
    text-decoration: none;
}
.hpr-flag { font-size: 1rem; }
.hot-block-title {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .hot-pairs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .hot-pairs-grid { grid-template-columns: 1fr; }
}

/* ------------- 精确金额速查链接 ------------- */
.deep-link-box {
    margin: 10px auto;
    max-width: 860px;
    padding: 12px 18px;
    background: #fdf6f0;
    border: 1px solid #f0c08a;
    border-radius: 6px;
}
.deep-link-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.deep-link-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e6550d;
    white-space: nowrap;
}
.deep-link-desc {
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
}
.deep-link-input {
    width: 110px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}
.deep-link-input:focus {
    border-color: #e6550d;
    outline: none;
    box-shadow: 0 0 0 2px rgba(230,85,13,0.15);
}
.btn-deep-link {
    padding: 6px 16px;
    background: #e6550d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-deep-link:hover { background: #c94a0a; }
.deep-link-url {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1a6eb5;
    font-size: 0.85rem;
}
.deep-link-url:hover { color: #e6550d; text-decoration: underline; }
.deep-link-url code {
    background: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.82rem;
    border: 1px dashed #ddd;
}
.deep-link-placeholder {
    font-size: 0.8rem;
    color: #bbb;
}
.btn-copy {
    padding: 4px 12px;
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.btn-copy:hover { border-color: #e6550d; color: #e6550d; }

@media (max-width: 768px) {
    .deep-link-inner { flex-direction: column; align-items: flex-start; }
    .deep-link-input { width: 100%; }
}

/* ------------- 常用工具 common-tools ------------- */
.common-tools {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px 28px;
    margin-bottom: 20px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1px;
    background: #eee;
}
.tool-item {
    display: block;
    padding: 12px 16px;
    background: #fff;
    color: #555;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}
.tool-item:hover {
    background: #f0f7ff;
    color: #1a6eb5;
    text-decoration: none;
}

/* ------------- 页脚 footer ------------- */
.site-footer {
    background: #1b3a5c;
    color: #96aabd;
    padding: 28px 20px;
    margin-top: 40px;
    font-size: 0.82rem;
    text-align: center;
    line-height: 2;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-links a {
    color: #c5d5e6;
}
.footer-links a:hover {
    color: #ffd04d;
}
.footer-info {
    margin: 8px 0;
}
.footer-copy {
    color: #6d8599;
}

/* ------------- Loading spinner ------------- */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top: 2px solid #e6550d;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------- 响应式设计 ------------- */
@media (max-width: 768px) {
    .header-inner {
        height: 48px;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 54px;
        left: 0;
        right: 0;
        background: #1b3a5c;
        flex-direction: column;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .main-nav.open {
        display: flex;
    }
    .main-nav a {
        line-height: 44px;
        padding: 0 20px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .mobile-menu-btn {
        display: block;
    }

    .tool-box,
    .common-rates,
    .recent-queries,
    .common-tools {
        padding: 16px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    .form-input {
        width: 100%;
    }
    .form-select {
        width: 100%;
        min-width: 0;
    }
    .swap-col {
        justify-content: center;
        padding: 4px 0;
    }
    .swap-btn {
        transform: rotate(90deg);
    }
    .btn-col {
        align-items: stretch;
    }
    .btn-query {
        width: 100%;
    }

    .result-main {
        font-size: 1.1rem;
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .tool-item {
        font-size: 0.8rem;
        padding: 10px 8px;
    }

    .rate-table {
        font-size: 0.78rem;
    }
    .rate-table th,
    .rate-table td {
        padding: 7px 8px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content {
        padding: 10px;
    }
    .tool-title {
        font-size: 1.15rem;
    }
}

/* ============================================================
   内链模块 & 目录页样式（SEO内链核心）
   ============================================================ */
.internal-links {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 18px 24px;
    margin-bottom: 16px;
}
.internal-links .section-title {
    font-size: 0.98rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.amount-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.amount-link {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.82rem;
    color: #1a6eb5;
    background: #f5f8fb;
    border: 1px solid #dde8f3;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.amount-link:hover {
    background: #e6550d;
    color: #fff;
    border-color: #e6550d;
    text-decoration: none;
}

/* 目录页专属 */
.page-huilv-index .tool-box {
    margin-bottom: 16px;
}
.page-huilv-index .internal-links .section-title {
    font-size: 1rem;
    color: #1b3a5c;
}

@media (max-width: 768px) {
    .internal-links {
        padding: 14px 16px;
    }
    .amount-link {
        font-size: 0.78rem;
        padding: 4px 10px;
    }
}

/* ============================================================
   金额递增导航（SEO连续抓取链）
   ============================================================ */
.amount-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pager-prev,
.pager-next {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: #1a6eb5;
    background: #f5f8fb;
    border: 1px solid #dde8f3;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.pager-prev:hover,
.pager-next:hover {
    background: #e6550d;
    color: #fff;
    border-color: #e6550d;
    text-decoration: none;
}
.pager-current {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}
.pager-disabled {
    color: #ccc;
    background: #f9f9f9;
    border-color: #eee;
    cursor: not-allowed;
}
.pager-disabled:hover {
    color: #ccc;
    background: #f9f9f9;
    border-color: #eee;
}
.amount-link-current {
    background: #e6550d !important;
    color: #fff !important;
    border-color: #e6550d !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    .amount-pager {
        padding: 10px 14px;
    }
    .pager-prev,
    .pager-next {
        font-size: 0.78rem;
        padding: 5px 12px;
    }
    .pager-current {
        order: -1;
        width: 100%;
        text-align: center;
    }
}
