/* 成语查询工具专用样式 */

/* 查询区域 */
.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: stretch;
}

#idiom-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Microsoft YaHei', sans-serif;
}

#idiom-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#idiom-input::placeholder {
    color: #999;
}

.btn-primary, .btn-secondary {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 结果展示区 */
#result-container {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 基础信息卡片 */
.basic-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-left: 5px solid #4CAF50;
}

.idiom-name {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
}

.idiom-pinyin {
    font-size: 20px;
    color: #7f8c8d;
    margin: 0 0 20px 0;
    font-style: italic;
}

.idiom-definition {
    font-size: 18px;
    line-height: 1.8;
    color: #34495e;
    margin: 0;
    text-align: justify;
}

/* 扩展信息卡片 */
.extended-info {
    background: #f8f9fa;
}

.info-row {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    background: white;
    transition: background 0.3s;
}

.info-row:hover {
    background: #f0f8ff;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row strong {
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 90px;
}

.info-row strong i {
    color: #4CAF50;
    font-size: 14px;
}

.info-row span {
    color: #555;
    line-height: 1.8;
}

/* 成语故事卡片 */
.story-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.story-card h3 {
    color: white;
    font-size: 24px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-card h3 i {
    font-size: 22px;
}

.idiom-story {
    font-size: 16px;
    line-height: 2;
    text-align: justify;
    text-indent: 2em;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-section {
        flex-direction: column;
        gap: 10px;
    }

    #idiom-input {
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }

    .idiom-name {
        font-size: 28px;
    }

    .idiom-pinyin {
        font-size: 16px;
    }

    .idiom-definition {
        font-size: 16px;
    }

    .result-card {
        padding: 20px;
    }

    .info-row {
        padding: 10px;
    }

    .info-row strong {
        display: block;
        margin-bottom: 5px;
        min-width: auto;
    }

    .idiom-story {
        font-size: 15px;
        line-height: 1.8;
    }
}

@media (max-width: 480px) {
    .idiom-name {
        font-size: 24px;
    }

    .idiom-pinyin {
        font-size: 14px;
    }

    .idiom-definition {
        font-size: 15px;
    }

    .result-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .story-card h3 {
        font-size: 20px;
    }
}
