:root {
    /* 主题与面板基础颜色 */
    --bg-main: #f9f9f9;
    --bg-canvas-container: #FFFFFF;
    --bg-panel: #f0f0f0;
    --bg-panel-light: #fafafa;
    --bg-panel-dark: #333F48;
    --bg-item-hover: #F3F3F3;
    --bg-btn-hover: #e6e6e6;
    --bg-btn-active: #cccccc;
    --bg-btn-disabled: #bbb;
    --bg-header: #eaeaea;
    
    /* 文字颜色 */
    --text-primary: #202020;
    --text-muted: #717171;
    --text-dark: #333333;
    --text-light: #F0F0F0;
    --text-control: #555555;
    --text-placeholder: #b0b0b0;
    
    /* 边框与阴影 */
    --border-color-default: #cccccc;
    --border-color-light: #dcdcdc;
    --border-color-dark: #bcbcbc;
    --border-color-panel: #EAEAEA;
    --border-color-btn: #D1D1D1;
    --shadow-inset-panel: inset -2px 0px 2px #DCDCDC;
    --shadow-active-btn: 1px 2px 2px rgba(0, 0, 0, 0.35);
    
    /* 核心业务与交互高亮色 */
    --color-accent: #FFd701;
    --color-danger: #ff4d4f;
    --color-active-dark: #111111;
    --current-line-bg-default: #b0b0b0;
    --canvas-border-default: #111111;
    
    /* 渐变滤镜叠加色 */
    --gradient-btn-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 35.34%, rgba(131, 131, 131, 0.15) 63.63%);
    --gradient-fade-left: linear-gradient(to right, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
    --gradient-fade-right: linear-gradient(to left, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
    --gradient-hanger-fade: linear-gradient(to top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
}

/* 1. 定义西文字体：Geist Variable (400-700) */
@font-face {
    font-family: 'Geist';
    src: url('/fonts/Geist[wght].ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. 定义中文字体群 */
@font-face {
    font-family: 'IBM Plex Sans SC';
    src: url('/fonts/IBMPlexSansSC-Text.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans SC';
    src: url('/fonts/IBMPlexSansSC-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans SC';
    src: url('/fonts/IBMPlexSansSC-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans SC';
    src: url('/fonts/IBMPlexSansSC-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/NotoSans-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-display: swap;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Geist", "IBM Plex Sans SC", sans-serif;
}

body {
    font-family: "Geist", "IBM Plex Sans SC", sans-serif;
    line-height: 1.2;
    margin: 0;
    display: flex;
    flex-flow: row nowrap;
    width: 100%;
    background: var(--bg-main);
}

.leftPanel {
    padding: 12px;
    display: flex;
    flex-flow: column nowrap;
    gap: 12px;
    box-sizing: border-box;
    box-shadow: var(--shadow-inset-panel);
}

.componentsPanel {
    display: flex;
    flex-flow: column nowrap;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

#categoriesList {
    display: flex;
    flex-flow: row nowrap;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color-default);
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;

    user-select: none;
}

#categoriesList button {
    display: inline-flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 60px;
    border: 2px solid var(--border-color-default);
    background-color: var(--bg-panel);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 4px;
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    font-family: "Geist", "IBM Plex Sans SC", sans-serif !important;
    cursor: pointer;
}

#categoriesList> :nth-child(1) {
    background: var(--gradient-btn-overlay), var(--bg-panel);
}

#categoriesList> :nth-child(2) {
    background: var(--gradient-btn-overlay), var(--color-accent);
}

#categoriesList> :nth-child(3) {
    background: var(--gradient-btn-overlay), var(--bg-panel-dark);
    color: var(--text-light);
}

#categoriesList button.activeCategory {
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 100px;
    box-shadow: var(--shadow-active-btn);
}

#categoriesList button .categoryEnglish {
    font-size: 10px;
    opacity: 75%;
}

#componentsList {
    display: flex;
    flex-flow: column nowrap;
    gap: 16px;
    padding: 12px;
    border: 2px solid var(--border-color-default);
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
    width: calc(120px * 3 + 8px * 4 + 18px);
    flex: 1;
    overflow-y: auto;
    box-sizing: border-box;
}

