/* ==========================================
   品牌字体加载
   ========================================== */
@font-face {
    font-family: 'MiSans';
    src: url('/fonts/MiSans VF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: '喜鹊招牌体';
    src: url('/fonts/喜鹊招牌体-REGULAR.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: '喜鹊聚珍体';
    src: url('/fonts/喜鹊聚珍体.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* NotoSansCJK 作为统一字体族（保持兼容性） */
@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-DemiLight.otf') format('opentype');
    font-weight: 350;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
}

/* NotoSansCJK 各变体作为独立字体族（用于下拉选择） */
@font-face {
    font-family: 'NotoSansCJK-Regular';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-Bold';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-Light';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Light.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-Medium';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Medium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-Black';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Black.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-DemiLight';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-DemiLight.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK-Thin';
    src: url('/fonts/CouPang平台韩文字体/NotoSansCJK-Thin.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #4a90e2;
    --accent-color: #4a90e2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-color: #f5ebe0;
    --card-bg: #ffffff;
    --border-color: #e8dfd5;
    --text-primary: #2d2d2d;
    --text-secondary: #666;
    --chat-input-height: 100px;
    --sidebar-width: 260px;
    --cream-bg: #f5ebe0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--cream-bg);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* ==========================================
   左侧导航栏
   ========================================== */
.app-sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
}

.nav-section-title {
    padding: 12px 15px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: #f5f5f5;
    color: var(--text-primary);
}

.nav-item.active {
    background: #e6f0ff;
    color: #4a90e2;
    font-weight: 500;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    flex: 1;
    font-size: 14px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.main-container {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.page {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--cream-bg);
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ==========================================
   Home Page
   ========================================== */
#home-page {
    display: none;
    line-height: 1.6;
    height: 100vh;
    padding-top: 40px;
    background: var(--cream-bg);
}

#home-page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 235, 224, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 10;
}

.home-brand {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.home-history-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.85);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.home-history-btn:hover {
    border-color: rgba(102, 126, 234, 0.35);
    box-shadow: 0 6px 18px rgba(102,126,234,0.12);
}

.hero-container {
    width: 100%;
    max-width: 980px;
    padding: 40px 20px 30px;
    text-align: center;
}

.hero-title {
    font-size: 2.15rem;
    margin-bottom: 30px;
    color: #2d2d2d;
    position: relative;
    display: inline-block;
    font-weight: 600;
}

.agent-badge {
    display: inline-block;
    background: #4a90e2;
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 8px;
}

/* AI 对话输入区域 */
.chat-input-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 40px;
}

.chat-input-box {
    background: white;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.chat-input-box:focus-within {
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
}

.chat-plus-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-plus-btn:hover {
    background: #f5f5f5;
    color: #4a90e2;
}

.chat-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.6;
    font-family: inherit;
}

.chat-textarea::placeholder {
    color: #999;
}

.chat-send-btn {
    padding: 8px 24px;
    border-radius: 10px;
    background: #111827;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #000;
    transform: translateY(-1px);
}

.chat-send-btn:active {
    transform: translateY(0);
}

/* 首页多图片预览 */
.home-images-preview {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-preview-item {
    position: relative;
    flex-shrink: 0;
}

.home-preview-item img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 2px solid #e0e0e0;
}

.home-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.home-image-remove:hover {
    background: #cc0000;
    transform: scale(1.15);
}

.home-image-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.chat-plus-btn {
    position: relative;
}

.chat-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-image-remove:hover {
    background: #ff4444;
    transform: scale(1.1);
}

/* 对话结果模态框 */
.chat-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.chat-result-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.chat-result-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-result-close:hover {
    background: #ff4444;
    color: white;
}

.chat-result-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.chat-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================
   AI 对话页面布局
   ========================================== */
#chat-page {
    padding: 0;
    overflow: hidden;
}

.chat-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* 左侧对话历史 */
.chat-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.chat-back-btn:hover {
    background: #f5f5f5;
    color: var(--text-primary);
}

.chat-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.chat-new-btn:hover {
    background: #000;
}

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-history-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.chat-history-item:hover {
    background: #f9f9f9;
    border-color: var(--border-color);
}

.chat-history-item.active {
    background: #e6f0ff;
    border-color: #4a90e2;
}

.chat-history-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 30px;
    cursor: pointer;
}

.chat-history-time {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.chat-history-delete {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-history-item:hover .chat-history-delete {
    display: flex;
}

.chat-history-delete:hover {
    background: #ffebee;
    color: #ff4444;
}

/* 右侧对话区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--cream-bg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.chat-avatar.user {
    background: #718096;
}

.chat-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.chat-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    display: inline-block;
    max-width: fit-content;
    word-wrap: break-word;
    word-break: break-word;
}

.chat-message.user .chat-bubble {
    background: #4a90e2;
    color: white;
}

.chat-image {
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.chat-image img {
    width: 100%;
    display: block;
    border-radius: 12px;
}

/* 多图片网格布局 */
.chat-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
    max-width: 500px;
}

.chat-images-grid .chat-image {
    margin-top: 0;
}

/* 两张图片时使用特殊布局 */
.chat-images-grid:has(.chat-image:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
}

.chat-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: var(--text-secondary);
}

.chat-loading-dots {
    display: flex;
    gap: 4px;
}

.chat-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 1.4s infinite;
}

