/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff5c8a;
    --primary-hover: #e84c7a;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --panel-bg: #ffffff;
    --border-color: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== 导航栏 ===== */
.navbar {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff5c8a 100%);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.user-name {
    font-size: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== 主工作区 ===== */
.workspace {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: 24px;
    min-height: calc(100vh - 60px);
}

/* ===== 侧边栏 ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.panel {
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ===== 上传区域 ===== */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #fff5f8;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-placeholder p {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-placeholder span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== 上传预览 ===== */
.upload-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-preview {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-hint {
    font-size: 12px;
    color: var(--primary-color);
    margin: 0;
    pointer-events: none;
}

#clearBtn {
    margin-top: 12px;
    width: 100%;
}

/* ===== 手动编辑卡片 ===== */
.manual-panel {
    margin-top: 0;
}

.manual-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #fff5f8 0%, #fff0f5 100%);
    border: 1px solid #ffe0ec;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.manual-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 92, 138, 0.15);
}

.manual-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff5c8a, #e0436f);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.manual-info {
    flex: 1;
    min-width: 0;
}

.manual-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.manual-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== 设置项 ===== */
.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.setting-item input[type="range"] {
    width: calc(100% - 50px);
    height: 6px;
    -webkit-appearance: none;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.setting-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.value-display {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 色板标签 ===== */
.palette-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.palette-tab {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.palette-tab:hover {
    border-color: var(--primary-color);
}

.palette-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.palette-display {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: var(--shadow);
}

.color-swatch.selected {
    border-color: var(--primary-color);
    transform: scale(1.2);
    z-index: 10;
}

.color-swatch::after {
    content: attr(data-code);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.color-swatch:hover::after {
    opacity: 1;
}

/* ===== 工具按钮 ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.tool-btn span {
    font-size: 20px;
}

.tool-btn:hover {
    border-color: var(--primary-color);
    background: #fff5f8;
}

.tool-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tool-btn.active span {
    color: white;
}

.brush-size {
    margin-bottom: 16px;
}

.brush-size label {
    font-size: 13px;
    margin-right: 8px;
}

.brush-size input[type="range"] {
    width: calc(100% - 60px);
    height: 6px;
    -webkit-appearance: none;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

.brush-size input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.undo-redo {
    display: flex;
    gap: 8px;
}

.btn-tool {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.btn-tool:hover {
    border-color: var(--primary-color);
}

/* ===== 操作按钮 ===== */
.action-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff5c8a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(255, 92, 138, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 92, 138, 0.4);
}

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

.btn-secondary {
    width: 100%;
    padding: 10px 20px;
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* AI去背景按钮特殊样式 */
#removeBgBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 8px;
}

#removeBgBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#removeBgBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 处理模式选择器特殊样式 */
#processMode {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border: 1px solid #dce3eb;
    font-weight: 500;
}

#processMode:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.1);
}

/* ===== 画布区域 ===== */
.canvas-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--panel-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 8px;
}

.canvas-toolbar .canvas-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f6fb;
    border-radius: 8px;
    padding: 4px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.zoom-btn:active {
    transform: scale(0.92);
}

.zoom-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.zoom-reset {
    width: auto;
    padding: 0 10px;
    font-size: 12px;
}

.zoom-level {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 48px;
    text-align: center;
}

.canvas-container {
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 500px;
    max-height: 70vh;
    background: #fafbfc;
    border-radius: 10px;
    overflow: auto;
    position: relative;
    background-image:
        linear-gradient(45deg, #e9ecef 25%, transparent 25%),
        linear-gradient(-45deg, #e9ecef 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e9ecef 75%),
        linear-gradient(-45deg, transparent 75%, #e9ecef 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, 10px 0px;
    /* 确保滚动顺畅 */
    -webkit-overflow-scrolling: touch;
}

#beadCanvas {
    display: block;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    /* 防止canvas被滚动条挤压时缩小 */
    align-self: flex-start;
}

.canvas-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    cursor: pointer;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.canvas-info {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

#totalBeads {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 统计面板 ===== */
.stats-panel {
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stats-panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.stats-list {
    max-height: 200px;
    overflow-y: auto;
}

.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #f8f9fa;
}

.stats-color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-name {
    font-size: 13px;
    color: var(--text-primary);
}

.color-code {
    font-size: 11px;
    color: var(--text-secondary);
}

.stats-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 预览区域 ===== */
.preview-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
}

.preview-area::-webkit-scrollbar {
    width: 6px;
}

.preview-area::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.preview-container {
    background: linear-gradient(145deg, #fafbfc, #f0f2f5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.04);
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fafafa;
    display: block;
}

.preview-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 色号列表 ===== */
.color-list {
    max-height: 300px;
    overflow-y: auto;
}

.color-list .hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.color-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.color-list-item:hover {
    background: #f8f9fa;
}

.color-list-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.color-list-code {
    font-weight: 600;
    color: var(--text-primary);
}

.color-list-name {
    color: var(--text-secondary);
    flex: 1;
}

.color-list-count {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== 功能介绍区域 ===== */
.features-section {
    padding: 60px 24px 80px;
    background: #fff;
    border-top: 1px solid #f0f0f5;
}

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

.features-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.features-subtitle {
    text-align: center;
    font-size: 16px;
    color: #8a8499;
    margin-bottom: 48px;
}

/* ===== 卡片式功能列表（xiaoana.cn风格） ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    background: #fff;
    border: 1px solid #f0edf5;
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.feature-card:hover {
    border-color: transparent;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.fc-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.fc-icon-1 { background: #f0eef8; color: #6c5ce7; }
.fc-icon-2 { background: #e8f8f0; color: #00b894; }
.fc-icon-3 { background: #e8f0fe; color: #0984e3; }
.fc-icon-4 { background: #fff4e6; color: #f39c12; }
.fc-icon-5 { background: #ffe8ec; color: #e74c3c; }
.fc-icon-6 { background: #f0f8ff; color: #00cec9; }
.fc-icon-7 { background: #f5edff; color: #a855f7; }
.fc-icon-8 { background: #fff0f5; color: #ff5c8a; }

.fc-body h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.2px;
}

.fc-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6b6b7b;
}

/* 响应式 */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .feature-card {
        padding: 20px 18px;
    }
}

@media (max-width: 600px) {
    .features-title {
        font-size: 24px;
    }
    .features-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }
    .features-section {
        padding: 40px 16px 60px;
    }
}

/* ===== 模态框 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* ===== Toast提示 ===== */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 12px 24px;
    background: #323232;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transform: translateX(100%);
    transition: var(--transition);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

/* ===== 导出设置弹窗 ===== */
.export-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px dashed #eee;
}

.export-setting-row:last-child {
    border-bottom: none;
}

/* 导出格式选项卡片 */
.export-format-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    user-select: none;
}

.export-format-opt:hover {
    border-color: #ffc4d4;
    color: var(--primary-color);
}

.export-format-opt.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255,92,138,0.08), rgba(255,92,138,0.02));
    color: var(--primary-color);
}

.export-format-opt input {
    display: none;
}

/* 开关开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 280px 1fr;
    }
    
    .preview-area {
        display: none;
    }
}

@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .sidebar {
        max-height: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .user-name {
        display: none;
    }
}
