:root {
    /* 主题与面板基础颜色 */
    --bg-main: #f9f9f9;
    --bg-canvas-container: #FFFFFF;
    --bg-panel: #f0f0f0;
    --bg-panel-light: #fafafa;
    --bg-panel-dark: #333F49;
    --bg-item-hover: #F3F3F3;
    --bg-btn-hover: #e6e6e6;
    --bg-btn-active: #cccccc;
    --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;
}

#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;
}

#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;
}

.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;
}

.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;
}

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

.propertyPanel {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    max-height: 280px;
    background: var(--bg-panel);
    padding: 12px;
    display: flex;
    flex-flow: column nowrap;
    gap: 8px;
    z-index: 5;
    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;
}

#btnLeft, #btnRight {
    padding: 2px 4px;
}

.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);
}

.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: 80px;


}

.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;
}

.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;
}

.controlRow input[type="color"] {
    width: 32px;
    height: 28px;
    border: 1px solid var(--border-color-default);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.presetLineGrid {
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--border-color-panel);
    background: var(--bg-panel-light);
}

.presetLineBtn {
    display: inline-flex;
    align-items: center;
    background: var(--bg-canvas-container);
    border: 1px solid var(--border-color-btn);
    padding: 3px 6px;
    font-size: 12px;
    cursor: pointer;
    min-width: 76px;
    box-sizing: border-box;
}

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

.canvasViewer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    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;
}

.logo img {
    height: 40px;
}

.info {
    display: flex;
    flex-flow: column nowrap;
    text-align: right;
}

.info span {
    font-size: 10px;
    color: var(--text-placeholder);
}

.info a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
}

#canvas {
    position: relative;
    display: flex;
    flex-flow: row nowrap;
    height: 90px;
    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;
}

#canvas::after {
    content: '';
    position: absolute;
    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));
    border-color: var(--canvas-border-color, var(--canvas-border-default));
    border-width: var(--canvas-border-width, 6px 6px 10px 6px);
    border-style: var(--canvas-border-style, solid);
    border-radius: inherit;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

.largeText,
.textCN,
.textEN,
.textBox {
    white-space: nowrap;
}

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

.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 {
    filter: brightness(0) invert(1) !important;
}

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

.icon {
    height: 56px;
}

.largeText {
    font-family: 'Noto Sans';
    font-size: 77px;
    font-weight: 500;
    letter-spacing: -0.03em;
    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: 6px;
    margin-top: 3px;
}

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

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

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

.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: 8px;
    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: 120px;
    padding: 4px;
    font-size: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    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);
}

.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: soft-light;
    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.active {
    background: var(--color-active-dark);
    color: var(--bg-canvas-container);
    border-color: var(--color-active-dark);
}