/* 汇率换算器样式
   双栏：左输入 340px，右结果自适应。多币种面板用 4 列网格，汇率表 26 行可编辑。 */

.tool-page .tool-container {
    max-width: 1200px;
}

/* style.css 里没有 .tool-title-wrapper，每个宽栏工具页都得自己写 */
.tool-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
}

.tool-title-wrapper i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-title-wrapper .tool-title {
    margin-bottom: 0;
    border-bottom: none;
}

.fx-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* ---------------- 左：输入面板 ---------------- */

.fx-panel {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.fx-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 14px;
}

.fx-panel-title i {
    color: var(--primary-color);
}

.fx-group {
    margin-bottom: 14px;
}

.fx-group:last-child {
    margin-bottom: 0;
}

.fx-field {
    margin-bottom: 10px;
}

.fx-field:last-child {
    margin-bottom: 0;
}

.fx-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.fx-field .form-input,
.fx-field .form-select {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
}

/* 源/目标货币之间的互换按钮：做成整行居中的小胶囊，比挤在两列中间更好点 */
.fx-swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 8px 0;
    padding: 7px 10px;
    font-size: 12px;
    font-family: inherit;
    color: var(--primary-color);
    background: var(--bg-white);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.fx-swap-btn:hover {
    background: #eaf4ff;
    border-style: solid;
}

.fx-swap-btn i {
    font-size: 14px;
}

.fx-hint {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 汇率来源状态条 */
.fx-status {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 11px;
    font-size: 12px;
    line-height: 1.6;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.fx-status i {
    font-size: 13px;
    margin-top: 1px;
    flex: 0 0 auto;
}

.fx-status.is-online {
    background: #f0f9eb;
    border-color: #c2e7b0;
    color: #38761d;
}

.fx-status.is-loading {
    background: #f4f8ff;
    border-color: #cfe2ff;
    color: #1a6fd4;
}

.fx-status.is-error {
    background: #fdf0ee;
    border-color: #f5c6c0;
    color: #c0392b;
}

/* 主按钮 */
.fx-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.fx-btn:hover {
    background: #1a6fd4;
}

.fx-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* 次要按钮 */
.fx-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.fx-btn-ghost:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 错误提示 */
.fx-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #c0392b;
    background: #fdf0ee;
    border: 1px solid #f5c6c0;
    border-left: 3px solid #e74c3c;
    border-radius: var(--radius-sm);
}

.fx-error.show {
    display: block;
}

/* ---------------- 右：结果区 ---------------- */

.fx-hero {
    padding: 22px 20px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #2d8cf0 0%, #1a6fd4 100%);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.fx-hero-label {
    font-size: 13px;
    opacity: .9;
    margin-bottom: 6px;
}

.fx-hero-value {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}

.fx-hero-value small {
    font-size: 16px;
    font-weight: 500;
    opacity: .85;
    margin-left: 4px;
}

.fx-hero-sub {
    margin-top: 8px;
    font-size: 12px;
    opacity: .88;
    line-height: 1.6;
}

.fx-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.fx-stat {
    padding: 12px 10px;
    text-align: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.fx-stat b {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.3;
    word-break: break-all;
}

.fx-stat span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.fx-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.fx-section-title i {
    color: var(--primary-color);
}

.fx-block {
    margin-bottom: 18px;
}

/* 多币种等值面板 */
.fx-many {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.fx-many-item {
    padding: 10px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.fx-many-item:hover {
    border-color: var(--primary-light);
}

.fx-many-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.fx-many-code b {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .02em;
}

.fx-many-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}

/* 汇率表 */
.fx-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    max-height: 420px;
    overflow-y: auto;
}

.fx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fx-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.fx-table tbody td {
    padding: 6px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.fx-table tbody tr:last-child td {
    border-bottom: none;
}

.fx-table tbody tr:hover {
    background: #f7fafd;
}

.fx-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.fx-name {
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 汇率输入框：看起来像普通文本，但可编辑，所以给个浅边框提示 */
.fx-rate-input {
    width: 100%;
    min-width: 90px;
    padding: 5px 8px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    text-align: right;
}

.fx-rate-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(45, 140, 240, .12);
}

/* 手动改过的行标黄，方便看出哪些不是参考汇率 */
.fx-table tr.is-edited .fx-rate-input {
    background: #fffbe6;
    border-color: #ffd591;
}

.fx-unit {
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.fx-note {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-muted);
    background: var(--bg-light);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.fx-note b {
    color: var(--text-primary);
}

.fx-note.is-warn {
    background: #fffbe6;
    border-left-color: #f5a623;
}

/* 速查表复用的类 */
.fx-quick {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.fx-quick thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.fx-quick tbody td {
    padding: 9px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.fx-quick tbody tr:last-child td {
    border-bottom: none;
}

.fx-quick td.num {
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: right;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
    .fx-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .fx-many {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fx-hero-value {
        font-size: 28px;
    }
}

@media (max-width: 560px) {
    .fx-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .fx-hero-value {
        font-size: 24px;
    }
}