#componentsList::-webkit-scrollbar {
    width: 6px;
}

#componentsList::-webkit-scrollbar-thumb {
    background-color: var(--border-color-default);
    border-radius: 4px;
    border-right: 2px solid transparent;
    background-clip: padding-box;
}

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

.componentGroup {
    display: flex;
    flex-flow: column nowrap;
    gap: 10px;
    border-radius: 4px;
}

h3 {
    margin: 0;
    padding: 2px 6px;
    background: var(--bg-header);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.componentGroupItems {
    display: flex;
    flex-flow: row wrap;
    gap: 8px;
}

.componentItem {
    display: inline-flex;
    flex-flow: column nowrap;
    align-items: center;
    width: 120px;
    height: 150px;
    padding: 0;
    border: 2px solid var(--border-color-default);
    border-radius: 4px;
    background: var(--bg-panel);
    cursor: pointer;
    text-align: center;
}

.componentItem:hover {
    background: var(--bg-item-hover);
}

.componentThumbnail {
    width: 100%;
    height: 100px;
    object-fit: contain;
    background: var(--bg-canvas-container);
    padding: 20px 10px;
    box-sizing: border-box;
}

.componentItem[data-id="zone"] .componentThumbnail {
    padding: 24px;
}

.componentGroup.facility img {
    filter: brightness(0) invert(1)!important;
}

.componentTextWrapper {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
    gap: 0px;
    height: 50px;
}

.componentName {
    font-size: 14px;
    font-weight: 500;
}

.componentDescription {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

.emptyState {
    color: var(--text-muted);
    font-size: 13px;
    user-select: none;
}

.settingsPanel {
    display: none;
    flex-flow: column nowrap;
    gap: 12px;
    flex: 1;
    min-height: 0;
    width: 410px;
}

.settingsPanel.active {
    display: flex;
}

.componentsPanel {
    display: flex;
}

.componentsPanel.hidden {
    display: none;
}

.savedFilePanel {
    display: none;
    flex-flow: column nowrap;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: 410px;
}

.savedFilePanel.active {
    display: flex;
}

.savedFileList {
    display: none;
    flex-flow: column nowrap;
    gap: 8px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    box-sizing: border-box;
    border: 2px solid var(--border-color-default);
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
}

.savedFileList.active {
    display: flex;
}

.presetSignsList {
    display: none;
    flex-flow: column nowrap;
    gap: 8px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    box-sizing: border-box;
    border: 2px solid var(--border-color-default);
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
}

.presetSignsList.active {
    display: flex;
}

.savedFileTypeSelector {
    display: flex;
    flex-flow: row nowrap;
    gap: 12px;
}

.savedFileTypeSelector button {
    width: 100%;
    border: 2px solid var(--border-color-default);
    background: var(--bg-header);
    color: var(--text-primary);
    text-align: left;

    cursor: pointer;
}

.savedFileTypeSelector button.active {
    background: var(--color-active-dark);
    color: var(--bg-canvas-container);
    border-color: var(--color-active-dark);
}

.savedFileTypeSelector button.active h2 {
    color: var(--bg-canvas-container);
}

.savedFilePanel h2 {
    margin: 0;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 600;
}



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

.savedFileList::-webkit-scrollbar-thumb {
    background-color: var(--border-color-default);
    border-radius: 4px;
    border-right: 2px solid transparent;
    background-clip: padding-box;
}

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

#noSavedFile {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.savedFileCard {
    display: flex;
    flex-flow: column nowrap;
    gap: 6px;
    padding: 12px;
    border: 2px solid var(--border-color-default);
    border-radius: 4px;
    background: var(--bg-canvas-container);
    transition: all 0.2s ease;
}

.savedFileCard:hover {
    background: var(--bg-item-hover);
    border-color: var(--border-color-dark);
}

.savedFileTitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.savedFileInfo {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-control);
}

.savedFileDateTime {
    white-space: nowrap;
}

.savedFileInfo .divider {
    color: var(--text-placeholder);
    user-select: none;
}

.savedFileInfo button {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-control);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.savedFileInfo button:hover {
    background: var(--bg-btn-hover);
    color: var(--color-active-dark);
}

