/* 基于story-gen.css的修改 */

/* 1. 修改头部标题颜色 */
.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.header h1 i {
    color: #9b59b6;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* 2. 修改面板标题颜色 */
.input-panel .panel-title {
    color: #9b59b6;
}

.input-panel .panel-title i {
    background: #9b59b6;
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

.output-panel .output-title {
    color: #9b59b6;
}

.output-panel .output-title i {
    background: #9b59b6;
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

/* 3. 调整HSK级别选择器为紧凑设计 */
.hsk-levels {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.hsk-level label {
    padding: 12px 5px;
    font-size: 1rem;
    border-radius: 10px;
}

/* HSK级别颜色调整为紫色系 */
.hsk-level:nth-child(1) label { background: #f9e3ff; color: #9b59b6; }
.hsk-level:nth-child(2) label { background: #f0d6ff; color: #9b59b6; }
.hsk-level:nth-child(3) label { background: #e6c9ff; color: #9b59b6; }
.hsk-level:nth-child(4) label { background: #dbbdff; color: #9b59b6; }
.hsk-level:nth-child(5) label { background: #d1b0ff; color: #9b59b6; }
.hsk-level:nth-child(6) label { background: #c6a3ff; color: #9b59b6; }

.hsk-level:nth-child(1) input[type="radio"]:checked + label { background: #9b59b6; color: white; }
.hsk-level:nth-child(2) input[type="radio"]:checked + label { background: #8e44ad; color: white; }
.hsk-level:nth-child(3) input[type="radio"]:checked + label { background: #8144a5; color: white; }
.hsk-level:nth-child(4) input[type="radio"]:checked + label { background: #74349d; color: white; }
.hsk-level:nth-child(5) input[type="radio"]:checked + label { background: #672495; color: white; }
.hsk-level:nth-child(6) input[type="radio"]:checked + label { background: #5a148d; color: white; }

/* 4. 调整单词标签样式 */
.word-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.word-tag {
    background: linear-gradient(135deg, #e8daef, #d7bde2);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #6c3483;
    box-shadow: 0 3px 8px rgba(155, 89, 182, 0.2);
    border: 2px solid #c39bd3;
}

.word-tag .remove-tag {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.word-tag .remove-tag:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* 5. 调整输入框样式 */
.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #9b59b6;
    background: white;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.15);
}

/* 6. 调整提交按钮颜色 */
.submit-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 10px 25px rgba(155, 89, 182, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #732d91);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(155, 89, 182, 0.4);
}

/* 7. 调整输出区域样式 */
#sentence-output {
    flex: 1;
    background: #fafafa;
    border-radius: 15px;
    padding: 30px;
    font-size: 1.8rem;
    line-height: 1.6;
    color: #2c3e50;
    overflow-y: auto;
    min-height: 250px;
    border: 2px dashed #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'SimSun', 'STSong', serif;
}

#sentence-output.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3c7;
    font-style: italic;
    text-align: center;
    font-size: 1.5rem;
    padding: 40px;
    flex-direction: column;
    gap: 15px;
}

/* 8. 高亮显示关键词 */
.highlight-word {
    background: linear-gradient(135deg, #e8daef, #d7bde2);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: bold;
    color: #8e44ad;
    box-shadow: 0 3px 8px rgba(142, 68, 173, 0.2);
    margin: 0 3px;
    border: 2px solid #c39bd3;
}

/* 9. 拼音字体定义 - 确保与WordPress主题一致 */
@font-face {
    font-family: 'ToneOZ-Amanda';
    src: url('/wp-content/themes/neve-iputonghua/fonts/ToneOZ-Pinyin-Kai-Simplified.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 10. 拼音模式样式 - 提高优先级 */
.pinyin-mode #sentence-output,
.pinyin-mode #sentence-output .generated-sentence,
.pinyin-mode #sentence-output #sentence-text-output,
body.pinyin-mode #sentence-output,
body.pinyin-mode #sentence-output .generated-sentence,
body.pinyin-mode #sentence-output #sentence-text-output {
    font-family: 'ToneOZ-Amanda', 'Microsoft YaHei', sans-serif !important;
    font-size: 28px !important;
    line-height: 1.8 !important;
    color: #4a235a !important;
}

/* 11. 调整操作按钮 */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    align-items: center;
}

.font-toggle-container {
    flex: 0 0 auto;
    margin-right: auto;
}

/* 12. 响应式调整 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #sentence-output {
        font-size: 1.5rem;
        padding: 20px;
        min-height: 200px;
    }
    
    .pinyin-mode #sentence-output {
        font-size: 22px !important;
    }
    
    .hsk-levels {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .hsk-level label {
        padding: 10px 3px;
        font-size: 0.9rem;
    }
}