/* 字典首页专用样式 */

/* 什么是字典模块 */
.what-is-dictionary {
    margin-top: 30px;
}

.dictionary-intro {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.intro-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.intro-title .title-icon {
    font-size: 16px;
}

.intro-content p {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: justify;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

/* ol li 缩进两个字 */
.intro-content ol {
    padding-left: 2em;
}

.intro-content ol li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.intro-link {
    color: #e74c3c;
    text-decoration: none;
    border-bottom: 1px dotted #e74c3c;
    transition: all 0.2s;
}

.intro-link:hover {
    color: #c0392b;
}

/* 成语按钮颜色 */
.feature-btn.red {
    background: linear-gradient(135deg, #c9302c 0%, #a02622 100%);
}

.feature-btn.blue {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.feature-btn.green {
    background: linear-gradient(135deg, #7cb342 0%, #689f38 100%);
}

/* 热门成语推荐 */
.hot-chengyu-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);

    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);

}

.chengyu-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.chengyu-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.chengyu-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.chengyu-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.chengyu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chengyu-item:hover {
    background: rgba(44, 95, 65, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chengyu-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* 成语出处模块 */
.chengyu-chuchu-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);

    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);

}

.chuchu-category {
    margin-bottom: 25px;
}

.chuchu-category:last-child {
    margin-bottom: 0;
}

.chuchu-category-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 auto 20px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(44, 95, 65, 0.25);
    position: relative;
}

.chuchu-category-title::before,
.chuchu-category-title::after {
    content: '';
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    flex: none;
}

.chuchu-category {
    text-align: center;
}

.chuchu-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /*justify-content: center;*/
}

