/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "SimKai", "楷体", "Microsoft YaHei", "SimHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.input-group {
    display: flex;
    margin-bottom: 15px;
}

#char-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

#char-input:focus {
    border-color: #3498db;
}

#search-btn {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#search-btn:hover {
    background-color: #2980b9;
}

.toolbar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.toolbar button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    height: 32px;
}

#small-font, #big-font {
    background-color: #2ecc71;
    color: white;
}

#small-font:hover, #big-font:hover {
    background-color: #27ae60;
}

#back-btn, #forward-btn {
    background-color: #95a5a6;
    color: white;
}

#back-btn:disabled, #forward-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#result-container {
    margin-bottom: 20px;
    min-height: 200px;
}

.char-level {
    text-align: center;
    font-size: 1.3rem;
    margin: 15px 0;
    color: #e74c3c;
    font-weight: bold;
}

.char-fonts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.char-font {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.char-font span {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.char-img {
    text-align: center;
    margin: 15px 0;
}

.char-img img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.char-video {
    text-align: center;
    margin: 15px 0;
}

.char-video video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background-color: #000;
}

.char-video p {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

.char-video a {
    color: #3498db;
    text-decoration: none;
}

.char-video a:hover {
    text-decoration: underline;
}

.section {
    margin: 15px 0;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* 折叠区域样式 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    font-weight: bold;
}

.section-content {
    padding: 12px 0;
    display: none; /* 默认隐藏 */
}

.section-content.expanded {
    display: block; /* 展开时显示 */
}
.char-link {
    color: #3498db;
    text-decoration: none;
    margin: 0 5px;
    cursor: pointer;
}

.char-link:hover {
    text-decoration: underline;
}

.external-dicts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.dict-btn {
    padding: 6px 12px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    height: 32px;
}

.dict-btn:hover {
    background-color: #8e44ad;
}

.no-result {
    text-align: center;
    padding: 15px;
    color: #e74c3c;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 移动设备样式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    #char-input, #search-btn {
        font-size: 0.9rem;
    }
    
    .toolbar button, .dict-btn {
        font-size: 0.8rem;
        padding: 5px 8px;
        height: 28px;
    }
    
    .char-fonts {
        gap: 8px;
    }
    
    .char-font div {
        font-size: 24px !important;
    }
    
    .section-title, .section-content {
        font-size: 0.9rem !important;
    }
    
    .char-level {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #char-input {
        border-radius: 4px;
        margin-bottom: 8px;
    }
    
    #search-btn {
        border-radius: 4px;
    }
    
    .toolbar, .external-dicts {
        flex-wrap: wrap;
    }
}