.savedFileDeleteBtn:hover {
    background: var(--color-danger) !important;
    color: var(--text-light) !important;
}



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

.presetSignsList::-webkit-scrollbar-thumb {
    background-color: var(--border-color-default);
    border-radius: 4px;
    border-right: 2px solid transparent;
    background-clip: padding-box;
}

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

#noPresetSign {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.presetCard {
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color-default);
    border-radius: 4px;
    background: var(--bg-canvas-container);
    transition: all 0.2s ease;
}

.presetCard:hover {
    background: var(--bg-item-hover);
    border-color: var(--border-color-dark);
}

.presetThumbnail {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 2px;
    box-sizing: border-box;
}

.presetCard .savedFileTitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.presetCard .savedFileInfo {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-control);
}

.presetCard .savedFileInfo button {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-control);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.presetCard .savedFileInfo button:hover {
    background: var(--bg-btn-hover);
    color: var(--color-active-dark);
}

/* Style Preview Canvas Styles */

.stylePreviewWrapper {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 4px;
    user-select: none;
}

.stylePreviewCanvas {
    display: flex;
    flex-flow: row nowrap;
    border: 4px solid #555555;
    transform: scale(0.45);
    transform-origin: center;
    width: fit-content;
    height: fit-content;
}

.stylePreviewCanvas .zone {
    padding: 0 16px;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 16px;
    height: 90px;
}

.stylePreviewCanvas img {
    height: 60px;
}

.stylePreviewCanvas svg.icon {
    height: 60px;
    width: auto;
    display: block;
}

.stylePreviewCanvas .textBox {
    display: flex;
    flex-flow: column nowrap;
    gap: 6px;
}

.stylePreviewCanvas .textCN {
    font-size: 31px;
    font-weight: 400;
    white-space: nowrap;
}

.stylePreviewCanvas .textEN {
    font-size: 20px;
    white-space: nowrap;
}

.stylePreviewCanvas .largeText {
    font-size: 82px;
}

.stylePreviewCanvas .colorBar {
    width: 24px;
    height: 75px;
    margin-top: 15px;
    color: var(--current-line-bg-default);
}

.stylePreviewCanvas .icon, .largeText, .textBox, .colorBar {
    margin-bottom: 0!important;
}

.stylePreviewCanvas .composite {
    gap: 12px!important;
}
/* End */

.rightPanel {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--bg-canvas-container);
}

/* Toast notification */
.toast {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.propertyPanelWrapper {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    z-index: 5;
}

.propertyPanel {
    background: var(--bg-panel);
    padding: 12px;
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    box-sizing: border-box;
}

.propertyPanelTitleRow {
    margin: -12px -12px 4px -12px;
    padding: 6px 12px;
    background: var(--bg-panel);
    color: var(--text-control);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color-dark);
}

.propertyPanelTitleRow h3 {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

.quickActions {
    display: flex;
    gap: 6px;
}

.actionBtn {
    background: var(--bg-canvas-container);
    border: 1px solid var(--border-color-default);
    border-radius: 400px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    color: var(--text-dark);
    line-height: 1.4;

    display: flex;
    align-items: center;
    justify-content: center;
}

#btnLeft, #btnRight {
    width: 23px;
}

.actionBtn:hover:not(:disabled) {
    background: var(--bg-btn-hover);
    border-color: var(--border-color-dark);
}

.actionBtn:active:not(:disabled) {
    background: var(--bg-btn-active);
}

.actionBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btnDelete:hover:not(:disabled) {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: var(--text-light);
}

/* --- Row Actions Bar (Multi-row Management) --- */
.rowActionsBar {
    background: var(--bg-panel);
    padding: 6px 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
    white-space: nowrap;
    width: 100%;
}

.rowActionsBar.active {
    display: flex;
}

.rowActionsBar .rowLabel {
    font-size: 12px;
    color: var(--text-control);
    font-weight: 500;
    user-select: none;
}

.rowActionsBar .rowLabel .divider {
    margin: 0 4px;
    color: var(--text-placeholder);
}

.rowActionsBar .quickActions :nth-child(1), .rowActionsBar .quickActions :nth-child(2) {
    width: 23px;
}

.featureControls {
    display: flex;
    flex-flow: row wrap;
    gap: 10px;
}

