/* 姓名分析页面样式 */
.xmfx-page {
    min-height: 100vh;
    background-color: #f5f5f5;
    padding: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.xmfx-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.xmfx-main {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 面包屑导航 */
.xmfx-breadcrumb {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e6ed;
    font-size: 14px;
}

.xmfx-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.xmfx-breadcrumb a:hover {
    color: #764ba2;
}

.xmfx-breadcrumb .separator {
    margin: 0 8px;
    color: #8e9aaf;
}

/* 头部样式 - 卡片风格 */
.xmfx-header {
    background: #f5f5f5;
    padding: 40px 30px;
    text-align: center;
}

.score-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin: 0;
    border: 1px solid #f0f0f0;
    box-sizing: border-box;
}

.score-number {
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ff6b6b;
    line-height: 1;
}

.score-desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.name-display {
    text-align: center;
}

.name-chars {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.name-char-circle {
    width: 50px;
    height: 50px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.name-info {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.wuxing-combo {
    display: inline-block;
    padding: 0 10px;
}

/* 通用部分样式 */
.xmfx-section {
    padding: 40px 30px;
    border-bottom: 1px solid #e0e6ed;
}

.xmfx-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
    display: inline-block;
}

.section-desc {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 20px;
}

/* 姓名基本信息卡片 */
.name-basic-info {
    margin-bottom: 20px;
}

.char-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 100%;
}

.char-card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.char-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.char-display {
    margin-bottom: 15px;
}

.char-with-grid {
    width: 80px;
    height: 80px;
    background-image: url('/common/static/qiming/img/word.png');
    background-size: 80px 80px;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 0 auto 15px auto;
    position: relative;
    line-height: 1;
}

.char-details {
    text-align: left;
}

.char-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.char-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 40px;
}

.detail-value {
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

/* 五行颜色 */
.wuxing-金 {
    color: #ffc107;
}

.wuxing-木 {
    color: #28a745;
}

.wuxing-水 {
    color: #007bff;
}

.wuxing-火 {
    color: #dc3545;
}

.wuxing-土 {
    color: #6f42c1;
}

/* 五格数理分析 */
.wuge-analysis {
    overflow-x: auto;
}

.wuge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    overflow: hidden;
}

.wuge-table th,
.wuge-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e6ed;
    vertical-align: top;
}

.wuge-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    text-align: center;
    font-size: 14px;
}

.wuge-table td:first-child {
    text-align: center;
    font-weight: bold;
    color: #333;
}

.wuge-table td:nth-child(2),
.wuge-table td:nth-child(3),
.wuge-table td:nth-child(4) {
    text-align: center;
}

.wuge-table td:last-child {
    text-align: left;
    max-width: 300px;
}

.wuge-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.wuge-element {
    font-size: 14px;
    color: #6c757d;
    margin-top: 2px;
}

.wuge-level {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
}

.wuge-level.good {
    background: #d4edda;
    color: #155724;
}

.wuge-level.bad {
    background: #f8d7da;
    color: #721c24;
}

.wuge-level.normal {
    background: #fff3cd;
    color: #856404;
}

.wuge-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* 三才配置分析 */
.sancai-analysis {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 25px;
}

.sancai-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.sancai-items {
    display: flex;
    gap: 30px;
}

.sancai-item {
    text-align: center;
}

.sancai-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.sancai-value {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 auto;
}

.sancai-result {
    text-align: center;
}

.result-text {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
}

.result-text.good {
    background: #d4edda;
    color: #155724;
}

.result-text.bad {
    background: #f8d7da;
    color: #721c24;
}

.result-text.normal {
    background: #fff3cd;
    color: #856404;
}

