/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 英语标签样式 */
.en-label {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85em;
    color: #666;
    margin-left: 8px;
    font-weight: normal;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.main-content {
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 350px;
    flex-shrink: 0;
}

.editor-area {
    flex: 1;
}

.panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.panel h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #34495e;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.control-group input[type="range"] {
    margin-bottom: 5px;
}

.control-group span {
    display: block;
    text-align: right;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.primary-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    transition: background-color 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.secondary-btn {
    background-color: #ecf0f1;
    color: #333;
    border: 1px solid #bdc3c7;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    transition: background-color 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.secondary-btn:hover {
    background-color: #d5dbdb;
}

.tibetan-characters {
    max-height: 400px;
    overflow-y: auto;
}

.character-set {
    margin-bottom: 15px;
}

.character-set h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #34495e;
}

.chars-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.char-btn {
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    transition: all 0.2s;
    text-align: center;
}

.char-btn:hover {
    background-color: #d5dbdb;
    transform: scale(1.05);
}

.char-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

/* 笔画工具样式 */
.drawing-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.tool-btn {
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #d5dbdb;
}

.tool-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

/* 字符编辑器样式 */
.editor-info {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 4px;
}

.editor-container {
    position: relative;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#glyph-canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    z-index: 2;
}

.canvas-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
}

.editor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preset-texts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preset-btn {
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.preset-btn:hover {
    background-color: #e9ecef;
    border-color: #3498db;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.toolbar button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'ZZWXBTOT Unicode', 'Noto Sans Tibetan', 'Microsoft Himalaya', sans-serif;
    transition: background-color 0.2s;
}

.toolbar button:hover {
    background-color: #2980b9;
}

.text-input-container {
    margin-bottom: 20px;
}

#text-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

/* 导出控件样式 */
.export-controls {
    margin-bottom: 15px;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.code-output {
    position: relative;
}

#css-code {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: monospace;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

#copy-css-btn {
    padding: 8px 15px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#copy-css-btn:hover {
    background-color: #27ae60;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .chars-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .canvas-wrapper {
        height: 400px;
    }
}

/* 基础字体预览样式 */
.base-font-preview {
    position: relative;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px dashed #ddd;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* 字符信息显示增强 */
.char-info {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.char-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.char-info-label {
    font-weight: 500;
    color: #495057;
}

.char-info-value {
    font-family: monospace;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

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

.tibetan-characters::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tibetan-characters::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.tibetan-characters::-webkit-scrollbar-thumb:hover {
    background: #555;
}