* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: #DDD6C2;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.header h1 {
    color: #2c3e50;
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 i {
    color: #3498db;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: #7f8c8d;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 左侧输入面板 */
.input-panel {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.input-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.panel-title {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.panel-title i {
    font-size: 1.5rem;
    background: #3498db;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 30px;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-label i {
    color: #3498db;
    width: 24px;
    font-size: 1.2rem;
}

/* HSK级别选择器 - 彩虹色设计 */
.hsk-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.hsk-level {
    flex: 1;
    min-width: 70px;
}

.hsk-level input[type="radio"] {
    display: none;
}

.hsk-level label {
    display: block;
    padding: 14px 8px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    border: 2px solid transparent;
    font-size: 1.1rem;
}

/* 不同HSK级别颜色 */
.hsk-level:nth-child(1) input[type="radio"]:checked + label { background: #ff7675; color: white; }
.hsk-level:nth-child(2) input[type="radio"]:checked + label { background: #fd79a8; color: white; }
.hsk-level:nth-child(3) input[type="radio"]:checked + label { background: #a29bfe; color: white; }
.hsk-level:nth-child(4) input[type="radio"]:checked + label { background: #74b9ff; color: white; }
.hsk-level:nth-child(5) input[type="radio"]:checked + label { background: #55efc4; color: #2d3436; }
.hsk-level:nth-child(6) input[type="radio"]:checked + label { background: #ffeaa7; color: #2d3436; }
.hsk-level:nth-child(7) input[type="radio"]:checked + label { background: #dfe6e9; color: #2d3436; }

.hsk-level input[type="radio"]:checked + label {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 输入框和文本域样式 */
.form-control {
    width: 100%;
    padding: 18px 22px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1.15rem;
    transition: all 0.3s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

/* 字数计数器 */
.char-counter {
    text-align: right;
    font-size: 0.95rem;
    color: #7f8c8d;
    margin-top: 10px;
}

.char-counter.warning {
    color: #e74c3c;
    font-weight: 600;
}

/* 单词标签输入 */
.word-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.word-tag {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 10px 18px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1565c0;
    box-shadow: 0 4px 10px rgba(21, 101, 192, 0.1);
    animation: tagAppear 0.3s ease;
}

@keyframes tagAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.word-tag .remove-tag {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    width: 24px;
    height: 24px;
    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);
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 22px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1c2833);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 右侧输出面板 */
.output-panel {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(46, 204, 113, 0.1);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
}


.font-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.font-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.font-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    background-color: #ccc;
    border-radius: 28px;
    transition: .4s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.font-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4dabf7, #228be6);
}

.font-toggle input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    min-width: 60px;
}

/* 悬停效果 */
.font-toggle:hover .toggle-slider {
    background-color: #b0b0b0;
}

.font-toggle:hover input:checked + .toggle-slider {
    background: linear-gradient(135deg, #339af0, #1c7ed6);
}



/* 在你的主题style.css或自定义CSS文件中 */
@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; 
}

@font-face {
    font-family: 'ToneOZ-Amanda';
    src: url('/wp-content/themes/neve-iputonghua/fonts/ToneOZ-Pinyin-Kai-Simplified.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@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: italic;
    font-display: swap;
}

.story-text-pinyin,
.story-text-pinyin *,
.story-text-pinyin p,
.story-text-pinyin span,
.story-text-pinyin div,
.story-text-pinyin h1,
.story-text-pinyin h2,
.story-text-pinyin h3,
.story-text-pinyin h4,
.story-text-pinyin h5,
.story-text-pinyin h6 {
    font-family: 'ToneOZ-Amanda', 'Microsoft YaHei', sans-serif;
    font-size: 28px;
    line-height: 1.6;
}


.output-title {
    font-size: 1.8rem;
    color: #2ecc71;
    display: flex;
    align-items: center;
    gap: 15px;
}

.output-title i {
    background: #2ecc71;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.word-count {
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 故事输出区域 */
.story-output {
    flex: 1;
    background: #fafafa;
    border-radius: 15px;
    padding: 30px;
    font-size: 1.2rem;
    line-height: 1.9;
    color: #2c3e50;
    overflow-y: auto;
    min-height: 450px;
    border: 2px dashed #e0e0e0;
    text-align: justify;
}

.story-output.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3c7;
    font-style: italic;
    text-align: center;
    font-size: 1.3rem;
    padding: 60px;
    flex-direction: column;
    gap: 20px;
}

.story-output.empty i {
    font-size: 4rem;
    opacity: 0.5;
}

/* 高亮显示用户输入的词汇 */
.highlight-word {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: bold;
    color: #f39c12;
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.2);
    margin: 0 2px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 60px 40px;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.action-btn {
    flex: 1;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.copy-btn {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(21, 101, 192, 0.2);
}

.download-btn {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.download-btn:hover {
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.2);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 60px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.footer p:first-child {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-panel, .output-panel {
        padding: 25px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .hsk-level label {
        padding: 12px 5px;
        font-size: 1rem;
    }
    
    .submit-btn {
        padding: 18px;
        font-size: 1.2rem;
    }
}

/* 示例故事样式 */
.sample-story {
    font-size: 1.2rem;
    line-height: 1.9;
    text-align: justify;
}

/* 滚动条样式 */
.story-output::-webkit-scrollbar {
    width: 8px;
}

.story-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.story-output::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.story-output::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* markdown 格式 */
.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: 0 auto;
    padding: 45px;
    background-color: #f6f8fa;
    border-radius: 10px;
}

/* 故事定制样式 */
.story-container {
    font-family: 'SimSun', 'STSong', serif;
    line-height: 1.8;
    color: #333;
}

.story-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.story-content {
    font-size: 18px;
    text-indent: 2em;
}

.story-content p {
    margin-bottom: 1.2em;
}

/* 对话样式 */
.dialogue {
    color: #2980b9;
    margin-left: 3em;
    font-style: italic;
}

/* 强调文本 */
.highlight {
    color: #e74c3c;
    font-weight: bold;
}