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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background: #f5f0e6;
    color: #333;
}

/* 工具栏 - 浅色主题 */
.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e0dcd4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-weight: 700;
    font-size: 15px;
    color: #8b7355;
    letter-spacing: -0.3px;
}

.vista-name {
    font-size: 14px;
    color: #666;
    padding: 6px 12px;
    background: #f5f0e6;
    border-radius: 6px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.vista-name:hover {
    background: #ebe5d9;
    color: #333;
}

.vista-name.editing {
    background: #fff;
    border-color: #8b7355;
    outline: none;
    cursor: text;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.tool-group {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f8f6f2;
    border-radius: 8px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.15s;
}

.tool-btn:hover {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-btn.active {
    background: #8b7355;
    color: #fff;
    box-shadow: 0 2px 4px rgba(139, 115, 85, 0.3);
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #8b7355;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.share-btn:hover {
    background: #755f47;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

.share-btn svg {
    stroke: #fff;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #e0dcd4;
}

.fit-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e0dcd4;
    background: #f8f6f2;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.15s;
}

.fit-btn:hover {
    background: #fff;
    color: #8b7355;
    border-color: #8b7355;
}

.zoom-display {
    font-size: 13px;
    color: #888;
    min-width: 50px;
    text-align: center;
    font-weight: 500;
}

.connection-status {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.connection-status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.connection-status.disconnected {
    background: #ffebee;
    color: #c62828;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f6f2;
    border: 1px solid #e0dcd4;
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-btn:hover {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #e0dcd4;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    display: none;
}

.dropdown-menu.visible {
    display: block;
}

.dropdown-item {
    padding: 10px 18px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #f5f0e6;
}

.dropdown-divider {
    height: 1px;
    background: #e0dcd4;
    margin: 6px 0;
}

.dropdown-section-title {
    padding: 8px 18px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-vistas {
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item.empty-hint {
    color: #999;
    font-style: italic;
    cursor: default;
}

.dropdown-item.empty-hint:hover {
    background: transparent;
}

.dropdown-item.vista-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item.vista-item::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #d4c9b8;
    border-radius: 2px;
    flex-shrink: 0;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e0dcd4;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid #e0dcd4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 弹窗表单 */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: #f8f6f2;
    border: 1px solid #e0dcd4;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    outline: none;
    transition: all 0.15s;
}

.form-input:focus {
    border-color: #8b7355;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.btn-primary {
    background: #8b7355;
    color: #fff;
}

.btn-primary:hover {
    background: #755f47;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

.btn-secondary {
    background: #f5f0e6;
    color: #666;
    border: 1px solid #e0dcd4;
}

.btn-secondary:hover {
    background: #ebe5d9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 画布列表 */
.vista-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vista-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f6f2;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.vista-list-item:hover {
    background: #f0ebe0;
}

.vista-list-item.selected {
    background: #fff;
    border-color: #8b7355;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.15);
}

.vista-item-info {
    flex: 1;
}

.vista-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.vista-item-date {
    font-size: 12px;
    color: #888;
}

.vista-item-actions {
    display: flex;
    gap: 8px;
}

.vista-item-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e0dcd4;
    border-radius: 6px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.vista-item-btn:hover {
    background: #f5f0e6;
    color: #333;
}

.vista-item-btn.delete:hover {
    background: #ffebee;
    border-color: #e74c3c;
    color: #e74c3c;
}

.empty-message {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 200px;
    background: #fff;
    border-right: 1px solid #e0dcd4;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s, transform 0.2s;
}

.sidebar.collapsed {
    width: 48px;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e0dcd4;
}

.sidebar.collapsed .sidebar-header {
    padding: 12px 8px;
}

.sidebar-new-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #8b7355;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.sidebar-new-btn:hover {
    background: #755f47;
}

.sidebar.collapsed .sidebar-new-btn {
    padding: 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-new-btn span {
    display: none;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.1s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: #f5f0e6;
}

.sidebar-item.active {
    background: #f5f0e6;
    color: #333;
    font-weight: 500;
    border-left-color: #8b7355;
}

.sidebar-item-icon {
    width: 8px;
    height: 8px;
    background: #d4c9b8;
    border-radius: 2px;
    flex-shrink: 0;
}

.sidebar-item.active .sidebar-item-icon {
    background: #8b7355;
}

.sidebar-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-item-name {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 10px;
    border-left: none;
}

.sidebar.collapsed .sidebar-item.active {
    background: #f5f0e6;
    border-radius: 6px;
    margin: 2px 6px;
    padding: 8px;
}

.sidebar.collapsed .sidebar-item-icon {
    width: 10px;
    height: 10px;
}

.sidebar-empty {
    padding: 20px 16px;
    color: #999;
    font-size: 12px;
    text-align: center;
}

.sidebar.collapsed .sidebar-empty {
    display: none;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid #e0dcd4;
}

.sidebar.collapsed .sidebar-footer {
    padding: 8px 6px;
}

.sidebar-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    border: 1px solid #e0dcd4;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}

.sidebar-toggle:hover {
    background: #f5f0e6;
    color: #555;
}

.sidebar.collapsed .sidebar-toggle {
    border-color: transparent;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* 侧边栏右键菜单 */
.sidebar-context-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
}

.sidebar-context-item:hover {
    background: #f5f0e6;
}

/* 画布容器 */
.vista-container {
    position: fixed;
    top: 52px;
    left: 200px;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #f5f0e6;
    cursor: grab;
    transition: left 0.2s;
}

.vista-container.sidebar-collapsed {
    left: 48px;
}

.vista-container.grabbing {
    cursor: grabbing;
}

.vista-container.drawing {
    cursor: crosshair;
}

/* 画布 */
.vista {
    position: absolute;
    width: 10000px;
    height: 10000px;
    background-image:
        radial-gradient(circle, #d4c9b8 1px, transparent 1px);
    background-size: 20px 20px;
    transform-origin: 0 0;
}

/* 元素通用样式 */
.element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.element.selected {
    outline: 2px solid #8b7355;
    outline-offset: -2px;
}


.element.selected .resize-handles {
    display: block;
}

/* 调整大小手柄 */
.resize-handles {
    display: none;
}

.resize-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #8b7355;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 100;
}

.resize-handle:hover {
    background: #8b7355;
    border-color: #6b5a45;
}

.resize-handle.nw { top: -8px; left: -8px; cursor: nwse-resize; }
.resize-handle.ne { top: -8px; right: -8px; cursor: nesw-resize; }
.resize-handle.sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.resize-handle.se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.resize-handle.n { top: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.s { bottom: -8px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle.w { top: 50%; left: -8px; transform: translateY(-50%); cursor: ew-resize; }
.resize-handle.e { top: 50%; right: -8px; transform: translateY(-50%); cursor: ew-resize; }

/* Frame 样式 */
.element-frame {
    background: #fff;
    border-radius: 12px;
    min-width: 100px;
    min-height: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0dbd2;
}

.element-frame .frame-label {
    position: absolute;
    top: -70px;
    left: 0;
    font-size: 40px;
    font-weight: 700;
    color: #6b5a45;
    white-space: nowrap;
    background: linear-gradient(135deg, #8b7355 0%, #a08668 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: text;
    min-width: 20px;
    outline: none;
    border-radius: 3px;
    padding: 2px 4px;
}

.element-frame .frame-label[contenteditable="true"] {
    background: #fff;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: #6b5a45;
    background-clip: border-box;
    border: 1px solid #8b7355;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.2);
}

/* Section 样式 */
.element-section {
    border: 2px dashed #a89880;
    border-radius: 10px;
    min-width: 150px;
    min-height: 100px;
    background: rgba(139, 115, 85, 0.08);
}

.element-section .section-label {
    position: absolute;
    top: -28px;
    left: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7a6a55;
    white-space: nowrap;
    padding: 2px 8px;
    background: #f5f0e6;
    border-radius: 4px;
    cursor: text;
    min-width: 20px;
    outline: none;
}

.element-section .section-label[contenteditable="true"] {
    border: 1px solid #a89880;
    box-shadow: 0 2px 8px rgba(139, 115, 85, 0.2);
}

/* Text 样式 */
.element-text {
    min-width: 50px;
    min-height: 24px;
    padding: 8px;
    font-size: 16px;
    color: #333;
    background: transparent;
}

.element-text.editing {
    outline: 1px solid #8b7355;
    cursor: text;
}

.element-text .text-content {
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Image 样式 */
.element-image {
    min-width: 50px;
    min-height: 50px;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border: 1px solid #8b7355;
    box-sizing: border-box;
}

.element-image.selected {
    outline: none !important;
    border: 1px solid #5a4a35;
}

.element-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

/* 图片的 resize handles 紧贴边框 */
.element-image .resize-handle {
    width: 8px;
    height: 8px;
    background: #8b7355;
    border: none;
    border-radius: 0;
}

.element-image .resize-handle.nw { top: -4px; left: -4px; }
.element-image .resize-handle.ne { top: -4px; right: -4px; }
.element-image .resize-handle.sw { bottom: -4px; left: -4px; }
.element-image .resize-handle.se { bottom: -4px; right: -4px; }
.element-image .resize-handle.n { top: -4px; }
.element-image .resize-handle.s { bottom: -4px; }
.element-image .resize-handle.w { left: -4px; }
.element-image .resize-handle.e { right: -4px; }

.element-image .image-label {
    position: absolute;
    top: -28px;
    left: 0;
    font-size: 13px;
    font-weight: 600;
    color: #7a6a55;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f5f0e6;
    cursor: text;
    min-width: 20px;
    outline: none;
    z-index: 10;
    pointer-events: auto;
}

.element-image .image-label.hidden {
    opacity: 0;
    pointer-events: auto;
}

.element-image .image-label.hidden:hover {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.6);
}

.element-image .image-label:focus,
.element-image.editing .image-label {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.element-image .image-label:hover:not(.hidden) {
    background: rgba(255, 255, 255, 0.7);
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #e0dcd4;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
}

.context-menu.visible {
    display: block;
}

.context-menu-item {
    padding: 10px 18px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
}

.context-menu-item:hover {
    background: #f5f0e6;
}

.context-menu-divider {
    height: 1px;
    background: #e0dbd2;
    margin: 4px 0;
}

/* 图片裁剪模式 */
.element-image.cropping {
    border: 1px solid #8b7355 !important;
    overflow: visible !important;
}

/* 裁剪模式下隐藏 resize handles */
.element-image.cropping .resize-handles {
    display: none !important;
}

/* 裁剪框容器 */
.crop-box-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

/* 裁剪遮罩（变暗区域） */
.crop-mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.crop-mask-top { top: 0; left: 0; right: 0; height: 0; }
.crop-mask-bottom { left: 0; right: 0; bottom: 0; }
.crop-mask-left { left: 0; width: 0; }
.crop-mask-right { right: 0; }

/* 裁剪区域 */
.crop-area {
    position: absolute;
    border: 1px solid #8b7355;
    box-sizing: border-box;
    pointer-events: auto;
}

.crop-handles-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* 四角手柄 */
.crop-handle-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #8b7355;
    pointer-events: auto;
}

.crop-handle-corner.nw {
    top: -2px;
    left: -2px;
    cursor: nwse-resize;
}

.crop-handle-corner.ne {
    top: -2px;
    right: -2px;
    cursor: nesw-resize;
}

.crop-handle-corner.sw {
    bottom: -2px;
    left: -2px;
    cursor: nesw-resize;
}

.crop-handle-corner.se {
    bottom: -2px;
    right: -2px;
    cursor: nwse-resize;
}

/* 四边手柄 */
.crop-handle-edge {
    position: absolute;
    background: #8b7355;
    pointer-events: auto;
}

.crop-handle-edge.n {
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    cursor: ns-resize;
}

.crop-handle-edge.s {
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    cursor: ns-resize;
}

.crop-handle-edge.w {
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    cursor: ew-resize;
}

.crop-handle-edge.e {
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    cursor: ew-resize;
}

/* 选择框 */
.selection-box {
    position: absolute;
    border: 1px solid #8b7355;
    background: rgba(139, 115, 85, 0.1);
    pointer-events: none;
}

/* 拖拽预览 */
.drag-preview {
    position: absolute;
    border: 2px dashed #8b7355;
    background: rgba(139, 115, 85, 0.1);
    pointer-events: none;
    border-radius: 8px;
}

/* ==================== 项目分组样式 ==================== */
.sidebar-project {
    margin-bottom: 2px;
}

.sidebar-project-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    gap: 8px;
    margin: 0 8px;
    transition: background 0.1s;
}

.sidebar-project-header:hover {
    background: rgba(139, 115, 85, 0.08);
}

.sidebar-project.current .sidebar-project-header {
    background: rgba(139, 115, 85, 0.12);
}

.expand-icon {
    font-size: 10px;
    color: #999;
    width: 12px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.project-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #8b7355;
    color: white;
    border-radius: 4px;
    flex-shrink: 0;
}

.project-count {
    font-size: 11px;
    color: #999;
    background: #f0ebe0;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-project-vistas {
    padding-left: 8px;
}

.sidebar-project-vistas .sidebar-item {
    padding: 8px 12px 8px 28px;
    font-size: 12px;
    border-left: none;
    margin: 0 8px;
    border-radius: 4px;
}

.sidebar-project-vistas .sidebar-item:hover {
    background: rgba(139, 115, 85, 0.06);
}

.sidebar-project-vistas .sidebar-item.active {
    background: rgba(139, 115, 85, 0.12);
    border-left: none;
}

.sidebar-empty-project {
    padding: 8px 12px 8px 36px;
    color: #999;
    font-size: 11px;
    font-style: italic;
}

/* 侧边栏收起时隐藏项目分组 */
.sidebar.collapsed .sidebar-project-header .project-name,
.sidebar.collapsed .sidebar-project-header .project-badge,
.sidebar.collapsed .sidebar-project-header .project-count,
.sidebar.collapsed .sidebar-project-vistas {
    display: none;
}

.sidebar.collapsed .sidebar-project-header {
    justify-content: center;
    padding: 10px;
    margin: 0 4px;
}

.sidebar.collapsed .sidebar-project-header .expand-icon {
    font-size: 12px;
}

/* ==================== 用户显示 ==================== */

.user-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-display .username {
    font-size: 13px;
    color: #666;
}

.user-display .login-btn {
    background: #8b7355;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-display .login-btn:hover {
    background: #7a6548;
}

.user-display .logout-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.user-display .logout-btn:hover {
    color: #666;
}

/* ==================== 登录弹窗 ==================== */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.auth-modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-modal-content h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
    font-size: 20px;
}

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

.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.auth-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #8b7355;
}

.auth-error {
    color: #e53935;
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: #8b7355;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-submit-btn:hover {
    background: #7a6548;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #666;
}

.auth-switch a {
    color: #8b7355;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}
