/* 大纲编辑器样式 */
.outline-container {
    display: none;
    margin: 2.5rem auto;
    padding: 25px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.chapter {
    margin-bottom: 20px;
    border-radius: 10px;
    background: #fafafa;
    padding: 0px;
    width: 100%;
    box-sizing: border-box;
}

.chapter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: #f5f7fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.chapter-title:hover {
    background: #e9ecef;
}

.section {
    margin: 12px 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
}

.section-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 8px;
    color: #212529;
    font-size: 0.95em;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.sub-section-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: normal;
    margin-bottom: 6px;
    font-size: 0.9em;
    padding: 6px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.abstract {
    color: #6c757d;
    margin: 8px 0;
    line-height: 1.5;
    font-size: 0.9em;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
}

.editable {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    margin-right: 16px;
    min-width: 0;
    display: inline-block;
    max-width: calc(100% - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.editable:hover {
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.editable:focus {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
    background-color: #fff;
    outline: none;
}

/* 控制区域容器 */
.section-controls-area {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.chapter-controls, .section-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
    width: auto;
}

.control-button {
    padding: 6px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 2px;
    flex-shrink: 0;
}

.control-button i {
    font-size: 14px;
}

.control-button:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.control-button.add-sibling {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.control-button.add-sibling:hover {
    background: #667eea;
    color: #fff;
}

.control-button.add-child {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.control-button.add-child:hover {
    background: #667eea;
    color: #fff;
}

.control-button.delete {
    background: #fff1f0;
    color: #ff4d4f;
    border-color: #ffa39e;
}

.control-button.delete:hover {
    background: #ff4d4f;
    color: #fff;
}

.chapter-title:hover .chapter-controls,
.section-name:hover .section-controls {
    opacity: 1;
    transform: translateY(-1px);
}

.sub-section {
    margin: 10px 20px;
    padding: 8px;
    background: #fff;
    width: calc(100% - 40px);
    box-sizing: border-box;
}

.editable[data-number]::before {
    content: attr(data-number) " ";
    color: #666;
    font-weight: normal;
}

.editable {
    position: relative;
    display: inline-block;
}

.chapter-title .editable,
.section-name .editable {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    margin-right: 16px;
    min-width: 0;
    display: inline-block;
    max-width: calc(100% - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.abstract.editable {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    margin-right: 16px;
    min-width: 0;
    display: inline-block;
    width: 100%;
    max-width: none;
}

/* 图表下拉框样式优化 */
.chart-type-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    margin-right: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    max-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
    flex-shrink: 0;
}

.chart-type-select:hover {
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.chart-type-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.section-name .chart-type-select {
    margin-right: 10px;
    font-size: 0.8rem;
    padding: 4px 24px 4px 8px;
    background-position: right 4px center;
    max-width: 120px;
}

.section-name .chart-type-select:hover {
    border-color: var(--primary-color, #667eea);
}

.section-name .chart-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sub-section .section-name .chart-type-select {
    min-width: 100px;
    font-size: 0.75rem;
    padding: 3px 20px 3px 6px;
    background-position: right 3px center;
    background-size: 10px;
}

@media (max-width: 768px) {
    .outline-container {
        padding: 15px 10px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .container {
        padding: 16px;
        margin: 0;
        width: 100%;
    }
    
    .form-group {
        margin-bottom: 24px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .chapter {
        /* padding: 10px; */
        margin-bottom: 16px;
    }
    
    .chapter-title {
        padding: 10px;
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chapter-title .editable {
        max-width: 100%;
        width: 100%;
        padding: 6px 8px;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .chapter-controls {
        padding: 4px;
        gap: 4px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .control-button {
        width: 28px;
        height: 28px;
        padding: 4px;
    }
    
    .section {
        margin: 10px 0;
        padding: 10px;
    }
    
    .section-name {
        padding: 6px;
        font-size: 0.9em;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-name .editable {
        max-width: 100%;
        width: 100%;
        padding: 6px 8px;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .section-controls {
        padding: 4px;
        gap: 4px;
        width: 100%;
        justify-content: flex-end;
        width: 40%;
    }
    
    .sub-section-name {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sub-section-name .editable {
        max-width: 100%;
        width: 100%;
        padding: 6px 8px;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .sub-section-name .section-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .section-name .chart-type-select,
    .sub-section .section-name .chart-type-select {
        min-width: 60px;
        max-width: 60%;
        width: 100%;
        font-size: 0.8rem;
        padding: 6px;
        margin-right: 0;
        margin-bottom: 8px;
        background-position: right 8px center;
        margin-right: 30px;
    }
    
    .editable {
        padding: 6px 8px;
        margin-right: 0;
        max-width: 100%;
    }
    
    .chart-type-select {
        min-width: 100px;
        padding: 6px;
        width: 100%;
    }
    
    .control-button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .sub-section {
        margin: 10px 10px;
        width: calc(100% - 20px);
    }
    .section-controls-area {
        margin-left: inherit;
    }
}

.outline-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
}

.copy-outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.copy-outline-btn i {
    margin-right: 8px;
}

.copy-outline-btn:hover {
    background: #388E3C;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transform: translateY(-1px);
}

/* 大纲工具栏样式 */
.outline-toolbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 10px;
}

.chart-config-toolbar {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 300px;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-title {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.toolbar-title i {
    margin-right: 6px;
    color: #667eea;
}

/* 开关容器样式 */
.config-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 10px;
}

.switch-label {
    font-size: 0.9rem;
    color: #495057;
    white-space: nowrap;
    cursor: pointer;
}

/* 开关样式 */
.switch-wrapper {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.unified-chart-switch {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.unified-chart-switch:checked + .switch-slider {
    background-color: #667eea;
}

.unified-chart-switch:focus + .switch-slider {
    box-shadow: 0 0 1px #667eea;
}

.unified-chart-switch:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* 图表份数输入区域 */
.chart-count-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-count-container label {
    font-size: 0.9rem;
    color: #495057;
    white-space: nowrap;
}

.chart-count-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.chart-count-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.toolbar-divider {
    height: 24px;
    width: 1px;
    background-color: #dee2e6;
    margin: 0 8px;
}

/* 复制大纲按钮样式更新 */
.copy-outline-btn {
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.copy-outline-btn:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.copy-outline-btn i {
    font-size: 0.8rem;
}

/* 重新生成大纲按钮样式 */
.regenerate-outline-btn {
    padding: 6px 12px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.regenerate-outline-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.regenerate-outline-btn i {
    font-size: 0.8rem;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .outline-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    
    .chart-config-toolbar {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .toolbar-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
    
    .config-switch-container {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 8px;
    }
    
    .chart-count-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-count-input {
        flex: 1;
        max-width: 80px;
    }
    
    .outline-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-outline-btn,
    .regenerate-outline-btn {
        padding: 8px 12px;
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .regenerate-outline-btn:last-child {
        margin-bottom: 0;
    }
} 