/* style.css */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    background-color: #f4f7f9; 
    color: #333; 
    margin: 0; 
    line-height: 1.6; 
}

.container { 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 20px; 
    background-color: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}

a { 
    color: #007bff; 
    text-decoration: none; 
}
a:hover { 
    text-decoration: underline; 
}

/* Header */
.main-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 15px; 
}
.main-header h1 { 
    margin: 0; 
    font-size: 1.8em; 
}
.main-header h1 a { 
    color: inherit; 
}
.lang-switcher a { 
    margin-left: 10px; 
    padding: 5px 10px; 
    border-radius: 5px; 
    color: #555; 
}
.lang-switcher a.active { 
    background-color: #007bff; 
    color: #fff; 
    font-weight: bold; 
}

h2 { 
    text-align: center; 
    color: #1a2533; 
    margin-top: 0; 
    margin-bottom: 30px;
}

/* 首页 */
.search-bar { 
    width: 100%; 
    box-sizing: border-box; 
    padding: 15px; 
    font-size: 1.2em; 
    margin-bottom: 30px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
}
.category-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 20px; 
}
.category-card { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
    background: #f8f9fa; 
    border: 1px solid #e9ecef; 
    border-radius: 8px; 
    transition: all 0.2s; 
    text-align: center; 
}
.category-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}
.category-icon { 
    font-size: 2.5em; 
    margin-bottom: 10px; 
}

/* 分类页 */
.converter-list { 
    list-style: none; 
    padding: 0; 
}
.converter-list li { 
    margin: 10px 0; 
}
.converter-list a { 
    display: block; 
    padding: 15px; 
    background: #f8f9fa; 
    border-radius: 5px; 
    font-size: 1.1em; 
}
.converter-list a:hover { 
    background: #e9ecef; 
}

/* 换算器页 */
.converter-form { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    margin-bottom: 30px; 
}
.input-group { 
    display: flex; 
    gap: 10px; 
}
.input-group input, .input-group select { 
    padding: 12px; 
    font-size: 1em; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
}
.input-group input { 
    flex-grow: 3; 
}
.input-group select { 
    flex-grow: 2; 
    background-color: #fff; 
}
input[readonly] { 
    background-color: #e9ecef; 
    cursor: not-allowed; 
}
.swap-button { 
    font-size: 1.8em; 
    cursor: pointer; 
    text-align: center; 
    color: #007bff; 
    user-select: none; 
}
.swap-button:hover { 
    opacity: 0.8; 
}
.result-table { 
    width: 100%; 
    margin-top: 20px; 
    border-collapse: collapse; 
}
.result-table th, .result-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}
.result-table th { 
    background-color: #f8f9fa; 
}
.result-table td:first-child { 
    font-weight: bold; 
    color: #333; 
}
.result-table td:last-child { 
    font-family: 'Courier New', Courier, monospace; 
    font-weight: bold; 
    color: #007bff; 
}

/* API 状态 */
.api-status {
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

/* ✨ 新增: 热门换算链接样式 ✨ */
.popular-conversions {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.popular-conversions h3 {
    text-align: left;
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #333;
}
.popular-conversions ul {
    list-style: none; /* 移除小黑点 */
    padding: 0;
    margin: 0;
    border: 1px solid #e9ecef; /* 给列表加上边框 */
    border-radius: 8px;
    overflow: hidden; /* 确保内部元素不会超出圆角 */
}
.popular-conversions li {
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef; /* 每个列表项之间的分隔线 */
}
.popular-conversions li:last-child {
    border-bottom: none; /* 最后一个列表项没有下边框 */
}
.popular-conversions li a {
    display: block; /* 让整个区域都可以点击 */
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}
.popular-conversions li a:hover {
    background-color: #f8f9fa; /* 鼠标悬停时有背景色变化 */
    color: #0056b3;
}
/* 使用 ::before 伪元素添加图标 */
.popular-conversions li a::before {
    content: '›'; /* 或者用 '›', '»' 等 */
    margin-right: 10px;
    color: #007bff; /* 图标颜色 */
    font-weight: bold;
}


/* 移动端适配 */
@media (max-width: 600px) {
    .popular-conversions ul {
        column-count: 1;
    }
    .main-header {
        flex-direction: column;
        gap: 15px;
    }
}


/* =============================================== */
/* ✨ STYLES FOR CUSTOM CALCULATOR PAGES ✨ */
/* =============================================== */

/* --- 通用计算器容器样式 --- */
.calculator-container { 
    padding: 20px; 
    background-color: #f9f9f9; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
}
.calculator-description { 
    margin-bottom: 20px; 
    font-style: italic; 
    color: #555; 
    text-align: center; 
}

/* --- 通用输入和按钮样式 --- */
.calculator-container input[type="number"], 
.calculator-container select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px; 
    font-size: 1em; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
}
.calculator-container button { 
    display: block; 
    width: 100%; 
    padding: 12px; 
    font-size: 1.1em; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    margin-top: 20px; 
    background-color: #007bff; /* 默认蓝色按钮 */
}
.calculator-container button:hover {
    opacity: 0.85;
}

/* --- 通用结果和信息框样式 --- */
.result-display { 
    margin-top: 20px; 
    padding: 15px; 
    background-color: #e9f5ff; 
    border: 1px solid #bde0ff; 
    border-radius: 5px; 
    text-align: center; 
}
.result-display h3 { 
    margin: 0 0 10px 0; 
    font-size: 1.1em; 
}
.result-display p { 
    margin: 0; 
    font-size: 1.5em; 
    font-weight: bold; 
    color: #0056b3; 
}
.info-box { 
    margin-top: 30px; 
    padding: 15px; 
    background-color: #fafafa; 
    border-left: 4px solid #007bff; 
    font-size: 0.9em; 
    color: #444; 
}
.info-box h4 { 
    margin: 0 0 10px; 
}

/* --- 特定布局样式 --- */
.unit-toggle { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 20px; 
    justify-content: center; 
    background: #eee; 
    padding: 10px; 
    border-radius: 5px; 
    cursor: pointer; 
}
.formula-display { 
    text-align: center; 
    margin-bottom: 20px; 
    padding: 10px; 
    background-color: #f0f0f0; 
    border-radius: 5px; 
    font-family: 'Courier New', Courier, monospace; 
    color: #333; 
}
.input-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
    margin-bottom: 15px;
}
.input-group-vertical { 
    display: flex; 
    flex-direction: column; 
    gap: 5px;
}
.input-group-vertical label { 
    font-weight: bold; 
    font-size: 0.9em; 
}

/* --- CBM计算器专属按钮颜色 --- */
#cbm-calc button {
    background-color: #28a745; /* 绿色按钮 */
}
#cbm-calc button:hover {
    background-color: #218838;
}

/* ✨ 新增: 搜索无结果提示样式 ✨ */
.no-results {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
}
.no-results h3 {
    margin: 0 0 10px;
    color: #495057;
}
.no-results p {
    margin: 0;
    color: #6c757d;
}


/* =============================================== */
/* ✨ STYLES FOR CONTENT & SEO SECTIONS ✨ */
/* =============================================== */

.content-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.content-section h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.content-section p, .content-section ul, .content-section li {
    line-height: 1.7;
    color: #444;
}

.content-section .formula-box {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #ddd;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item .faq-question {
    font-weight: bold;
    color: #0056b3;
    margin-bottom: 5px;
}