* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 25px 0;
    margin-bottom: 20px;
    background: linear-gradient(to right, #2c3e50, #4a6491);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

.header-decoration {
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}


.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
    transition: all 0.3s ease;
}

.panel:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f4f8;
}

.panel-title {
    font-size: 1.6rem;
    color: #2c3e50;
    font-weight: 600;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, #3498db, #2c6dad);
    color: white;
}

.btn-success {
    background: linear-gradient(to right, #2ecc71, #27ae60);
    color: white;
}

.btn-warning {
    background: linear-gradient(to right, #f39c12, #e67e22);
    color: white;
}

.btn-info {
    background: linear-gradient(to right, #9b59b6, #8e44ad);
    color: white;
}

.btn-purple {
    background: linear-gradient(to right, #8e44ad, #9b59b6);
    color: white;
}

.btn-teal {
    background: linear-gradient(to right, #1abc9c, #16a085);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.poem-lines {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.poem-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.poem-line.editing {
    background: #e3f2fd;
    border-color: #90caf9;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.line-number {
    background: #3498db;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.line-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.line-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.character-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
    transition: all 0.3s ease;
    position: relative;
}

.character-card.editing {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.char-display {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
}

.char-input-group {
    margin-bottom: 12px;
}

.char-input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.char-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.char-input:focus {
    outline: none;
    border-color: #3498db;
}

.translation-section {
    margin-top: 30px;
}

.translation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.translation-table th {
    background: #2c3e50;
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 500;
}

.translation-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #edf2f7;
}

.translation-table tr:nth-child(even) {
    background: #f8fafc;
}

.translation-table tr.editing {
    background: #e3f2fd;
}

.translation-table input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: transparent;
}

.translation-table input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.preview-section {
    margin-top: 30px;
}

.preview-container {
    background: #f0f7ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #dbeafe;
    min-height: 150px;
}

.preview-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.preview-line {
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-char {
    position: relative;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 2em;
}

.preview-char:hover {
    background: #e3f2fd;
}

.preview-info {
    position: absolute;
    top: -40px;
    left: 50%;
    font-size: 2em;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    display: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.preview-char:hover .preview-info {
    display: block;
}

.preview-pinyin {
    display: block;
    color: #FFD700;
    font-size: 0.8rem;
    text-align: center;
}

.preview-trans {
    display: block;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 3px;
    color: #fff;
    border-top: 1px solid #4a5568;
    padding-top: 3px;
}

.preview-translation {
    color: #3498db;
    font-size: 2rem;
    margin-top: 5px;
    padding-left: 30px;
    font-style: italic;
}

.footer {
    text-align: center;
    padding: 25px;
    color: #718096;
    font-size: 0.95rem;
    margin-top: 20px;
}

.language-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #edf2f7;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-btn.active {
    background: #3498db;
    color: white;
}

.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    z-index: 1000;
}

.update-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.edit-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.progress-bar {
    height: 5px;
    background: #3498db;
    border-radius: 3px;
    margin-top: 10px;
    transition: width 0.3s;
}

.auto-gen-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.translation-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
}

.status-indicator.offline {
    background: #e74c3c;
}

.translation-loader {
    display: none;
    text-align: center;
    padding: 15px;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 语篇编辑区域样式 */
.full-text-editor {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.full-text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.full-text-header h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-area-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.full-poem-input {
    flex: 1;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    resize: vertical;
    line-height: 1.6;
}

.full-poem-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.split-preview {
    flex: 1;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px dashed #3498db;
    min-height: 150px;
    font-size: 1.1rem;
    line-height: 1.6;
    overflow-y: auto;
}

.split-preview-line {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.split-controls {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.split-options {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    padding: 10px 15px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #dbeafe;
}

.split-options label {
    font-weight: 500;
    color: #4a5568;
}

.split-options select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
}

.split-options input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 80px;
}

.translation-preview {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

.translation-preview h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.translation-preview-content {
    font-size: 1.1rem;
    line-height: 1.6;
}

.translation-highlight {
    background: #fff9c4;
    padding: 2px 4px;
    border-radius: 4px;
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .auto-gen-controls, .translation-controls {
        flex-wrap: wrap;
    }
    
    .text-area-container {
        flex-direction: column;
    }
}