.chat-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 80%, 100% {
        opacity: 0.3;
    }
    40% {
        opacity: 1;
    }
}

/* 对话页面输入框 */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

/* 当前工作图片提示 */
.working-image-hint {
    max-width: 900px;
    margin: 0 auto 12px auto;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 10px 12px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.working-image-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.working-image-hint img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.working-image-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.working-image-icon {
    font-size: 20px;
}

.working-image-text {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.working-image-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.working-image-remove:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.chat-input-wrapper-page {
    max-width: 900px;
    margin: 0 auto;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.chat-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-attach-btn:hover {
    background: white;
    color: #4a90e2;
}

/* 多图片预览容器 */
.chat-page-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-right: 8px;
    max-width: 400px;
}

.chat-page-preview-item {
    position: relative;
    flex-shrink: 0;
}

.chat-page-preview-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 2px solid #e0e0e0;
}

.chat-page-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chat-page-preview-remove:hover {
    background: #cc0000;
    transform: scale(1.1);
}

/* 图片数量徽章 */
.image-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #667eea;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chat-attach-btn {
    position: relative;
}

.chat-page-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.6;
    font-family: inherit;
}

.chat-page-textarea::placeholder {
    color: #999;
}

.chat-page-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #4a90e2;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-page-send-btn:hover {
    background: #3a80d2;
}

.chat-page-send-btn:active {
    transform: scale(0.95);
}

.hero-input-wrapper {
    width: 100%;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s;
}

.hero-input-wrapper:focus-within {
    border-color: rgba(102, 126, 234, 0.35);
    box-shadow: 0 18px 48px rgba(102, 126, 234, 0.18);
}

.hero-plus-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f1f4ff;
    border: 1px solid rgba(102,126,234,0.18);
    color: var(--accent-color);
    cursor: pointer;
    font-size: 22px;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hero-plus-btn:hover {
    background: #e9eeff;
    border-color: rgba(102,126,234,0.35);
}

.hero-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    padding: 6px 4px;
}

.hero-send-btn-black {
    height: 40px;
    padding: 0 18px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hero-send-btn-black:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(17,24,39,0.18);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    justify-content: flex-start;
    flex-shrink: 0; /* 防止标题区域被压缩 */
    min-height: 24px; /* 确保标题区域高度一致 */
}

.section-indicator {
    width: 3px;
    height: 18px;
    border-radius: 2px;
    background: #ff6b35;
}

.section-header h3 {
    margin: 0;
    color: #2d2d2d;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
}