.featureGroup {
    display: flex;
    flex-flow: row wrap;
    flex: 1;
    gap: 4px;
    min-width: 100px;
    height: fit-content;
}

.featureGroup h4 {
    width: 100%;
    margin: 0 0 6px 0;
    font-size: 12px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color-dark);
    padding-bottom: 2px;
}

.featureGroup.advancedOptions {
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
    clear: both; /* 避免浮动造成的挤压 */
}

.controlRow {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-control);
    margin-bottom: 4px;
    flex: 1 1 0px;
    min-width: 110px;


}

.controlRow label {
    white-space: nowrap;
    font-size: 12px;
}

.controlRow input[type="text"],
.controlRow select {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 4px;
    border: 1px solid var(--border-color-default);
    font-family: inherit;
    box-sizing: border-box;
    height: 28px;
}

/* HEX color input specific styling */
.controlRow input[type="text"][id$="Hex"] {
    width: 72px;
    flex: none;
    text-align: center;
    font-size: 12px;
}

.controlRow input[type="text"][id$="Hex"].invalid {
    border-color: var(--color-danger);
    background-color: rgba(255, 77, 79, 0.05);
}

.controlRow select {
    max-height: 100px;
    overflow-y: auto;
}

.controlRow input[type="number"] {
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--border-color-default);
    font-family: inherit;
    box-sizing: border-box;
    height: 28px;
}

/* 1. 先设置外层容器的宽高和圆角 */
.controlRow input[type="color"] {
    -webkit-appearance: none;  /* 移除 Chrome/Safari 的默认外观 */
    -moz-appearance: none;     /* 移除 Firefox 的默认外观 */
    appearance: none;
    
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;        /* 核心：变成圆形 */
    cursor: pointer;
    background: transparent;   /* 撑满外框 */
    padding: 0;
}

/* 2. 针对 Chrome、Edge 和 Safari 的内部特定样式重置 */
.controlRow input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;                /* 移除内边距 */
    border-radius: 50%;
}

.controlRow input[type="color"]::-webkit-color-swatch {
    border: 2px solid #ccc;    /* 加个边框更好看 */
    border-radius: 50%;        /* 核心：让内部颜色块也变成圆形 */
}

/* 3. 针对 Firefox 的内部特定样式重置 */
.controlRow input[type="color"]::-moz-color-swatch {
    border: 2px solid #ccc;
    border-radius: 50%;        /* 核心：让 Firefox 的内部颜色块变成圆形 */
}

/* Layout Optimizations for Property Panel */

.controlRow.widthMode {
    flex: none;
}

.controlRow.widthMode input {
    width: 60px;
}

.controlRow.widthMode input::after {
    content: "px";
}

.controlRow.letterSpacing {
    width: fit-content;
    flex-grow: 0;
}

.controlRow.letterSpacing input {
    width: 60px;
}

.canvasViewer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: auto;
    cursor: default;
}

.canvasViewer.dragging {
    cursor: grabbing !important;
}

.canvasViewer::-webkit-scrollbar {
    height: 0px;
    background: transparent;
}

.rightPanel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    background-image: var(--gradient-fade-left), var(--gradient-fade-right);
    background-position: left top, right top;
    background-size: 24px 100%;
    background-repeat: no-repeat;
}

.logo {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;

    user-select: none;
}

.logo img {
    height: 40px;
}

.info {
    display: flex;
    flex-flow: row nowrap;
    text-align: right;
    gap: 8px;
}

.info a {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: var(--bg-header);
    border: 1px solid var(--border-color-btn);
    border-radius: 50%;

    text-decoration: none;
    font-size: 12px;

    transition: all 0.3s;

    cursor: pointer;

    user-select: none;
}

.info a:hover {
    filter: brightness(0.95);
    transition: filter 0.3s;
}

.info a.active {
    background-color: var(--color-active-dark);
    border-color: var(--border-color-dark);
    transition: all 0.3s;
}

.info a.active img {
    filter: brightness(0) invert(1) !important;
}

.info a img {
    height: 24px;
}

.version {
    font-size: 12px;
    color: var(--text-placeholder);
    user-select: none;
}