.chuchu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.chuchu-item:hover {
    background: rgba(44, 95, 65, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}


/* 指定位置查询成语 */
.chengyu-position-search {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.position-input {
    width: 45px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.position-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 95, 65, 0.1);
}

.position-input::placeholder {
    color: #bbb;
    font-size: 12px;
}

.position-search-btn {
    height: 36px;
    padding: 0 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.position-search-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* 趣味叠字模块 */
.fun-diezi-section {
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.section-header .section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.more-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.diezi-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
}

.diezi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    background: var(--card-bg);
    position: relative;
    min-height: 60px;
    transition: all 0.2s ease;
}

.diezi-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.diezi-pinyin {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
}

.diezi-char {
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diezi-char:hover {
    color: var(--primary-color);
}

/* diezi-char 下的图片兼容 */
.diezi-char img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.diezi-tag {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
}

/* 字典功能导航 */
.zi-feature-nav {
    background: linear-gradient(135deg, #f8faf9 0%, #e8f5e9 100%);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
    padding: 0 25px;
}

.feature-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 14px 10px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.feature-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.feature-btn .btn-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.feature-btn .btn-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.feature-intro {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.feature-intro p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.feature-intro p:last-child {
    margin-bottom: 0;
}

/* 首页布局样式 */
.zi-index-main {
    display: flex;
    gap: 24px;
    padding: 24px 0;
}

.zi-index-left {
    flex: 1;
    min-height: 600px;
}

.zi-index-right {
    width: 300px;
    flex-shrink: 0;
}

/* 左侧内容区域占位 */
.zi-index-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    min-height: 500px;
}

.zi-index-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .zi-index-main {
        flex-direction: column;
    }

    .zi-index-right {
        width: 100%;
    }

    .feature-buttons {
        gap: 8px;
        padding: 0 20px;
    }

    .feature-btn {
        flex: 1;
        min-width: 0;
        padding: 12px 8px;
        font-size: 14px;
    }

    .feature-btn .btn-icon {
        font-size: 20px;
    }

    .feature-btn .btn-text {
        font-size: 12px;
    }

    .feature-intro {
        padding: 15px 20px;
    }

    .feature-intro p {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .diezi-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 768px) {
    .chengyu-position-search {
        justify-content: center;
    }

    .position-input {
        width: 45px;
        height: 36px;
        font-size: 14px;
    }

    .position-search-btn {
        height: 36px;
        padding: 0 14px;
        font-size: 13px;
    }

    .chengyu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .chengyu-item {
        font-size: 13px;
        padding: 8px 6px;
    }

    .diezi-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .fun-diezi-section {
        padding: 15px;
    }

    .section-header .section-title {
        font-size: 16px;
    }

    .diezi-char {
        font-size: 18px;
    }

    .diezi-char img {
        width: 18px;
        height: 18px;
    }

    .what-is-dictionary {
        margin-top: 20px;
    }

    .dictionary-intro {
        padding: 20px;
    }

    .intro-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .intro-content p {
        font-size: 13px;
        line-height: 1.8;
    }
}

@media (max-width: 480px) {
    .zi-feature-nav {
        padding: 20px 0;
    }

    .feature-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
        padding: 0 15px;
    }

    .feature-btn {
        flex: 0 0 calc(50% - 5px);
        min-width: 0;
        padding: 12px 8px;
        white-space: nowrap;
        font-size: 14px;
    }

    .feature-btn .btn-icon {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .feature-btn .btn-text {
        font-size: 11px;
        white-space: nowrap;
    }

    /* 指定位置查询弹窗手机端适配 */
    .position-modal {
        width: 92%;
        max-width: none;
    }

    .position-modal-body {
        padding: 20px 15px;
    }

    .position-option-input {
        width: 40px;
        height: 36px;
        font-size: 13px;
    }

    .position-search-btn {
        height: 36px;
        padding: 0 15px;
        font-size: 13px;
    }

    .hot-chengyu-section {
        padding: 15px;
    }

    .chengyu-section-title {
        font-size: 16px;
    }

    .chengyu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .chengyu-item {
        font-size: 12px;
        padding: 8px 4px;
    }

    .chengyu-chuchu-section {
        padding: 15px;
    }

    .chuchu-category-title {
        font-size: 14px;
    }

    .chuchu-category-title::before,
    .chuchu-category-title::after {
        width: 5px;
        height: 5px;
        flex: none;
    }

    .chuchu-item {
        padding: 6px 12px;
        font-size: 12px;
    }

    .diezi-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .diezi-item {
        min-height: 50px;
        padding: 6px 2px;
    }

    .diezi-pinyin {
        font-size: 10px;
    }

    .diezi-char {
        font-size: 16px;
    }

    .diezi-char img {
        width: 16px;
        height: 16px;
    }
}

/* ==================== 指定位置查询弹窗样式 ==================== */
.position-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.position-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.position-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: all 0.3s;
}

.position-modal-overlay.show .position-modal {
    transform: scale(1);
}

.position-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.position-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.position-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.position-modal-close:hover {
    background: #f5f5f5;
    color: #666;
}

.position-modal-body {
    padding: 40px 30px;
}

.position-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.position-option-input {
    width: 70px;
    height: 56px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    color: #333;
    outline: none;
    transition: all 0.2s;
}

.position-option-input:focus {
    border-color: var(--primary-color, #2c5f41);
    box-shadow: 0 0 0 3px rgba(44, 95, 65, 0.15);
}

.position-option-input::placeholder {
    color: #999;
    font-size: 14px;
}

.position-search-btn-index {
    height: 56px;
    padding: 0 32px;
    background: var(--primary-color, #2c5f41);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.position-search-btn-index:hover {
    opacity: 0.9;
}

/* 指定位置查询弹窗手机端适配 */
@media (max-width: 768px) {
    .position-modal {
        width: 92%;
        max-width: none;
        border-radius: 10px;
    }

    .position-modal-header {
        padding: 15px 20px;
    }

    .position-modal-title {
        font-size: 17px;
    }

    .position-modal-close {
        font-size: 20px;
        width: 34px;
        height: 34px;
    }

    .position-modal-body {
        padding: 25px 20px;
    }

    .position-options {
        gap: 12px;
    }

    .position-option-input {
        width: 56px;
        height: 48px;
        font-size: 18px;
        border-radius: 6px;
    }

    .position-option-input::placeholder {
        font-size: 13px;
    }

    .position-search-btn-index {
        height: 48px;
        padding: 0 24px;
        font-size: 16px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .position-modal {
        width: 94%;
    }

    .position-modal-header {
        padding: 12px 16px;
    }

    .position-modal-title {
        font-size: 15px;
    }

    .position-modal-close {
        font-size: 18px;
        width: 30px;
        height: 30px;
    }

    .position-modal-body {
        padding: 20px 16px;
    }

    .position-options {
        gap: 10px;
    }

    .position-option-input {
        width: 50px;
        height: 44px;
        font-size: 16px;
    }

    .position-option-input::placeholder {
        font-size: 12px;
    }

    .position-search-btn-index {
        height: 44px;
        padding: 0 20px;
        font-size: 15px;
    }
}