.features-section h3 {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

/* 功能卡片横向容器 */
/* 快捷功能区域：单独占据全宽，放在下方 */
.quick-functions-section {
    width: 100%;
    max-width: 100%; /* 移除最大宽度限制，利用全屏宽度 */
    padding: 30px 60px; /* 增加左右内边距，利用更多空间 */
    margin: 40px auto 50px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.function-sections-row {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    margin-bottom: 50px;
    display: flex;
    gap: 20px;
    align-items: stretch; /* 让所有区域高度一致 */
}

/* 单个功能区域 */
.function-section {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    height: 100%; /* 让所有区域高度一致 */
}

/* 合并后的区域：占据全宽 */
.function-section.merged-section {
    width: 100%;
    flex: 1;
    min-width: auto;
}

/* 下拉功能区域 */
.dropdown-section {
    overflow: visible;
}

/* 悬停时的效果 */
.dropdown-section:hover {
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

/* 当下拉菜单显示时，给父容器添加额外样式 */
.dropdown-section:hover .section-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 紧凑的功能网格（2x2布局） */
.features-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex: 1; /* 让网格填充可用空间 */
    align-content: start; /* 从顶部开始对齐 */
}

/* 合并后的网格：5个按钮，5列布局 */
.features-grid-compact.merged-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* 快捷功能区域：5列2行布局 */
.quick-functions-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto; /* 自动高度，由内容决定 */
    gap: 32px 24px; /* 行间距32px，列间距24px（稍微增大） */
    width: 100%;
    max-width: 1800px; /* 增大最大宽度，让按钮更大 */
    margin: 0 auto; /* 居中显示 */
}

/* 快捷功能卡片包装器 */
.quick-functions-grid .feature-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 快捷功能标题：放在左上角外部 */
.quick-functions-grid .feature-title {
    font-size: 1rem;
    color: #2d2d2d;
    font-weight: 500;
    margin: 0 0 8px 0;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    width: fit-content;
    z-index: 2;
}

.quick-functions-grid .feature-title:hover {
    background: #4a90e2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* 合并网格中的按钮：统一大小 */
.merged-grid .feature-card {
    min-height: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 响应式：合并网格在小屏幕上自适应 */
@media (max-width: 1024px) {
    .merged-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .merged-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .merged-grid {
        grid-template-columns: 1fr;
    }
}

/* 下拉菜单容器 */
.features-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid rgba(74, 144, 226, 0.2);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 400px;
    overflow-y: auto;
    pointer-events: none;
}

/* 悬停时显示下拉菜单 */
.dropdown-section:hover .features-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 为下拉菜单添加箭头指示器 */
.features-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.1));
}

/* 下拉菜单滚动条样式 */
.features-dropdown::-webkit-scrollbar {
    width: 6px;
}

.features-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.features-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.features-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.features-grid-home {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Features Grid */
.features-section {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: rgba(74, 144, 226, 0.3);
}

/* 紧凑布局中的卡片样式 */
.features-grid-compact .feature-card {
    padding: 20px 16px;
    background: #f8f9fa;
    border: 1px solid #e8e9eb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 110px; /* 确保按钮有足够高度，统一高度 */
}

/* 快捷功能区域的卡片样式 */
.quick-functions-grid .feature-card {
    padding: 0; /* 移除内边距，让视频占满 */
    width: 100%;
    aspect-ratio: 1 / 1; /* 设置为正方形（宽高比1:1） */
    background: #f8f9fa;
    border: 1px solid #e8e9eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 移除旧的h4样式 */
.quick-functions-grid .feature-card h4 {
    display: none;
}

.features-grid-compact .feature-card:hover {
    background: white;
    transform: translateY(-2px);
}

.quick-functions-grid .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    border-color: rgba(74, 144, 226, 0.6);
}

/* 视频容器hover效果已由卡片统一控制 */

.quick-functions-grid .feature-card:active {
    transform: translateY(-2px);
}


.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s;
}

.features-grid-compact .feature-icon-wrapper {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

/* 视频封面样式 */
.feature-video-wrapper {
    width: 100%;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.feature-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.quick-functions-grid .feature-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 改为cover，填充整个区域 */
    border-radius: 0; /* 由卡片统一控制圆角 */
}

.quick-functions-grid .feature-video-wrapper {
    height: 100%; /* 占满整个卡片 */
    margin-bottom: 0; /* 移除底部间距 */
    border-radius: 0; /* 移除圆角，由卡片统一控制 */
    flex-shrink: 0;
    width: 100%;
    background: #f5f5f5; /* 恢复原来的浅灰色背景 */
}

.feature-card:hover .feature-icon-wrapper {
    background: #e6f0ff;
    color: #4a90e2;
}

.feature-card h4 {
    font-size: 0.9rem;
    color: #2d2d2d;
    font-weight: 500;
    margin: 0;
}

.features-grid-compact .feature-card h4 {
    font-size: 0.85rem;
}

/* 功能徽章（如"最多8张"） */
.feature-badge {
    font-size: 0.7rem;
    color: #999;
    margin: 4px 0 0 0;
    font-weight: 400;
}

/* ==========================================
   Tool Pages (Text, Resize, etc.)
   ========================================== */
.page-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
}

.back-btn:hover {
    color: var(--accent-color);
}

.page-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.process-container {
    display: flex;
    padding: 40px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

/* 上传区域 */
.upload-section {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* 产品迁移页面按钮布局 */
#migration-page .upload-section {
    display: flex;
    flex-direction: column;
}

#migration-page .upload-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

#migration-page .upload-box.small {
    flex: 1;
    min-width: 0; /* 允许缩小到内容宽度 */
}

/* 产品迁移页面按钮对称布局 */
#migration-page .process-btn-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding: 0 10px; /* 避免触碰边框 */
}

