/* ===== 1. 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
}

/* ===== 2. 标题栏 ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 64px;
    padding: 0 24px;
    background: linear-gradient(135deg, #1a2a3a, #2c3e50);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo {
    width: 28px;
    height: 28px;
    color: #4fc3f7;
    flex-shrink: 0;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* ===== 3. 主体布局 ===== */
.main-layout {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* ===== 4. 左侧边栏 ===== */
.left {
    width: 220px;
    min-height: calc(100vh - 64px);
    background: #ffffff;
    border-right: 2px solid #e2e8f0;
    padding: 20px 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
}

/* ===== 5. 左侧按钮样式 ===== */
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sidebar-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sidebar-btn:active {
    transform: scale(0.97);
}

.sidebar-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.sidebar-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar-btn .btn-icon svg {
    width: 20px;
    height: 20px;
    stroke: #64748b;
    transition: stroke 0.2s;
}

.sidebar-btn:hover .btn-icon svg {
    stroke: #3b82f6;
}

.sidebar-btn.active .btn-icon svg {
    stroke: #ffffff;
}

.sidebar-btn .btn-text {
    flex: 1;
    text-align: left;
}

/* ===== 6. 右侧内容区域 ===== */
.right {
    flex: 1;
    padding: 28px 36px;
    background: #f8fafc;
    overflow-y: auto;
}

.right .page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.right .page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.right .page-header h2 .header-icon {
    display: inline-flex;
    align-items: center;
}

.right .page-header h2 .header-icon svg {
    width: 28px;
    height: 28px;
    stroke: #0f172a;
}

.right .page-header .subtitle {
    color: #64748b;
    font-size: 15px;
}

/* ===== 7. 设置卡片 ===== */
.content-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 28px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

.content-card .card-title {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-card .card-title .title-icon {
    display: inline-flex;
    align-items: center;
}

.content-card .card-title .title-icon svg {
    width: 20px;
    height: 20px;
    stroke: #0f172a;
}

.content-card .card-desc {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== 8. 设置项 ===== */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 16px;
    min-height: 60px;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    flex: 0 0 200px;
    min-width: 160px;
    padding-right: 16px;
}

.settings-item-label {
    font-size: 15px;
    font-weight: 500;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.settings-item-description {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.settings-item-control {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 200px;
    max-width: 440px;
}

/* ===== 9. Toggle开关 ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

/* ===== 10. 单行文本输入 ===== */
.settings-item-control input[type="text"] {
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.settings-item-control input[type="text"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.settings-item-control input[type="text"]::placeholder {
    color: #94a3b8;
}

/* ===== 11. 多行文本输入 ===== */
.settings-item-control textarea {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.settings-item-control textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.settings-item-control textarea::placeholder {
    color: #94a3b8;
}

/* ===== 12. 下拉选择 ===== */
.settings-item-control select {
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    width: 100%;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}

.settings-item-control select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ===== 13. 滑块 ===== */
.settings-item-control .slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.settings-item-control .slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.settings-item-control .slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-item-control .slider-container .slider-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    min-width: 44px;
    text-align: center;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 6px;
}

/* ===== 14. 颜色选择器 ===== */
.settings-item-control input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #f8fafc;
}

/* ===== 15. 动画 ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 16. 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

/* ===== 17. 响应式适配 ===== */
@media (max-width: 1024px) {
    .settings-item-info {
        flex: 0 0 150px;
        min-width: 130px;
    }

    .settings-item-control {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        margin-top: 56px;
    }

    .left {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        gap: 4px;
        box-shadow: none;
        max-height: 200px;
        overflow-y: auto;
    }

    .sidebar-btn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
    }

    .sidebar-btn .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    .right {
        padding: 20px 16px;
    }

    .right .page-header h2 {
        font-size: 20px;
    }

    .content-card {
        padding: 18px 16px;
    }

    .settings-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 16px 0;
        min-height: auto;
    }

    .settings-item-info {
        flex: 1;
        min-width: 100%;
        padding-right: 0;
    }

    .settings-item-control {
        justify-content: flex-start;
        min-width: 100%;
        max-width: 100%;
    }

    .settings-item-control input[type="text"],
    .settings-item-control textarea,
    .settings-item-control select,
    .settings-item-control .slider-container {
        max-width: 100%;
    }

    .toggle-switch {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .sidebar-btn {
        min-width: 60px;
        font-size: 12px;
        padding: 8px 10px;
        gap: 6px;
    }

    .sidebar-btn .btn-icon {
        width: 20px;
        height: 20px;
    }

    .sidebar-btn .btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .right {
        padding: 16px 12px;
    }

    .right .page-header h2 {
        font-size: 18px;
    }

    .content-card .card-title {
        font-size: 15px;
    }

    .settings-item-label {
        font-size: 14px;
    }
}

/* ===== 18. 自定义滚动条 ===== */
.right::-webkit-scrollbar,
.left::-webkit-scrollbar {
    width: 6px;
}

.right::-webkit-scrollbar-track,
.left::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.right::-webkit-scrollbar-thumb,
.left::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.right::-webkit-scrollbar-thumb:hover,
.left::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}