#canvas {
    position: relative;
    display: flex;
    flex-flow: column nowrap;
    height: auto;
    width: max-content;
    min-width: 88px;
    flex-shrink: 0;
    background-color: var(--bg-canvas-container);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin: auto;
    will-change: transform;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 防止亚像素渲染导致的缝隙 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

#canvas-svg-border {
    position: absolute;
    /* 核心定位：利用 CSS 变量将 SVG 容器外扩到原本的边框区域 */
    top: calc(0px - var(--canvas-border-width-top, 6px));
    left: calc(0px - var(--canvas-border-width-left, 6px));
    right: calc(0px - var(--canvas-border-width-right, 6px));
    bottom: calc(0px - var(--canvas-border-width-bottom, 10px));
    
    width: calc(100% + var(--canvas-border-width-left, 6px) + var(--canvas-border-width-right, 6px)) !important;
    height: calc(100% + var(--canvas-border-width-top, 6px) + var(--canvas-border-width-bottom, 10px)) !important;
    
    pointer-events: none; /* 穿透点击，不影响画布内元素的拖拽和操作 */
    z-index: 10;          /* 保证在最上层作为描边 */
    overflow: visible;
}

/* ========================================
   Component Styles
   ======================================== */

/* --- Category Background and Text Colors --- */
.zone[data-category="enter"] {
    background-color: var(--enter-bg-color, #ffffff);
    color: var(--enter-color, #000000);
}

.zone[data-category="exit"] {
    background-color: var(--exit-bg-color, #FFD701);
    color: var(--exit-color, #000000);
}

.zone[data-category="facility"] {
    background-color: var(--facility-bg-color, #333F48);
    color: var(--facility-color, #ffffff);
}

.zone[data-category="facility"] .icon {
    color: white !important;
}

/* --- Station Name Text Styles --- */
.stationName .textBox {
    margin-top: 11px;
}

.stationName .textBox .textCN {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
}

.stationName .textBox .textEN {
    font-size: 23px;
    font-weight: 700;
    text-align: center;
}


/* --- Exit Info Text Styles --- */
.exitInfo {
    align-self: flex-start;
    margin-top: 17px;
}

.exitInfo .textBox {
    gap: 6px;
}

.exitInfo .textCN {
    font-size: 21px;
    font-weight: 400;
    text-box: trim-both cap alphabetic;
    color: var(--fg-color, inherit);
}

.exitInfo .textEN {
    font-size: 12px;
    color: var(--fg-color, inherit);
}

/* --- Basic Component Styles --- */
.largeText,
.textCN,
.textEN,
.smallTextCN,
.smallTextEN,
.textBox {
    white-space: nowrap;
}

.largeText {
    font-family: var(--large-text-font, 'Noto Sans');
    font-size: 82px;
    font-weight: var(--large-text-weight, 500);
    font-feature-settings: 'pnum' on, 'lnum' on;
    text-box: trim-both cap alphabetic;
    color: var(--fg-color, inherit);
}

.textBox {
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    margin-top: 2px;
}

.smallTextBox {
    display: flex;
    flex-flow: column nowrap;
    gap: 1px;
    margin-bottom: 0;
}

.lineColorTextDouble,
.doubleLineTextBox {
    height: var(--double-line-main-height, var(--canvas-height, 90px));
    position: relative;
    min-width: max-content;
    justify-content: center;
}

.lineColorTextDouble.textBox,
.doubleLineTextBox .textBox {
    gap: 5px;
    align-items: flex-start;
}

.lineColorTextDouble .smallTextBox,
.doubleLineTextBox .smallTextBox {
    position: absolute;
    left: 0;
    bottom: 100%;
    transform: translateY(var(--double-line-small-offset, 8px));
    z-index: 2;
    min-width: 100%;
    align-items: flex-start;
}

.textCN {
    font-size: 33px;
    font-weight: var(--med-text-weight, 400);
    font-family: var(--med-text-font, 'IBM Plex Sans SC');
    text-box: trim-both cap alphabetic;
    color: var(--fg-color, inherit);
}

.textEN {
    font-size: 21px;
    font-family: var(--small-text-font, 'Geist');
    font-weight: var(--small-text-weight, 400);
    color: var(--fg-color, inherit);
}

.smallTextCN {
    font-size: 15px;
    font-weight: var(--med-text-weight, 400);
    font-family: var(--med-text-font, 'IBM Plex Sans SC');
    text-box: trim-both cap alphabetic;
    color: var(--fg-color, inherit);
}

.smallTextEN {
    font-size: 10px;
    font-family: var(--small-text-font, 'Geist');
    font-weight: var(--small-text-weight, 400);
    color: var(--fg-color, inherit);
}

.icon {
    height: 60px;
}

svg.icon {
    height: 60px;
    width: auto;
    display: block;
}

.colorBar {
    width: 24px;
    height: 75px;
    margin-top: 15px;
    color: var(--current-line-bg-default);
}

.dividerBar {
    width: 4px;
    background-color: #333333;
}

.composite {
    display: flex;
    flex-flow: row nowrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

/* --- Column (Row) Container Styles --- */
.column {
    display: flex;
    flex-flow: row nowrap;
    height: var(--canvas-height, 90px);
    width: 100%;
    position: relative;
}

.column:has(.lineColorTextDouble, .doubleLineTextBox) {
    --double-line-main-height: calc(var(--canvas-height, 90px) - var(--double-line-top-space, 0px));
}

/* --- Zone Styles --- */
.zone {
    padding: 0 16px;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 16px;
    height: 100%;
    position: relative;
}

.zone:has(.lineColorTextDouble, .doubleLineTextBox),
#canvas:has(.lineColorTextDouble, .doubleLineTextBox) .zone.doubleLineMode {
    padding-top: var(--double-line-top-space, 0px);
    padding-left: var(--double-line-side-padding, 16px);
    padding-right: var(--double-line-side-padding, 16px);
    gap: var(--double-line-zone-gap, 16px);
    box-sizing: border-box;
}

#canvas:has(.lineColorTextDouble, .doubleLineTextBox) .lineColorTextDouble > .textBox,
#canvas:has(.lineColorTextDouble, .doubleLineTextBox) .doubleLineTextBox > .textBox {
    transform-origin: center;
    scale: var(--double-line-main-scale, 1);
}

#canvas:has(.lineColorTextDouble, .doubleLineTextBox) .zone.doubleLineMode > :not(.lineColorTextDouble):not(.doubleLineTextBox) {
    transform-origin: center;
    scale: var(--double-line-main-scale, 1);
}

.zone:has(.lineColorTextDouble)::before,
.zone:has(.doubleLineTextBox)::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: var(--double-line-top-space, 0px);
    background-color: var(--current-line-bg, inherit);
    pointer-events: none;
    z-index: 0;
}

.zone:has(.lineColorTextDouble) > *,
.zone:has(.doubleLineTextBox) > * {
    z-index: 1;
}

.zone:empty {
    min-width: 120px;
    border: 2px dashed currentColor;
    opacity: 0.65;
    box-sizing: border-box;
}

.zone.lineColor {
    --current-line-bg: var(--current-line-bg-default);
    background-color: var(--current-line-bg);
    --fg-color: var(--bg-canvas-container);
}

.zone.lineColor .largeText,
.zone.lineColor .textCN,
.zone.lineColor .textEN {
    color: var(--bg-canvas-container) !important;
}

.zone.lineColor img,
.zone.lineColor .icon {
    color: white !important;
}

/* Components List Styles */

.componentGroup.enter .componentThumbnail {
    background: linear-gradient(0deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.5)), #fff;
}

.componentGroup.exit .componentItem {
    background-color: #FFD701;
}

.componentGroup.exit .componentThumbnail {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)), #FFD701;
}

