/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

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

.header-decoration {
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6, #e74c3c);
    width: 150px;
    margin: 0 auto;
    border-radius: 2px;
}

/* 语言选择器 */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: #ecf0f1;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn:hover {
    background-color: #d6eaf8;
}

.lang-btn.active {
    background-color: #3498db;
    color: white;
}

/* 内容布局 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

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

.panel {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 0;
}

/* 按钮样式 */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-purple {
    background-color: #9b59b6;
    color: white;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-info {
    background-color: #3498db;
    color: white;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-teal {
    background-color: #1abc9c;
    color: white;
}

/* 诗歌编辑区域 */
.poem-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poem-line {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.poem-line.editing {
    background-color: #e8f4fc;
    border-left: 4px solid #3498db;
}

.line-number {
    font-weight: bold;
    color: #7f8c8d;
    min-width: 30px;
}

.line-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.line-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 字符编辑区域 */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.character-card {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    position: relative;
}

.character-card.editing {
    background-color: #e8f4fc;
    border-left: 4px solid #3498db;
}

.char-display {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

.edit-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-card.editing .edit-indicator {
    opacity: 1;
}

.char-input-group {
    margin-bottom: 10px;
}

.char-input-group label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.char-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.char-input:focus {
    outline: none;
    border-color: #3498db;
}

/* 翻译表格 */
.translation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.translation-table th, .translation-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.translation-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.translation-table tr.editing td {
    background-color: #e8f4fc;
}

.translation-table input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.translation-table input:focus {
    outline: none;
    border-color: #3498db;
}

/* 预览区域 */
.preview-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.preview-line {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.preview-translation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    color: #555;
}

.preview-char {
    position: relative;
    display: inline-block;
    margin-right: 2px;
}

.preview-char:hover .preview-info {
    display: block;
}

.preview-info {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
}

.preview-pinyin {
    display: block;
    color: #f1c40f;
}

.preview-trans {
    display: block;
    font-style: italic;
}

/* 自动生成控制区 */
.auto-gen-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auto-gen-controls .btn {
    flex: 1;
    min-width: 150px;
}

/* API状态指示器 */
.api-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #2ecc71;
}

.status-indicator.offline {
    background-color: #e74c3c;
}

/* 加载器 */
.translation-loader {
    display: none;
    text-align: center;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* 通知 */
.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.update-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* 全文本编辑器 */
.full-text-editor {
    margin-bottom: 30px;
}

.full-text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.full-text-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.split-controls {
    display: flex;
    gap: 10px;
}

.split-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.split-options select, .split-options input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.text-area-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .text-area-container {
        grid-template-columns: 1fr;
    }
}

.full-poem-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
}

.full-poem-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.split-preview {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    height: 150px;
    overflow-y: auto;
}

.split-preview-line {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 导出选项 */
.export-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.export-options .btn {
    flex: 1;
    padding: 10px;
}

#webPreviewContainer {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

#webPreviewContainer h3 {
    margin-top: 0;
    color: #555;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 0.9rem;
}