* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f6f8;
    color: #1c1e21;
    min-height: 100vh;
}

/* 顶部导航栏 */
.navbar {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #1877f2;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-item {
    padding: 8px 16px;
    color: #65676b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #f0f2f5;
}

.nav-item.active {
    color: #1877f2;
    background-color: rgba(24, 119, 242, 0.1);
}

/* 主内容区 */
.main-content {
    display: flex;
    gap: 20px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 左侧面板 */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右侧面板 */
.right-panel {
    width: 300px;
    flex-shrink: 0;
}

/* 通用区块 */
.section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
}

.btn-clear-history {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 12px;
    background: #e4e6eb;
    color: #65676b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-clear-history:hover {
    background: #d8dadf;
}

/* 圆点标识 */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-blue {
    background-color: #1877f2;
}

.dot-orange {
    background-color: #f59e0b;
}

.dot-green {
    background-color: #22c55e;
}

/* 表单行 */
.form-row {
    display: flex;
    gap: 12px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #65676b;
    margin-bottom: 6px;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
}

.form-group select:focus,
.form-group textarea:focus {
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.form-group select {
    cursor: pointer;
}

/* 滑块 */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-row label {
    width: 50px;
    font-size: 14px;
    color: #1c1e21;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e4e6eb;
    border-radius: 3px;
    outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1877f2;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider-value {
    width: 50px;
    font-size: 13px;
    color: #65676b;
    text-align: right;
}

/* 文本内容区 */
.text-content textarea {
    width: 100%;
    resize: vertical;
    min-height: 150px;
}

.text-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

.btn-text {
    padding: 8px 16px;
    background: #e4e6eb;
    color: #1c1e21;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-text:hover {
    background: #d8dadf;
}

.btn-primary {
    flex: 1;
    padding: 12px 24px;
    background-color: #1877f2;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #166fe5;
}

.btn-primary:disabled {
    background-color: #a0c3f5;
    cursor: not-allowed;
}

/* 历史记录 */
.history .section-header h3 {
    font-size: 15px;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #a0a0a0;
    text-align: center;
}

.clock-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.history-empty p {
    font-size: 13px;
    line-height: 1.5;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 12px;
    background: #f0f2f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item:hover {
    background: #e4e6eb;
}

.history-item .voice-name {
    font-size: 13px;
    font-weight: 600;
    color: #1c1e21;
    margin-bottom: 4px;
}

.history-item .text-preview {
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 200;
}

.loading-overlay span {
    font-size: 16px;
    color: #65676b;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e4e6eb;
    border-top-color: #1877f2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
    }
}