.componentGroup.facility .componentItem {
    background-color: #333F48;
    color: #ffffff;
}

.componentGroup.facility .componentThumbnail {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)), #333F48;
}

.componentGroup.facility .componentThumbnail .icon,
.componentGroup.facility .componentThumbnail svg.icon {
    color: white !important;
}

/* ========================================
   End of Component Styles
   ======================================== */

.insert-line {
    position: absolute;
    width: 4px;
    background: var(--current-line-bg-default);
    display: none;
    pointer-events: none;
    z-index: 9999;
}

.selected {
    outline: 2px solid var(--color-accent) !important;
    outline-offset: 2px;
    z-index: 10;
}

.zoomControl {
    display: flex;
    flex-flow: row nowrap;
    height: 32px;
    align-items: center;
    position: absolute;
    right: 24px;
    bottom: 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color-light);
    overflow: hidden;
    z-index: 10;
}

.zoomControl button {
    width: 32px;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-control);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.zoomControl button:hover:not(:disabled) {
    background: var(--bg-panel);
    color: var(--color-active-dark);
}

.zoomControl button:active:not(:disabled) {
    background: var(--bg-btn-hover);
}

.zoomControl button:disabled {
    color: var(--border-color-default);
    cursor: not-allowed;
}

.zoomControl div {
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    min-width: 44px;
    text-align: center;
    border-left: 1px solid var(--border-color-panel);
    border-right: 1px solid var(--border-color-panel);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel-light);
    user-select: none;
}