.sancai-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.sancai-content p {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

.sancai-content p:last-child {
    margin-bottom: 0;
}

/* 字义解析 */
.char-meaning-analysis {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 25px;
}

.name-meaning-intro {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.char-details {
    display: grid;
    gap: 20px;
}

.char-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e6ed;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.char-box {
    flex-shrink: 0;
}

.char-name {
    width: 80px;
    height: 80px;
    background: #fff;
    color: #333;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.char-name.highlight {
    border-color: #e74c3c;
    color: #e74c3c;
}

.char-info {
    flex: 1;
}

.char-basic {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.char-basic span {
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    color: #666;
    border: 1px solid #e0e6ed;
}

.char-meaning,
.char-source {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.char-meaning {
    color: #333;
    font-weight: 500;
}

.char-source {
    color: #666;
}

/* 标红样式 */
.red {
    color: #e74c3c !important;
    font-weight: bold;
}

/* 表单样式 - 参考index.html */
.analysis-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.naming-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.form-row {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row label {
    display: inline-block;
    width: 80px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
    flex-shrink: 0;
}

.form-row input[type="text"],
.form-row input[type="number"] {
    padding: 12px 15px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #fff;
}

.form-row input[type="text"] {
    width: 200px;
}

.form-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.gender-select {
    display: flex;
    gap: 20px;
}

.gender-select label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: auto;
    font-weight: normal;
    cursor: pointer;
}

.date-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.date-inputs input {
    width: 80px;
    padding: 12px 10px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    background: #fff;
}

.date-inputs input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.btn-group {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    width: 100%;
}

.btn-submit {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 免费测名按钮 */
.btn-free-test {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-free-test:hover {
    background: linear-gradient(135deg, #218838 0%, #1cb085 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* 专业测名按钮 */
.btn-premium-test {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-premium-test:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* 名字网格容器 - 简洁的标签布局 */
.names-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    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: #2c5aa0;
    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, #2c5aa0 0%, #1e4080 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(44, 90, 160, 0.3);
    border-color: #2c5aa0;
}

/* 为span元素添加不同样式 */
.names-grid span {
    background: #fff8e1;
    color: #f57c00;
    border-color: #ffcc02;
}

.names-grid span:hover {
    background: #f57c00;
    color: white;
    border-color: #f57c00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .xmfx-container {
        padding: 0 15px;
    }

    .xmfx-section {
        padding: 25px 20px;
    }

    .xmfx-header {
        padding: 20px 15px;
    }

    .score-card {
        padding: 30px 20px;
        margin: 0;
    }

    .score-number {
        font-size: 60px;
    }

    .score-desc {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .name-chars {
        gap: 8px;
        margin-bottom: 15px;
    }

    .name-char-circle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .name-info {
        font-size: 13px;
    }

    .sancai-display {
        flex-direction: column;
        text-align: center;
    }

    .sancai-items {
        justify-content: center;
    }

    .char-item {
        flex-direction: column;
        text-align: center;
    }

    .char-basic {
        justify-content: center;
    }

    .wuge-table {
        font-size: 12px;
    }

    .wuge-table th,
    .wuge-table td {
        padding: 10px 8px;
    }

    .char-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }

    .char-card {
        padding: 15px;
    }

    .char-with-grid {
        width: 60px;
        height: 60px;
        font-size: 28px;
        background-size: 60px 60px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-row label {
        width: auto;
        margin-bottom: 5px;
    }

    .form-row input[type="text"],
    .form-row input[type="number"] {
        width: 100%;
        min-width: auto;
    }

    .gender-select {
        gap: 15px;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .date-inputs {
        justify-content: space-between;
    }

    .date-inputs input {
        flex: 1;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .char-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .char-card {
        padding: 15px;
    }

    .char-with-grid {
        width: 50px;
        height: 50px;
        font-size: 24px;
        background-size: 50px 50px;
    }

    .char-detail-row {
        margin-bottom: 6px;
        padding: 3px 0;
    }

    .detail-label,
    .detail-value {
        font-size: 12px;
    }
}

/* 广告位样式 */
.ad-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.ad-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #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);
}

/* 今日热门起名样式 */
.hot-names-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hot-name-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    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, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 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: #667eea;
}

.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: 8px;
    overflow: hidden;
}

.char-tab-btns {
    display: flex;
    background: #e9ecef;
    border-radius: 8px 8px 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: #667eea;
    color: white;
}

.char-tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 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: 8px;
    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, #667eea, #764ba2);
    border-radius: 8px 8px 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: 8px;
    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: 8px;
}

.poetry-name-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    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: #667eea;
    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: 8px;
    text-align: center;
}

.poetry-note {
    margin: 0;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* 响应式设计增强 */
@media (max-width: 768px) {

    .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;
    }

    .ad-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .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;
    }

    .ad-container {
        padding: 10px;
    }
}