#migration-page .process-btn {
    flex: 1;
    margin: 0; /* 移除默认边距 */
    min-width: 0; /* 允许按钮缩小 */
}

/* 确保按钮不触碰容器边框 */
#migration-page .upload-section > .process-btn-container {
    padding: 0 10px 10px;
}

.result-section {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.result-section h3 {
    margin: 0 0 20px 0;
    font-size: 1rem;
    color: #4a5568;
    font-weight: 600;
}

.upload-box {
    border: 2px dashed #ddd;
    border-radius: 12px;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f5f5f5;
    min-height: 400px;
    /* 背景网格，让图片留白更自然 */
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Logo 页面的上传框调整 */
#logo-page .upload-box {
    height: 300px;
    min-height: 300px;
}

.upload-box.large {
    height: 500px;
    min-height: 500px;
}

.upload-box.small {
    height: 280px;
    min-height: 280px;
}

.upload-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.upload-row > * {
    flex: 1;
}

.upload-box input[type="file"] {
    display: none;
}

.upload-box:hover {
    border-color: var(--accent-color);
    background: #f0f4ff;
}

.upload-placeholder {
    text-align: center;
    color: #999;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px;
    box-sizing: border-box;
}

.preview-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 30px;
    height: 30px;
    display: none;
    border-radius: 50%;
    color: white;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.preview-remove-btn:hover {
    background: rgba(255, 59, 48, 0.9);
    transform: scale(1.1);
}

/* 当有图片时，叉号按钮在 hover 时显示 */
.upload-box.has-image:hover .preview-remove-btn {
    display: flex;
}

.canvas-container .preview-remove-btn {
    display: flex;
    z-index: 2005; /* Higher than cropper (usually 2000-ish) */
}

.canvas-container .preview-remove-btn.canvas-mode {
    background: rgba(255, 59, 48, 0.9);
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.text-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-tip {
    margin: 0;
    padding: 8px 12px;
    background: #f0f4f8;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.process-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--text-primary);
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #f5f5f5;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.result-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    height: 400px;
    /* 背景网格，让图片留白更自然 */
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.result-box.empty {
    min-height: 400px;
    height: 400px;
    background: #f9f9f9;
    background-image: none;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px;
    box-sizing: border-box;
}

.download-btn {
    padding: 8px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* ==========================================
   Resize Page Specific Styles
   ========================================== */
.editor-stage {
    width: 100%;
    min-height: 400px;
    margin-bottom: 20px;
}

.canvas-container {
    width: 100%;
    min-height: 400px;
    background: #f9f9f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.canvas-container img {
    max-width: 100%;
    display: block;
}

.controls-panel {
    width: 100%;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #4a5568;
}

.ratio-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ratio-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.ratio-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.ratio-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.inputs-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inputs-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.action-group {
    margin-top: 20px;
}

/* ==========================================
   Logo Page Specific Styles
   ========================================== */
.logo-controls {
    margin: 20px 0;
}

.mode-switch {
    margin-bottom: 15px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: all 0.3s;
}

.switch-label input[type="checkbox"] {
    display: none;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.switch-label input[type="checkbox"]:checked + .switch-slider {
    background: var(--accent-gradient);
}

.switch-label input[type="checkbox"]:checked + .switch-slider::after {
    left: 22px;
}

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

.logo-params-control {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.position-control {
    margin-bottom: 15px;
}

.position-control label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #4a5568;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 150px;
}

.grid-cell {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.grid-cell:hover {
    border-color: var(--accent-color);
    background: #f0f4ff;
}

.grid-cell.active {
    border-color: var(--accent-color);
    background: var(--accent-gradient);
}

.slider-group {
    margin-bottom: 15px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #4a5568;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

.canvas-wrapper {
    width: 100%;
    min-height: 400px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.canvas-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Logo 页面特殊处理：确保 canvas-wrapper 和 result-box 对齐 */
#logo-result .canvas-wrapper,
#logo-result .result-box {
    flex: 1;
}

#logo-result h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #4a5568;
}

/* 确保上传区域的图标居中 */
.upload-placeholder svg {
    fill: #999;
}

/* Icons */
.icon-svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Loading Overlay - v2.1 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

/* 当 loading 显示时（通过 JavaScript 控制） */
.loading[style*="display: block"],
.loading[style*="display: flex"] {
    display: flex !important;
}

.loading .spinner {
    margin-bottom: 0;
}

.loading p {
    margin-top: 20px;
    font-size: 18px;
    color: white;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    padding: 16px 32px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   File Preview Chips
   ========================================== */
.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: #333;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    animation: fadeIn 0.2s ease;
}

.file-chip-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
}

.file-chip-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-chip-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-chip-size {
    font-size: 11px;
    color: #999;
}

.file-chip-remove {
    width: 20px;
    height: 20px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.file-chip-remove:hover {
    background: #f0f0f0;
    color: #FF6B6B;
}

/* Back Home Button */
.back-home-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 10px;
    flex-shrink: 0;
}

.back-home-btn:hover {
    background: #f0f0f0;
    color: var(--text-primary);
    border-color: #ccc;
}

/* ==========================================
   DeepSeek Chat Layout
   ========================================== */
.deepseek-layout {
    display: flex;
    height: 100vh;
    background: white;
}

.ds-sidebar {
    width: var(--sidebar-width);
    background: #f8f9fa;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.ds-sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.ds-new-chat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
    height: 36px;
}

.ds-new-chat-btn:hover {
    background: #fff;
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ds-history-header {
    padding: 10px 5px;
    margin-bottom: 5px;
}

.ds-history-header h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.ds-history-list {
    flex: 1;
    overflow-y: auto;
}

.ds-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

.ds-history-item:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

.ds-history-item.active {
    background: #e6ebff;
    color: var(--accent-color);
}

.ds-history-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.ds-history-delete {
    opacity: 0;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.ds-history-item:hover .ds-history-delete {
    opacity: 1;
}

.ds-history-delete:hover {
    color: #FF6B6B;
    background: rgba(255,107,107,0.1);
}

.ds-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: white;
}

.ds-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15%;
    scroll-behavior: smooth;
}

.ds-message {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.ds-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-avatar.user {
    background: #718096;
    font-size: 12px;
}

.ds-content {
    flex: 1;
    padding-top: 6px;
    font-size: 15px;
    line-height: 1.6;
    color: #2d3748;
}

.ds-input-container {
    padding: 20px 15%;
    background: white;
    border-top: 1px solid transparent;
}

.ds-input-wrapper {
    position: relative;
}

.ds-input-box {
    background: #f4f6f8;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.ds-input-box:focus-within {
    background: white;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ds-textarea {
    width: 100%;
    background: transparent;
    border: none;
    resize: none;
    max-height: 200px;
    outline: none;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.ds-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ds-tools {
    display: flex;
    gap: 10px;
}

.ds-tool-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.ds-tool-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

.ds-send-btn {
    font-weight: 600;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.ds-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   处理历史记录页面
   ========================================== */
.history-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.history-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.history-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.history-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.history-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.history-type {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.history-date {
    font-size: 12px;
    color: #999;
}

.history-actions {
    display: flex;
    padding: 8px;
    gap: 8px;
    justify-content: flex-end;
}

.history-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #f0f0f0;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-action-btn:hover {
    background: #4a90e2;
    color: white;
}

.history-action-btn.delete:hover {
    background: #e53e3e;
    color: white;
}

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

.clear-history-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.clear-history-btn:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* 响应式设计：小屏幕时纵向排列 */
@media (max-width: 1024px) {
    .function-sections-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .function-section {
        width: 100%;
    }
    
    .features-dropdown {
        position: relative;
        top: 8px;
        margin-top: 8px;
    }
    
    .dropdown-section:hover .features-dropdown {
        display: block;
    }
    
    /* 快捷功能在中等屏幕：4列布局 */
    .quick-functions-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto auto auto; /* 自动高度 */
        gap: 28px 20px; /* 行间距28px，列间距20px */
        max-width: 1600px; /* 增大最大宽度 */
    }
    
    .quick-functions-section {
        padding: 30px 40px; /* 保持较大的内边距 */
    }
    
    .quick-functions-grid .feature-video-wrapper {
        height: 100%; /* 占满整个卡片 */
    }
    
    .quick-functions-grid .feature-card {
        aspect-ratio: 1 / 1; /* 保持正方形 */
        padding: 0;
    }
    
    .quick-functions-grid .feature-title {
        font-size: 0.95rem;
        padding: 3px 10px;
    }
}

@media (max-width: 640px) {
    .features-grid-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* 快捷功能在小屏幕上改为2列 */
    .quick-functions-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto auto auto auto auto; /* 自动高度 */
        gap: 24px 18px; /* 行间距24px，列间距18px */
        max-width: 100%; /* 小屏幕使用全宽 */
    }
    
    .quick-functions-section {
        padding: 30px 20px; /* 小屏幕减少内边距 */
    }
    
    .quick-functions-grid .feature-video-wrapper {
        height: 100%; /* 占满整个卡片 */
    }
    
    .quick-functions-grid .feature-card {
        aspect-ratio: 1 / 1; /* 保持正方形 */
        padding: 0;
    }
    
    .quick-functions-grid .feature-title {
        font-size: 0.9rem;
        padding: 3px 8px;
    }
}

/* 中等屏幕：3列布局 */
@media (min-width: 641px) and (max-width: 900px) {
    .quick-functions-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto auto; /* 自动高度 */
        gap: 26px 20px; /* 行间距26px，列间距20px */
        max-width: 100%; /* 使用全宽 */
    }
    
    .quick-functions-section {
        padding: 30px 30px; /* 中等屏幕适中的内边距 */
    }
    
    .quick-functions-grid .feature-video-wrapper {
        height: 100%; /* 占满整个卡片 */
    }
    
    .quick-functions-grid .feature-card {
        aspect-ratio: 1 / 1; /* 保持正方形 */
        padding: 0;
    }
    
    .quick-functions-grid .feature-title {
        font-size: 0.92rem;
        padding: 3px 9px;
    }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* ==========================================
   文字编辑器样式
   ========================================== */

/* 顶部工具栏 */
.text-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

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

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-btn.icon-only {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

.zoom-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.zoom-display:hover {
    background: #e8e8e8;
}

/* 顶部工具栏样式控件 */
.toolbar-style-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.toolbar-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 120px;
}

.toolbar-select:hover {
    border-color: var(--primary-color);
}

.toolbar-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-input-number {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.toolbar-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

.toolbar-color-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-color-picker {
    width: 36px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.toolbar-color-hex {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    text-transform: uppercase;
}

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

.toolbar-spacing-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.toolbar-range {
    width: 80px;
    height: 4px;
    cursor: pointer;
}

.toolbar-value {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

/* 主编辑区域 - 两栏布局（移除右侧样式栏） */
.text-editor-container {
    display: flex;
    height: calc(100vh - 60px);
    background: #f8f8f8;
}

/* 侧边栏（左右） */
.text-editor-sidebar {
    width: 300px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.text-editor-sidebar.right {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.text-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 图片控制区域 */
.image-control-area {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.image-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.image-control-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.image-control-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #e53e3e;
    cursor: pointer;
    transition: all 0.2s;
}

.image-control-remove:hover {
    background: #fee;
    color: #c53030;
}

.image-control-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.image-preview-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.image-preview-info {
    flex: 1;
    min-width: 0;
}

.image-preview-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.image-preview-size {
    font-size: 11px;
    color: var(--text-secondary);
}

.image-control-actions {
    display: flex;
    gap: 8px;
}

.image-control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.image-control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.image-control-btn svg {
    flex-shrink: 0;
}

/* 左侧文本列表 */
.text-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.text-list-item {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.text-list-item:hover {
    background: #f0f0f0;
    border-color: var(--primary-color);
}

.text-list-item.active {
    background: #e3f2fd;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.text-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.text-item-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.text-item-confidence {
    font-size: 11px;
    color: #666;
}

.text-item-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
}

.text-item-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.apply-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.apply-btn:hover:not(:disabled) {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.apply-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 中间 Canvas 区域 */
.text-editor-canvas-area {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.text-editor-canvas-area .canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #fafafa;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-editor-canvas-area .canvas-wrapper.panning {
    cursor: grabbing !important;
}

#te-canvas {
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    max-height: 100%;
}

.canvas-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

/* 右侧样式面板 */
.style-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.style-controls {
    padding: 20px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.control-group select,
.control-group input[type="text"],
.control-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
}

.control-group input[type="number"] {
    width: 80px;
    margin-left: 8px;
}

.color-input-group {
    display: flex;
    gap: 8px;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.color-input-group input[type="text"] {
    flex: 1;
}

.align-buttons {
    display: flex;
    gap: 4px;
}

.align-btn {
    flex: 1;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.align-btn:hover {
    background: #f0f0f0;
    border-color: var(--primary-color);
}

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

.align-btn.active svg path {
    fill: white;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14px;
}

.upload-trigger-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-trigger-btn:hover {
    background: #3a7bc8;
}

/* 结果对话框 */
.result-dialog {
    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: 1000;
    padding: 20px;
}

.result-dialog-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.result-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.result-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.result-dialog-header .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.result-dialog-header .close-btn:hover {
    background: #e0e0e0;
}

.result-dialog-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-dialog-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

/* 响应式 */
@media (max-width: 1200px) {
    .text-editor-sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .text-editor-container {
        flex-direction: column;
    }
    
    .text-editor-sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .text-editor-canvas-area {
        flex: 1;
    }
}

/* ==========================================
   批量处理页面样式
   ========================================== */

.batch-container {
    display: flex;
    gap: 24px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.batch-left,
.batch-right {
    flex: 1;
    min-width: 0;
}

.batch-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.batch-result-section {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.batch-section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

/* 批量上传行布局 - 左右结构 */
.batch-upload-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}

/* 左侧上传按钮区域 */
.upload-btn-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.upload-trigger-btn {
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-trigger-btn:hover {
    background: #357abd;
}

.upload-trigger-btn:active {
    background: #2d6ba0;
}

.upload-count {
    font-size: 13px;
    color: #4a90e2;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    background: #f0f7ff;
    border-radius: 6px;
}

/* 右侧展示区域 */
.upload-display-area {
    flex: 1;
    min-height: 180px;
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 16px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.upload-display-area:has(.batch-previews-grid[style*="display: grid"]),
.upload-display-area:has(#batch-bg-target-preview-container[style*="display: block"]),
.upload-display-area:has(#batch-mg-target-preview-container[style*="display: block"]) {
    border-color: var(--primary-color);
    background: white;
}

/* 空状态提示 */
.empty-hint {
    text-align: center;
    color: #999;
}

.empty-hint p {
    margin: 0;
    font-size: 14px;
}

/* 预览网格 */
.batch-previews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

/* 单张预览容器 */
.preview-single-item {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.preview-single-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

.preview-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #e53e3e;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.preview-item-remove:hover {
    background: #c53030;
    transform: scale(1.1);
}

.batch-upload-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* 单图上传区域（背景图/场景图） */
.batch-single-upload {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.batch-single-upload:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.batch-single-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.batch-single-upload .upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.batch-single-upload .preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-single-upload .preview-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.batch-single-upload .preview-remove-btn:hover {
    background: rgba(229, 62, 62, 1);
    transform: scale(1.1);
}

/* 多图上传区域 */
.batch-multi-upload {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.batch-multi-upload:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.batch-multi-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    top: 0;
    left: 0;
}

.batch-multi-upload .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    pointer-events: none;
}

/* 小图预览网格 */
.batch-mini-previews {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0;
}

.batch-mini-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    background: #f8f8f8;
    transition: all 0.2s;
    overflow: visible;
}

.batch-mini-preview-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.batch-mini-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}


.batch-mini-preview-number {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    background: rgba(74, 144, 226, 0.95);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

.batch-mini-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    background: #e53e3e;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 100;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.batch-mini-preview-item:hover .batch-mini-preview-remove {
    opacity: 1 !important;
    pointer-events: auto;
}

.batch-mini-preview-remove:hover {
    background: #c53030;
    transform: scale(1.15);
}

/* 进度条 */
.batch-progress {
    margin: 20px 0;
}

.progress-bar-wrapper {
    background: #f0f0f0;
    border-radius: 8px;
    height: 28px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #4a90e2, #357abd);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* 结果空状态 */
.batch-result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
    text-align: center;
}

/* 结果网格 */
.batch-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    flex: 1;
}

.batch-result-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e8e8e8;
    background: white;
    transition: all 0.2s;
}

.batch-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.batch-result-item img {
    width: 100%;
    height: auto;
    display: block;
}

.batch-result-number {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: rgba(74, 144, 226, 0.95);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 下载按钮区域 */
.result-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.download-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 通用模态窗口样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.modal[style*="display: none"] {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    width: 80%;
    max-width: 1200px;
}

.modal[style*="display: flex"] .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-header button:hover {
    color: #333;
    background-color: #f5f5f5;
}

/* 产品迁移弹窗样式 */
.migration-extract-container {
    display: flex;
    gap: 20px;
    margin: 20px 16px;
    flex-wrap: wrap;
}

.migration-extract-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.migration-extract-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.image-preview-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    padding: 10px;
}

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

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 20px 15px 15px 15px;
}

/* 旧的弹窗样式覆盖 */
#migration-extract-modal .process-container {
    display: none;
}

/* 通用样式 */
.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

/* ==========================================
   通知提示样式（中间上方显示）
   ========================================== */

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 9998;
    pointer-events: none;
    transition: background 0.2s ease;
}

.notification-overlay.notification-show {
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.notification-modal {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    max-width: 400px;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.notification-modal.notification-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
}

.notification-icon {
    font-size: 32px;
    margin-bottom: 8px;
    line-height: 1;
}

.notification-message-text {
    font-size: 14px;
    color: #333;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
    word-break: break-word;
}

.notification-success .notification-icon {
    color: #48bb78;
}

.notification-error .notification-icon {
    color: #f56565;
}

.notification-warning .notification-icon {
    color: #ed8936;
}

.notification-info .notification-icon {
    color: #4299e1;
}

/* ==========================================
   弹窗提示样式（居中显示）
   ========================================== */

.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 9998;
    pointer-events: none;
    transition: background 0.2s ease;
}

.toast-overlay.toast-show {
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.toast-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    padding: 20px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    max-width: 360px;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.toast-modal.toast-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
}

.toast-icon {
    font-size: 36px;
    margin-bottom: 12px;
    line-height: 1;
}

.toast-message-text {
    font-size: 15px;
    color: #333;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
}

.toast-success .toast-icon {
    color: #48bb78;
}

.toast-error .toast-icon {
    color: #f56565;
}

.toast-warning .toast-icon {
    color: #ed8936;
}

.toast-info .toast-icon {
    color: #4299e1;
}

/* 响应式 */
@media (max-width: 1024px) {
    .batch-container {
        flex-direction: column;
    }
    
    .batch-upload-row {
        flex-direction: column;
    }
    
    .upload-btn-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: 100%;
    }
    
    .upload-trigger-btn {
        flex: 1;
        max-width: 200px;
    }
    
    .batch-previews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .batch-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .batch-previews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .batch-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .upload-trigger-btn {
        max-width: 150px;
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* ==========================================
   Canvas 删除按钮
   ========================================== */
.canvas-delete-btn {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    display: none;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    font-weight: bold;
}

.canvas-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.canvas-delete-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   WPS 风格颜色选择器
   ========================================== */
.color-picker-panel {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 10000;
    display: none;
    min-width: 280px;
}

.color-picker-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.color-picker-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.color-picker-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.color-picker-item {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.color-picker-item:hover {
    transform: scale(1.15);
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.color-picker-item:active {
    transform: scale(1.05);
}

.color-picker-item.selected {
    border: 3px solid #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
    z-index: 2;
}

.color-picker-custom {
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-custom label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

#te-custom-color-input {
    width: 50px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.color-picker-ok-btn {
    padding: 6px 16px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.color-picker-ok-btn:hover {
    background: #357abd;
}

.color-picker-ok-btn:active {
    transform: scale(0.98);
}

/* 文字颜色按钮 */
.text-color-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-color-btn .color-preview {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

/* 左右布局容器 */
.left-right-layout {
    display: flex;
    gap: 20px;
}

/* 左右列各占一半 */
.left-column, .right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 左列：上传框和滑块按比例分配高度 */
.left-column .upload-section,
.left-column .expand-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 右列：结果框填满高度 */
.right-column .result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 让上传框和滑块总高度等于右侧结果高度 */
.upload-section {
    flex: 1;
}

.expand-controls {
    flex: 0 0 auto;
    overflow-y: auto;
}

.expand-controls {
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fafafa;
}

#expand-page .process-container {
    flex-direction: row; /* 水平布局 */
    gap: 20px; /* 减小间距 */
}

#expand-page .upload-section {
    flex: 1; /* 占左侧一半空间 */
    display: flex;
    flex-direction: column;
}

#expand-page .result-section {
    flex: 1; /* 占右侧一半空间 */
    min-width: 0; /* 允许flex项目缩小 */
}

#expand-page .upload-box {
    flex: 1; /* 让上传框占据剩余空间 */
    min-height: 300px; /* 设置最小高度以保持比例 */
}

/* 调整扩展控制面板样式 */
#expand-page .expand-controls {
    margin-top: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

#expand-page .expand-controls h4 {
    color: #495057;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.expand-controls h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.expand-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.expand-row .label {
    width: 20px;
    font-size: 13px;
    color: #555;
}

.expand-row input[type="range"] {
    flex: 1;
}

.expand-row input[type="number"] {
    width: 70px;
    padding: 5px 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: #333;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.expand-row input[type="number"]:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.expand-row input[type="number"]:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(102, 126, 234, 0.5);
}

.expand-row .unit {
    font-size: 12px;
    color: #888;
}

.expand-overlay {
    position: absolute;
    border: 2px dashed rgba(52, 152, 219, 0.8);
    pointer-events: none;
    z-index: 100;
    box-sizing: border-box;
}