.effectsControl {
    display: flex;
    flex-flow: row nowrap;
    gap: 6px;
    height: 32px;
    align-items: center;
    position: absolute;
    left: 24px;
    bottom: 24px;
    overflow: hidden;
    z-index: 10;
}

.effectsControl button {
    height: 100%;
    border: 1px solid var(--border-color-light);
    background: var(--bg-panel);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-control);
    padding: 0 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    border-right: 1px solid var(--border-color-panel);
}

.effectsControl button:last-child {
    border-right: none;
}

.effectsControl button:hover {
    background: var(--bg-panel);
    color: var(--color-active-dark);
}

.effectsControl button.active {
    background: var(--color-active-dark);
    color: var(--bg-canvas-container);
}

.styleSettings {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    flex-flow: row nowrap;
    gap: 10px;
    z-index: 10;
    box-sizing: border-box;
}

.styleSetting {
    display: flex;
    flex-flow: column nowrap;
    gap: 4px;
    font-size: 12px;
    color: var(--text-dark);
}

.styleSetting span {
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted);
}

.styleSetting select {
    width: 180px;
    padding: 4px;
    font-size: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

.canvasSizeSelectWrapper {
    display: flex;
    gap: 10.5px;
    align-items: center;
}

#canvasCustomWidthInput {
    width: 75px;
    height: 25px;
    padding: 0 4px;
    font-size: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color-light);
    font-family: inherit;
    outline: none;
}

.projectInfo {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-flow: column nowrap;
    align-items: flex-end;
    text-align: right;
    z-index: 10;
    font-size: 14px;
    box-sizing: border-box;
}

.projectTitle {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    min-width: 80px;
    outline: none;
}

.projectTitle:hover,
.projectTitle:focus {
    background-color: var(--bg-panel);
}

.projectActions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.projectActions button {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-control);
    cursor: pointer;
    padding: 0px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.projectActions button:hover {
    background: var(--bg-panel);
    color: var(--color-active-dark);
}

.projectActions .divider {
    color: var(--text-placeholder);
    user-select: none;
}

.exportWrapper {
    position: relative;
}

.exportDropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-canvas-container);
    border: 1px solid var(--border-color-light);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    flex-flow: column nowrap;
    z-index: 20;
    margin-top: 4px;
    overflow: hidden;
}

.exportDropdown.show {
    display: flex;
}

.exportDropdown button {
    text-align: left;
    padding: 8px 12px;
    width: 100%;
    border-radius: 0;
    white-space: nowrap;
    font-family: "Geist", "IBM Plex Sans SC", sans-serif;
}

.exportDropdown button:hover {
    background: var(--bg-main);
}

.saveWrapper {
    position: relative;
}

.saveDropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-canvas-container);
    border: 1px solid var(--border-color-light);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    flex-flow: column nowrap;
    z-index: 20;
    margin-top: 4px;
    overflow: hidden;
}

.saveDropdown.show {
    display: flex;
}

.saveDropdown button {
    text-align: left;
    padding: 8px 12px;
    width: 100%;
    border-radius: 0;
    white-space: nowrap;
    font-family: "Geist", "IBM Plex Sans SC", sans-serif;
}

.saveDropdown button:hover {
    background: var(--bg-main);
}

