/* 百家姓页面样式 - 简洁版 */
* {
    box-sizing: border-box;
}

.baijiaxing-page {
    min-height: 100vh;
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
}

.baijiaxing-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.baijiaxing-main {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 面包屑导航 */
.baijiaxing-breadcrumb {
    padding: 15px 20px;
    background: white;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.baijiaxing-breadcrumb a {
    color: #4a90e2;
    text-decoration: none;
}

.baijiaxing-breadcrumb a:hover {
    color: #357abd;
}

.baijiaxing-breadcrumb .separator {
    margin: 0 8px;
    color: #ccc;
}

/* 页面头部 */
.baijiaxing-header {
    padding: 50px 20px;
    text-align: center;
    background: white;
    color: #333;
}

.baijiaxing-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.baijiaxing-desc {
    font-size: 18px;
    margin: 0;
    color: #666;
}

/* 内容区块 */
.baijiaxing-section {
    padding: 30px 20px;
    border-bottom: 1px solid #eee;
}

.baijiaxing-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.section-desc {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 14px;
}

/* 姓氏表格 */
.surname-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.surname-table {
    width: 100%;
    border-collapse: collapse;
}

.surname-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.surname-table tbody tr:last-child {
    border-bottom: none;
}

.surname-table tbody tr:hover {
    background: #f8f9fa;
}

.surname-table td {
    padding: 15px;
    vertical-align: top;
}

.surname-table .th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
    color: #333;
    border-right: 1px solid #e9ecef;
}

.surname-table td a {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    color: #4a90e2;
    text-decoration: none;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.surname-table td a:hover {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

/* 百家姓全文 */
.baijiaxing-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.baijiaxing-text {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 30px;
}

.baijiaxing-text li {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    break-inside: avoid;
    font-size: 14px;
}

/* 表单样式 */
.analysis-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.naming-form {
    display: grid;
    gap: 15px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row label {
    font-weight: 500;
    min-width: 60px;
    color: #333;
}

.form-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input[type="text"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.gender-select {
    display: flex;
    gap: 15px;
}

.gender-select label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    min-width: auto;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-submit {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-free-test {
    background: #4a90e2;
    color: white;
}

.btn-free-test:hover {
    background: #357abd;
}

.btn-premium-test {
    background: #28a745;
    color: white;
}

.btn-premium-test:hover {
    background: #218838;
}

/* 广告位 */
.ad-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* 推广信息区域样式增强 */
.quming-section .ad-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px 20px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.quming-section .ad-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #28a745, #ffc107, #dc3545);
    opacity: 0.6;
}

/* 广告内容样式 */
.ad-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.ad-container img:hover {
    transform: scale(1.02);
}

.ad-container a {
    display: inline-block;
    transition: all 0.3s ease;
}

.ad-container a:hover {
    transform: translateY(-2px);
}

/* 如果广告是文字形式 */
.ad-container .ad-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    line-height: 1.6;
    margin: 10px 0;
}

.ad-container .ad-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.ad-container .ad-link:hover {
    background: linear-gradient(135deg, #357abd 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    color: white;
}

/* 如果广告是多个广告并排显示 */
.ad-container .ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ad-container .ad-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ad-container .ad-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 今日热门起名样式 */
.hot-names-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.hot-name-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.hot-name-item:hover {
    background: linear-gradient(135deg, #fff8f0 0%, #f0f8ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.rank-4,
.rank-5 {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.name-info {
    flex: 1;
}

.name-link {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    text-decoration: none;
    font-family: '楷体', KaiTi, serif;
}

.name-link:hover {
    color: #4a90e2;
}

.name-stats {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 2px;
}

.trend-icon {
    font-size: 14px;
    opacity: 0.7;
}

/* 常用起名用字样式 */
.char-tabs {
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.char-tab-btns {
    display: flex;
    background: #e9ecef;
    border-radius: 6px 6px 0 0;
}

.char-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-weight: 500;
}

.char-tab-btn.active {
    background: #4a90e2;
    color: white;
}

.char-tab-btn:hover:not(.active) {
    background: rgba(74, 144, 226, 0.1);
}

.tab-icon {
    font-size: 16px;
}

.char-tab-content {
    display: none;
    padding: 20px;
}

.char-tab-content.active {
    display: block;
}

.char-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.char-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.char-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90e2, #28a745);
    border-radius: 6px 6px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.char-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.char-item:hover::before {
    opacity: 1;
}

.char-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.char-text {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    font-family: '楷体', KaiTi, serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.char-frequency {
    font-size: 12px;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.char-meaning {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.char-footer {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.char-note {
    margin: 0;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.char-note .icon-info {
    font-size: 14px;
}

/* 诗词起名样式 */
.poetry-names-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.poetry-name-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.poetry-name-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.name-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.poetry-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    font-family: '楷体', KaiTi, serif;
}

.poetry-source {
    font-size: 11px;
    background: #4a90e2;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.name-details {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.poem-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.poem-title {
    font-weight: 600;
    color: #333;
}

.poem-author {
    color: #888;
    font-size: 12px;
}

.poem-snippet {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    font-style: italic;
}

.poetry-footer {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.poetry-note {
    margin: 0;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* 名字网格样式 */
.names-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* 移除ul/li结构的默认样式，使用简单的标签显示 */
.names-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: contents;
}

.names-grid li {
    list-style: none;
    display: contents;
}

/* 统一的名字标签样式 - 胶囊形状 */
.names-grid a,
.names-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: white;
    color: #4a90e2;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #d6e3f0;
    font-size: 14px;
    font-weight: 500;
    min-width: 70px;
    height: 36px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.names-grid a:hover {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
    border-color: #4a90e2;
}

/* 为span元素添加不同样式 */
.names-grid span {
    background: #fff8e1;
    color: #f57c00;
    border-color: #ffcc02;
}

.names-grid span:hover {
    background: #f57c00;
    color: white;
    border-color: #f57c00;
}

/* 清除后端HTML的默认样式，让所有内容都变成inline */
.names-grid div,
.names-grid p,
.names-grid table,
.names-grid tbody,
.names-grid tr {
    display: contents;
}

.names-grid br {
    display: none;
}

/* 表格单元格也变成标签样式 */
.names-grid td,
.names-grid th {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: white;
    color: #4a90e2;
    border-radius: 20px;
    border: 1px solid #d6e3f0;
    font-size: 14px;
    font-weight: 500;
    min-width: 70px;
    height: 36px;
    margin: 0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.names-grid th {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
}

.names-grid td:hover,
.names-grid th:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .baijiaxing-container {
        padding: 10px;
    }

    .baijiaxing-section {
        padding: 20px 15px;
    }

    .baijiaxing-header {
        padding: 30px 15px;
    }

    .baijiaxing-title {
        font-size: 24px;
    }

    .baijiaxing-text {
        columns: 1;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row label {
        min-width: auto;
    }

    .btn-group {
        flex-direction: column;
    }

    .hot-names-container,
    .poetry-names-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .char-list {
        grid-template-columns: 1fr;
    }

    .char-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* 手机端名字网格优化 */
    .names-grid {
        padding: 15px;
        gap: 6px;
    }

    .names-grid a,
    .names-grid span,
    .names-grid td,
    .names-grid th {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 60px;
        height: 32px;
    }

    /* 移动端广告位优化 */
    .quming-section .ad-container {
        padding: 20px 15px;
    }

    .ad-container .ad-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ad-container .ad-link {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .surname-table td {
        padding: 10px;
    }

    .surname-table td a {
        font-size: 13px;
        padding: 3px 6px;
    }

    .hot-name-item {
        padding: 10px 12px;
    }

    .rank-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .name-link {
        font-size: 14px;
    }

    .poetry-name {
        font-size: 16px;
    }

    .char-text {
        font-size: 20px;
    }

    /* 超小屏幕名字网格优化 */
    .names-grid {
        padding: 10px;
        gap: 4px;
    }

    .names-grid a,
    .names-grid span,
    .names-grid td,
    .names-grid th {
        padding: 5px 10px;
        font-size: 12px;
        min-width: 50px;
        height: 28px;
    }

    /* 超小屏幕广告位优化 */
    .quming-section .ad-container {
        padding: 15px 10px;
    }

    .ad-container .ad-text {
        font-size: 14px;
    }

    .ad-container .ad-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .ad-container .ad-item {
        padding: 12px;
    }
}