/* ========================================================== */
/* 全局美化滚动条 */
/* ========================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================================== */
/* 端与层级选择器样式 (紧凑化) */
/* ========================================================== */
.step-label {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    font-size: 11px;
    margin-right: 6px;
    font-weight: normal;
}

.terminal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.terminal-btn {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.2s;
}

.terminal-btn:hover {
    border-color: #bbd3fc;
    color: var(--primary-color);
}

.terminal-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 138, 255, 0.3);
}

.developing-prompt {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin-top: 10px;
}

/* ========================================================== */
/* 字体与变量 */
/* ========================================================== */
@font-face {
    font-family: 'PingFangSC-Medium';
    src: url('https://cdn.jsdelivr.net/gh/shenweiyan/PingFangSC-Fonts/PingFang%20Medium.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
font-family: 'FZLanTingHeiS-R';
src: url('https://cdn.jsdelivr.net/gh/ww7627502-ctrl/baidudu@main/FZLanTingHeiS-R-GB.ttf') format('truetype');
font-weight: normal;
}

@font-face {
    font-family: 'FZLanTingHeiS-H';
    src: url('https://cdn.jsdelivr.net/gh/ww7627502-ctrl/baidudu@main/FZLanTingHeiS-H-GB.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'FZLanTingHeiS-DB';
    src: url('https://cdn.jsdelivr.net/gh/ww7627502-ctrl/baidudu@main/FZLanTingHeiS-DB-GB.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'FZLTHK';
    src: url('https://cdn.jsdelivr.net/gh/ww7627502-ctrl/baidudu@main/FZLTHK.TTF') format('truetype');
    font-weight: normal;
}

:root {
    --primary-color: #258AFF;
    --bg-color: #f2f5f8;
    --text-main: #333;
    --text-sub: #666;
    --border-color: #e0e6ed;
}

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

/* 核心布局修复：严格锁定全局高度 */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    
    /* 👇 新增这两行，开启极限抗锯齿，让字体变细变清晰 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* 头部 */
.app-header {
    height: 50px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 10;
}

.header-title {
    font-size: 16px;
    font-weight: bold;
}

.btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.primary-btn:hover {
    background-color: #1a73e8;
}

.secondary-btn {
    background-color: #f0f2f5;
    color: #333;
}

.secondary-btn:hover {
    background-color: #e4e7ea;
}

/* ========================================================== */
/* 三栏布局核心 */
/* ========================================================== */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100vw;
}

/* 基础侧边栏 */
.sidebar {
    width: 340px;
    min-width: 340px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    flex-shrink: 0;
    padding: 16px;
}

/* 左侧边栏专用限制：打死全局滚动，只允许列表区域滚动 */
.left-sidebar {
    border-right: 1px solid var(--border-color);
    width: 300px;
    min-width: 300px;
    overflow: hidden !important;
    padding-bottom: 0;
}

/* 右侧参数面板保持内部整体滚动 */
.right-sidebar {
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.03);
    z-index: 5;
    background: #fafafa;
    overflow-y: auto;
}

/* 关键高度传递管道：打通步骤2和步骤3的容器 */
#wangpanWorkspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ========================================================== */
/* 右侧面板卡片分组样式 */
/* ========================================================== */
.panel-group {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.panel-group-header {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid var(--border-color);
}

.panel-group-body {
    padding: 16px;
}

.panel-group-body .sidebar-section:last-child {
    margin-bottom: 0;
}

/* 中间画板工作区 */
.center-workspace {
    flex: 1;
    background: #E5E5E5;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 侧边栏内部元素 */
.sidebar-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 13px;
    font-weight: bold;
    color: #444;
    margin-bottom: 10px;
}

.bu-selector {
    display: flex;
    gap: 8px;
}

.bu-btn {
    flex: 1;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.bu-btn img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: all 0.3s;
    filter: url(#lightBlueTint);
}

.bu-btn:hover {
    transform: translateY(-2px);
}

.bu-btn.active img {
    filter: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.upload-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.2s;
    min-height: 80px;
}

.upload-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.upload-preview-img {
    max-width: 100%;
    max-height: 60px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.upload-text {
    font-size: 11px;
    color: var(--text-sub);
}

.color-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
}

.color-selector label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-group {
    margin-bottom: 10px;
}

.input-group span {
    display: block;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

/* ========================================================== */
/* 画板预览区 */
/* ========================================================== */
.preview-grid.flex-center {
    display: flex;
    gap: 60px;
    justify-content: center;
    width: 100%;
}

.preview-card.transparent-card {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.text-center {
    text-align: center !important;
}

.card-title {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-bottom: 12px;
}

.phone-canvas {
    max-height: 70vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.zoomable-canvas {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.zoomable-canvas:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* 动态显示控制 */
.control-group {
    display: none;
}

.control-group.active {
    display: block;
}

.view-section {
    display: none;
    width: 100%;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.3s;
}

.view-section.prompt-view.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================== */
/* 弹窗样式 */
/* ========================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.detail-modal-panel {
    background: #fff;
    border-radius: 12px;
    width: 800px;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.detail-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
}

.detail-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.close-detail-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.2s;
}

.close-detail-modal:hover {
    color: #333;
}

.detail-modal-body {
    padding: 32px 24px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
}

.detail-modal-body img {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.banner-label {
    font-size: 14px;
    color: #444;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}

/* 原有的导出弹窗样式保持 */
.export-modal-panel {
    background: #fff;
    width: 500px;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin: auto;
}

.export-modal-header {
    background: #f8fafc;
    padding: 14px 20px;
    font-weight: bold;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
}

.export-modal-body {
    padding: 20px;
    max-height: 55vh;
    overflow-y: auto;
}

.export-group {
    margin-bottom: 24px;
}

.export-group-title {
    font-size: 13px;
    font-weight: bold;
    color: #222;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-badge {
    font-size: 12px;
}

.export-badge.ss {
    color: #E63F00;
}

.export-badge.s {
    color: #F59A23;
}

.export-group label {
    display: block;
    margin-bottom: 10px;
    padding-left: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #444;
}

.export-group label:hover {
    color: var(--primary-color);
}

.export-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 颜色选择器样式 */
.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
}

.color-picker-wrap input[type="color"] {
    width: 26px;
    height: 26px;
    border: 1px solid #cbd5e1;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    background: transparent;
}

.color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 1px;
}

.color-picker-wrap input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* 美化角度滑块 */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type=range]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(37, 138, 255, 0.2);
}

/* ================= 像素级还原 Figma 侧边栏质感 ================= */

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1;
    min-height: 0;
    padding-bottom: 20px;
    /* 让列表背景占满侧边栏，但内容通过内边距往里缩 */
    margin-left: -16px;
    margin-right: -16px;
}

/* 列表纵向滚动条 - 极致极简 */
.resource-list::-webkit-scrollbar {
    width: 10px;
}

.resource-list::-webkit-scrollbar-track {
    background: transparent;
}

.resource-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
    border: 3px solid #fff;
    /* 用白边伪装出细线滚动条 */
}

.resource-list:hover::-webkit-scrollbar-thumb {
    background: #D9D9D9;
    /* 只有鼠标移入列表才显示滚动条 */
}

/* --- 核心优化：每一行的排版与呼吸感 --- */
.resource-item {
    display: flex;
    align-items: center;
    height: 32px;
    /* 恢复 Figma 标准的 32px 高度，靠内部排版出质感 */
    padding: 0 16px 0 28px;
    /* 🎯关键：大幅增加左侧留白(28px)，产生缩进安全感 */
    cursor: pointer;
    font-size: 12px;
    /* 🎯关键：缩小到12px，极致的专业感 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* 借用系统原生字体 */
    -webkit-font-smoothing: antialiased;
    /* 🎯关键：开启字体抗锯齿，让文字变得锐利、纤细 */
    color: rgba(0, 0, 0, 0.8);
    /* 柔和的黑灰色，不刺眼 */
    user-select: none;
    transition: none;
    width: 100%;
    box-sizing: border-box;
}

.resource-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    /* Figma 极其克制的浅灰悬浮 */
}

.resource-item.active {
    background-color: #E5F3FF;
    /* Figma 经典的选中蓝 */
    color: rgba(0, 0, 0, 0.9);
}

.resource-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    /* 严格的 8px 间距 */
    color: rgba(0, 0, 0, 0.25);
    /* 🎯关键：图标颜色大幅度变浅，退居二线 */
    flex-shrink: 0;
}

.resource-item.active .resource-item-icon {
    color: #18A0FB;
    /* 选中时图标高亮 */
}

.resource-item-text {
    flex: 1;
    white-space: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    line-height: 32px;
    /* 保证文字绝对垂直居中 */
}

.resource-item-text::-webkit-scrollbar {
    display: none;
}