.hanger {
    position: absolute;
    bottom: calc(100% + 2px);
    left: 20%;
    width: var(--hanger-width, 15px);
    height: var(--hanger-height, 120px);
    background: var(--hanger-bg, var(--bg-panel-dark));
    display: none;
    z-index: 1;
}

.hanger.right-hanger {
    left: auto;
    right: 20%;
}

.hanger.active {
    display: block;
}

.hanger .fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hanger-fade);
    display: none;
    pointer-events: none;
}

.hanger .fade-overlay.active {
    display: block;
}

.lighting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('icon/lighting.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    mix-blend-mode: hard-light;
    opacity: 0.3;
    pointer-events: none;
    display: none;
    z-index: 999;
}

.lighting-overlay.active {
    display: block;
}

.optionListGrid {
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
}

.optionBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-canvas-container);
    padding: 4px 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
    font-family: inherit;
    line-height: 1.4;
}

.optionBtn:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-color-dark);
}

.optionBtn:disabled {
    background-color: var(--bg-btn-disabled);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.optionBtn.active {
    background: var(--color-active-dark);
    color: var(--bg-canvas-container);
    border-color: var(--color-active-dark);
}

/* Upload Icon Button Styles */
.uploadIconBtn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color-default);
    background: var(--bg-canvas-container);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.uploadIconBtn:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-color-dark);
}

.uploadIconBtn img,
.uploadIconBtn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.settingsBtnWrapper {
    display: none;
    flex-flow: row nowrap;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-color-default);
}

.settingsBtnWrapper.active {
    display: flex;
}

.settingsBtnWrapper button {
    padding: 2px 8px;
    background: var(--bg-canvas-container);
    border: 1px solid var(--border-color-default);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.settingsBtnWrapper button:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-color-dark);
}

.settingsBtnWrapper button#btnResetSettings {
    background: var(--color-danger);
    color: var(--bg-canvas-container);
    border-color: var(--color-danger);
}

.settingsBtnWrapper button#btnResetSettings:hover {
    filter: brightness(0.95);
}

.settingsBtnWrapper button#btnSaveSettings {
    background: var(--color-active-dark);
    color: var(--bg-canvas-container);
    border-color: var(--color-active-dark);
}

.settingsBtnWrapper button#btnSaveSettings:hover {
    background: #000000;
    border-color: #000000;
}

.settingsWrapper {
    display: flex;
    flex-flow: column nowrap;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--border-color-default);
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

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

.settingsWrapper::-webkit-scrollbar-thumb {
    background-color: var(--border-color-default);
    border-radius: 4px;
    border-right: 2px solid transparent;
    background-clip: padding-box;
}

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

.settingsGroup {
    display: flex;
    flex-flow: column nowrap;
    gap: 10px;
}

.settingsGroup h3 {
    margin: 0;
    padding: 2px 6px;
    background: var(--bg-header);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.settingsGroup h4 {
    margin: 8px 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.settingsPanel > h2 {
    margin: 0;
    padding: 8px 12px;
    background: var(--bg-header);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.settingsPanel > span {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -4px;
}

.settingsGroup h4 {
    margin: 8px 0 4px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
}

.settingsPanel > h2 {
    margin: 0;
    padding: 8px 12px;
    background: var(--bg-header);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.settingsPanel > span {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -4px;
}

.dot-divider-v {
    width: 12px;
    height: 100%;
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
}

.dot-divider-h {
    width: 100%;
    height: 12px;
    background-image: url(icon/ellipse.svg);
    background-repeat: repeat;
}

/* ========================================
   Export Popup & Toast Styles
   ======================================== */

.popupWrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.popupWrapper.active {
    display: flex;
}

.exportPopup {
    background: var(--bg-canvas-container);
    padding: 32px 48px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 320px;
    max-width: 480px;
}

.exportTitle {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.exportText {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    width: 32em;
}

#cancelExportBtn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color-default);
    color: var(--text-dark);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

#cancelExportBtn:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-color-dark);
}

#cancelExportBtn:active {
    background: var(--bg-btn-active);
}

.creditList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 4px;
}

.creditInfo {
    display: flex;
    flex-flow: row nowrap;
    gap: 4px;
}

.creditInfo img {
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color-default);
}

.creditExtraInfo {
    font-size: 13px;
    text-align: center;
}
