        :root {
            --main-color: #5a64ff;
            --btcolor: linear-gradient(113deg, #4c73ff, #6a52ff);
            --text1: #1a1d2e;
            --text2: #4a4e6d;
            --text3: #8d8fa3;
            --line: #e2e4f0;
            --mainbg: #f9fafb;
            --btactive: #e5e8ff;
            --lightbg: #f8f9ff;
            --shadow: #55537512;
            --card-bg: #ffffff;
            --blur: rgba(255, 255, 255, 0.5);
            --button: #5a64ff24;
            --secondary-tab-active: #eef0ff;
            --secondary-tab-hover: #f6f7ff;
            --user-msg-bg: #e2e5fd;
            --ai-msg-bg: #ffffff;
            --success-color: #2ecc71;
            --error-color: #e74c3c;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'HarmonyOS_Sans', 'Microsoft YaHei', 'Arial Unicode MS', sans-serif;
        }

        body {
            display: flex;
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            background: linear-gradient(0deg, #f9f9ff 72%, #7a6fff);
            color: var(--text1);
        }
        .secondary-tab-container {
            display: flex;
            padding: 0 20px;
        }
        /* 优秀作品展示区样式 */
        .showcase-container {
            margin-top: 20px;
        }

        .showcase-title {
            font-size: 18px;
            font-weight: 600;
        }

        .showcase-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .showcase-track {
            display: flex;
            gap: 12px;
            overflow-x: hidden;
            scroll-behavior: smooth;
            border-radius: 10px;
            /* 隐藏 Firefox 滚动条 */
            max-width: calc(100vw - 120px);
        }

        .showcase-track::-webkit-scrollbar {
            display: none;
            /* 隐藏 Chrome 滚动条 */
        }

        .showcase-item {
            flex: 0 0 auto;
            width: 140px;
            height: 140px;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            border: 1px solid var(--line);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .showcase-item:hover {
            border: 2px solid var(--main-color);
        }

        .showcase-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        #imageToImageSubTab .drawing-layout {
            display: flex;
            /* 控制面板 | 预览面板 | 灵感库 */
            grid-template-columns: 1fr 1fr 280px;
            gap: 0;
        }

        /* 灵感库面板样式 */
        .inspiration-library-panel {
            display: flex;
            flex-direction: column;
            border-left: 1px solid var(--line);
            padding-left: 20px;
            height: calc(100vh - 120px);
            max-width: 300px;
            /* 限制高度以便内部滚动 */
        }

        /* 灵感库网格容器 */
        .inspiration-gallery-container {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            overflow-y: auto;
            /* 超出高度时垂直滚动 */
            flex-grow: 1;
            padding-right: 5px;
            /* 滚动条空间 */
        }

        /* 灵感库项目 */
        .inspiration-item img {
            width: 100%;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            aspect-ratio: 1 / 1;
            /* 保持图片为正方形 */
            object-fit: cover;
        }

        .inspiration-item img:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px var(--shadow);
        }

        /* 1. 让灵感库项目成为定位容器，并裁剪超出圆角的内容 */
        .inspiration-item {
            position: relative;
            border-radius: 8px;
            /* 和图片圆角保持一致 */
            display: flex;
            /* 确保图片撑满容器 */
            overflow: hidden;
            /* 裁剪超出圆角的内容 */
            height: max-content;
            /* 自适应高度 */
        }

        /* 2. 标题样式 */
        .inspiration-item-title {
            position: absolute;
            /* 绝对定位，相对于 .inspiration-item */
            bottom: 0;
            left: 0;
            width: 100%;
            color: white;
            font-size: 13px;
            font-weight: 500;
            text-align: center;
            padding: 12px 6px 6px;
            /* 顶部留多些空间给渐变背景 */
            /* 从下到上、从透明度70%的黑色到完全透明的渐变背景，使文字更清晰 */
            background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
            /* 防止标题过长而换行 */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 默认隐藏，鼠标悬浮时显示，效果更佳 */
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        /* 3. 鼠标悬浮在项目上时，显示标题 */
        .inspiration-item:hover .inspiration-item-title {
            opacity: 1;
            transform: translateY(0);
        }

        /* 1. 重置滑块的基本样式 */
        #imageToImageStrength {
            -webkit-appearance: none;
            /* 移除 WebKit/Blink 浏览器的默认外观 */
            appearance: none;
            /* 移除其他浏览器的默认外观 */
            width: 100%;
            /* 宽度占满容器 */
            height: 8px;
            /* 滑块轨道的高度 */
            background: var(--line);
            /* 未填充部分的背景色，使用现有颜色变量 */
            border-radius: 5px;
            /* 圆角 */
            outline: none;
            /* 移除焦点时的轮廓 */
            padding: 0;
            /* 覆盖内联样式中的 padding */
            margin: 8px 0;
            /* 增加垂直间距，优化布局 */
        }

        /* 2. 为 WebKit 浏览器 (Chrome, Safari) 设置轨道样式 */
        #imageToImageStrength::-webkit-slider-runnable-track {
            width: 100%;
            height: 8px;
            cursor: pointer;
            background: var(--btactive);
            /* !关键: 应用主色调渐变 */
            border-radius: 5px;
            border: 1px solid var(--line);
        }

        /* 3. 为 WebKit 浏览器设置滑块手柄样式 */
        #imageToImageStrength::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            border: 2px solid white;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            background: var(--main-color);
            cursor: pointer;
            margin-top: -6px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
        }

        .icon {
            display: inline-block;
            width: 1.2em;
            height: 1.2em;
            fill: currentColor;
        }

        .ruler {
            cursor: pointer;
            color: var(--main-color);
            gap: 6px;
            display: flex;
            align-items: center;
            text-decoration: none;
            font-size: 14px;
        }

        .ruler:hover {
            text-decoration: underline;
        }

        /* 图片详情面板样式 */
        .image-details-panel {
            position: relative;
            right: 0;
            top: 0;
            width: 300px;
            padding: 20px 20px 60px;
            overflow-y: auto;
            display: none;
            height: -webkit-fill-available;
        }

        .image-details-panel h3 {
            margin-bottom: 15px;
            color: var(--text1);
            font-size: 18px;
            border-bottom: 1px solid var(--line);
            padding-bottom: 10px;
        }

        .detail-item {
            margin-bottom: 15px;
            display: flex;
            flex-direction: column;
        }

        .detail-item label {
            font-weight: 600;
            color: var(--text2);
            margin-bottom: 5px;
            font-size: 14px;
        }

        .detail-item span {
            color: var(--text3);
            font-size: 14px;
        }

        .prompt-text {
            background: var(--mainbg);
            padding: 10px;
            border-radius: 8px;
            margin-bottom: 10px;
            max-height: 280px;
            overflow-y: auto;
            font-size: 14px;
            line-height: 1.4;
            color: var(--text2);
            border: 1px solid var(--line);
        }

        .copy-btn {
            align-self: flex-end;
            padding: 6px 12px;
            background: var(--copy-btn);
            color: var(--text2);
            border: 1px solid var(--line);
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 5px;
        }

        .copy-btn:hover {
            background: var(--btactive);
            color: var(--main-color);
        }

        .hidden {
            display: none !important;
        }

        .advanced-options {
            /* display: grid;*/
            /*grid-template-columns: 1fr 1fr;*/
            gap: 15px;
            margin-top: 8px;
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid var(--line);
        }

        .option-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
            justify-content: space-between;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #d7d7df;
            transition: .4s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.toggle-slider {
            background-color: var(--main-color);
        }

        input:checked+.toggle-slider:before {
            transform: translateX(26px);
        }

        .option-label {
            font-size: 14px;
            font-weight: 500;
            color: var(--text2);
        }

        .option-description {
            font-size: 12px;
            color: var(--text3);
            margin-top: 4px;
        }

        .main-layout {
            display: flex;
            flex-grow: 1;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            flex-direction: column;
            padding: 20px 10px 10px 70px;
        }

        .header {
            display: flex;
            align-items: baseline;
            color: white;
            gap: 10px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            color: white;
            margin: 0 0 15px 5px;
                flex-wrap: wrap;
        }

        .logo h1 {
            font-size: 1.4rem;
            font-weight: 700;
            letter-spacing: -0.5px;
        }

        .logo svg {
            font-size: 30px;
            background: var(--btcolor);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: pulse 2s infinite;
        }

        .header-info {
            font-size: 14px;
            opacity: 0.9;
        }

        .main-content {
            flex-grow: 1;
            display: flex;
        }

        .panel {
            border-radius: 12px;
            flex: 1;
        }

        .panel h2 {
            font-size: 24px;
            margin-bottom: 15px;
            color: var(--text1);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .panel-description {
            color: var(--text2);
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .secondary-tabs {
            display: flex;
            background: transparent;
            border-radius: 0;
            justify-content: space-between;
        }

        .secondary-tab-btn {
            padding: 12px 20px;
            min-width: 120px;
            background: none;
            border: none;
            color: #fff;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: color 0.3s;
            text-align: center;
            justify-content: center;
            border-radius: 0;
            box-shadow: none;
            position: relative;
            border-radius: 12px 12px 0 0;
        }

        .secondary-tab-btn.active {
            background: #fff;
            color: var(--main-color);
            font-weight: 600;
            box-shadow: none;
        }
        .secondary-tab-btn.active::after{
                content: '';
    position: absolute;
    left: -20px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: none;
    box-shadow: 10px 10px 0 #ffffff;
    border-radius: 50%;
        }
.secondary-tab-btn.active::before{
                content: '';
    position: absolute;
    right: -20px;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: none;
    box-shadow: -10px 10px 0 #ffffff;
    border-radius: 50%;
        }
        .secondary-tab-btn:hover {
            color: var(--main-color);
        }

        .secondary-tab-btn:not(.active):hover::after {
            width: 40%;
        }

        .secondary-tab-pane {
            display: none;
            flex: 1;
            flex-direction: column;
            height: calc(100vh - 80px);
            padding: 20px;
            background: #fff;
            border-radius: 12px;
        }
/* 自定义 WebKit 浏览器滚动条 */
.secondary-tab-pane.active::-webkit-scrollbar {
    width: 6px;               /* 滚动条宽度 */
    background: transparent;  /* 轨道背景透明 */
}

.secondary-tab-pane.active::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);  /* 半透明滑块 */
    border-radius: 10px;
}

.secondary-tab-pane.active::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}
        .secondary-tab-pane.active {
            scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
            scrollbar-width: thin;
            display: flex;
            overflow-y: auto;
            overflow-x: hidden;
        }

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

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

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }

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

        .translate-btn {
            position: absolute;
            bottom: 14px;
            right: 10px;
            background: #fff;
            border: 1px solid var(--line);
            border-radius: 8px;
            padding: 4px 12px;
            cursor: pointer;
            color: var(--text2);
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 5px;
            z-index: 10;
        }

        .translate-btn:hover {
            background: var(--button);
            color: var(--main-color);
        }

        .drawing-layout {
            display: grid;
            grid-template-columns: 1fr 1.5fr;
            gap: 25px;
        }

        .drawing-controls-panel {
            border-radius: 12px;
        }

        .drawing-controls-panel2 {
            border-radius: 12px;
            bottom: 10px;
            width: 800px;
            margin: 0 auto;
        }

        .drawing-preview-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        textarea,
        input[type="text"],
        input[type="password"],
        select {
            width: 100%;
            padding: 16px 16px 38px 16px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: var(--mainbg);
            color: var(--text1);
            font-size: 15px;
            resize: vertical;
            transition: all 0.3s;
            resize: none;
        }

        textarea:focus,
        input[type="text"]:focus,
        input[type="password"]:focus,
        select:focus {
            outline: none;
            border-color: var(--main-color);
            box-shadow: 0 0 0 3px rgba(89, 99, 255, 0.15);
        }

        .input-wrapper {
            position: relative;
        }

        .btn-group {
            display: flex;
            gap: 15px;
            margin: 20px;
            justify-content: center;
        }

        button {
            padding: 10px 18px;
            border-radius: 30px;
            border: none;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            justify-content: center;
        }

        .btn-primary {
            background: var(--btcolor);
            color: white;
            box-shadow: 0 4px 15px rgba(89, 99, 255, 0.25);
        }

        .btn-primary:hover {
            opacity: 0.92;
            box-shadow: 0 7px 18px rgba(89, 99, 255, 0.35);
        }

        .btn-secondary {
            background: var(--card-bg);
            color: var(--text2);
            border: 1px solid var(--line);
            font-size: 14px;
            height: fit-content;
        }

        .btn-secondary:hover {
            background: var(--btactive);
            color: var(--main-color);
        }

        .drawing-controls {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 20px;
        }

        .drawing-control {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .drawing-control label {
            font-size: 14px;
            font-weight: 500;
            color: var(--text2);
            display: flex;
            justify-content: space-between;
        }

        .drawing-control select,
        .drawing-control input {
            padding: 10px;
            border-radius: 8px;
            border: 1px solid var(--line);
            background: var(--mainbg);
            font-size: 14px;
        }

        .drawing-control select {
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238d8fa3' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 16px center;
        }

        .drawing-preview {
            text-align: center;
            position: relative;
        }

        #generatedImage,
        #generatedImageToImage {
            max-width: 100%;
            max-height: 440px;
            border-radius: 6px;
            display: none;
            cursor: pointer;
            transition: transform 0.2s ease-in-out;
            border: 1px solid var(--line);
        }

        #generatedImage:hover,
        #generatedImageToImage:hover {
            transform: scale(1.03);
        }

        .drawing-placeholder {
            color: var(--text3);
            padding: 40px;
            opacity: 0.7;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 15px;
            border-radius: 12px;
            max-width: 860px;
            overflow: hidden;
            min-height: 50vh;
        }

        .drawing-placeholder svg {
            font-size: 56px;
            color: var(--text3);
            opacity: 0.5;
        }

        .image-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 20px;
        }

        .image-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            animation: fadeIn 0.3s ease;
        }

        .image-modal.show {
            display: flex;
        }

        .modal-footer {
            color: white;
            position: absolute;
            z-index: 10;
            bottom: -40px;
                text-align: center;
                width: -webkit-fill-available;
        }

        .modal-content {
            position: relative;
            max-width: 90vw;
            max-height: 85vh;
            display: flex;
            background: #fff;
            border-radius: 10px;
            align-items: center;
            min-height: 70vh;
        }

        /* 图片容器 - 包含图片和翻页按钮 */
        .modal-image-container {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }

        .modal-content img {
            object-fit: contain;
            border-radius: 14px;
            max-height: 85vh;
            padding: 10px;
            max-width: 60vw;
        }

        .modal-close-btn {
            position: absolute;
            top: -40px;
            background: #ffffff45;
            color: #fff;
            font-size: 28px;
            cursor: pointer;
            transition: transform 0.3s;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            padding: 7px 0 10px;
            right: -50px;
            z-index: 9;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 左右翻页按钮样式 - 精确位于图片边缘 */
        .modal-nav-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0, 0, 0, 0.3);
            color: white;
            border: none;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
            padding: 10px;
        }

        .modal-nav-btn:hover {
            background: rgba(0, 0, 0, 0.5);
            transform: translateY(-50%) scale(1.1);
        }

        .modal-prev-btn {
            left: 10px;
        }

        .modal-next-btn {
            right: 10px;
        }

        .modal-close-btn:hover {
            transform: scale(1.1);
            background: #fff;
            color: #000;
        }

        .modal-download-btn {
            position: absolute;
            bottom: 20px;
            right: 30px;
            transform: translateX(-50%);
            background: var(--btcolor);
        }

        .alert {
            position: fixed;
            top: 30px;
            left: 50%;
            transform: translateX(-50%);
            padding: 16px 35px;
            border-radius: 12px;
            color: white;
            box-shadow: 0 8px 25px var(--shadow);
            z-index: 1001;
            animation: fadeInOut 3s forwards;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .alert.success {
            background: var(--success-color);
            z-index: 2001;
        }

        .alert.error {
            background: var(--error-color);
            z-index: 2001;
        }

        @keyframes fadeInOut {
            0% {
                opacity: 0;
                transform: translate(-50%, -20px);
            }

            10% {
                opacity: 1;
                transform: translate(-50%, 0);
            }

            90% {
                opacity: 1;
                transform: translate(-50%, 0);
            }

            100% {
                opacity: 0;
                transform: translate(-50%, -20px);
            }
        }

        .loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid var(--btactive);
            border-radius: 50%;
            border-top-color: var(--main-color);
            animation: spin 1s linear infinite;
        }

        .drawing-placeholder .loader {
            border: 4px solid var(--btactive);
            border-top-color: var(--main-color);
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* 历史图库样式 */
        .gallery-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 10px;
            margin-bottom: 40px;
        }

        .history-item {
            background: var(--lightbg);
            border-radius: 8px;
            overflow: hidden;
            transition: transform 0.3s ease;
            cursor: pointer;
            position: relative;
            border: 1px solid var(--line);
        }

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

        .history-image {
            width: 100%;
            height: 180px;
            object-fit: cover;
            padding: 5px;
            border-radius: 8px;
        }

        .history-info {
            padding: 0 12px 12px;
        }

        .history-prompt {
            font-size: 13px;
            color: var(--text2);
            height: 40px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            margin-bottom: 8px;
        }

        .history-date {
            font-size: 11px;
            color: var(--text3);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .delete-history {
            cursor: pointer;
            font-size: 14px;
        }

        .delete-history:hover {
            color: var(--error-color);
        }

        .gallery-controls {
            display: flex;
            justify-content: space-between;
            padding: 10px 20px;
            background: #ffffffc2;
            bottom: 0;
            position: fixed;
            width: -webkit-fill-available;
            z-index: 9;
            align-items: center;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            margin-left: -20px;
        }

        .empty-gallery {
            text-align: center;
            padding: 50px;
            color: var(--text3);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100%;
            width: 100%;
            grid-column: 1 / -1;
            min-height: 70vh;
        }

        .empty-gallery svg {
            font-size: 68px;
            margin-bottom: 15px;
            color: var(--line);
        }

        /* 图生图样式 */
        #imageToImageOptions {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .image-upload-area {
            display: flex;
            flex-direction: column;
            align-items: center;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            position: absolute;
            width: 70px;
            background: white;
            height: 90px;
            justify-content: center;
            margin: 20px;
            transform: rotate(-8deg);
            overflow: hidden;
            box-shadow: 0 0 10px #b5b1e73d;
        }

        .image-upload-area:hover {
            border-color: var(--main-color);
            background: var(--btactive);
            transform: rotate(0deg);
        }

        .image-upload-area svg {
            font-size: 20px;
            color: var(--text2);
        }

        .image-upload-area p {
            color: var(--text2);
            font-size: 14px;
            text-align: center;
        }

        .image-upload-area input[type="file"] {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0;
            cursor: pointer;
        }

        .uploaded-image-preview {
            width: 100%;
            height: 100%;
            display: none;
            object-fit: cover;
        }

        .upload-status {
            font-size: 13px;
            color: var(--text3);
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 10px;
        }

        .inspiration-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .inspiration-header h3 {
            margin-bottom: 0;
            /* 移除标题默认的下边距 */
        }

        /* 收起/展开按钮样式 */
        .toggle-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text3);
            transition: transform 0.3s ease, color 0.3s ease;
        }

        .toggle-btn:hover {
            color: var(--main-color);
        }

        /* --- 收起功能的核心样式 --- */

        /* 1. 给主布局添加过渡动画 */
        #imageToImageSubTab .drawing-layout {
            transition: grid-template-columns 0.35s ease;
        }

        /* 2. 定义灵感库收起时，主布局的网格状态 */
        #imageToImageSubTab .drawing-layout.inspiration-collapsed {
            grid-template-columns: 1fr 1fr 45px;
            /* 将第三列宽度缩小 */
        }

        /* 3. 隐藏被收起的面板中的多余内容 */
        .inspiration-library-panel.collapsed .inspiration-gallery-container,
        .inspiration-library-panel.collapsed .inspiration-header h3 {
            display: none;
        }

        /* 4. 旋转按钮图标，提供视觉反馈 */
        .inspiration-library-panel.collapsed .toggle-btn {
            transform: rotate(180deg);
        }

        /* 5. 确保面板在收缩时隐藏溢出的内容 */
        .inspiration-library-panel {
            overflow: hidden;
        }

        .history-date-header {
            grid-column: 1 / -1;
            /* 占满整行 */
            font-size: 16px;
            font-weight: 600;
            color: var(--text2);
            margin: 10px 0 0;
        }

        .history-date-header:first-of-type {
            margin-top: 0;
        }

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

        @media (max-width: 768px) {
            .history-prompt {
                height: 14px;
                -webkit-line-clamp: 1;
            }
            .logo {
                display: none;
            }
            .secondary-tab-container {
                display: grid;
                grid-template-columns: 1fr 1fr 1fr;
                flex: 1;
            }
            .secondary-tab-btn {
                padding: 15px 2px;
                font-size: 14px;
                min-width: auto;
            }
            .showcase-track {
                max-width: calc(100vw - 40px);
            }
            .btn-secondary {
                font-size: 12px;
            }

            .panel-description {
                font-size: 12px;
            }

            .pagination {
                width: 100%;
                justify-content: space-between;
                background: var(--shadow);
            padding: 6px;
            border-radius: 28px;
            }

            #imageToImageSubTab .drawing-layout {
                display: flex;
                flex-direction: column;
            }

            .modal-footer {
                display: none;
            }

            .drawing-controls-panel2 {
                width: 100%;
                position: relative;
            }

            #imageToImageSubTab .drawing-layout.inspiration-collapsed {
                grid-template-columns: 1fr;
            }

            .inspiration-library-panel {
                border-left: none;
                padding-left: 0;
                height: auto;
                /* 移动端自动高度 */
                max-height: 80vh;
                max-width: fit-content;
                /* 可以设置一个最大高度 */
            }

            .advanced-options,
            #imageToImageOptions {
                grid-template-columns: 1fr;
            }

            .secondary-tab-pane.active {
                padding: 10px;
                max-height: calc(100vh - 80px);
            }

            .image-details-panel {
                position: static;
                width: 100%;
                height: auto;
                max-height: 65vh;
                overflow-y: auto;
            }

            .modal-content {
                flex-direction: column;
                width: 95vw;
                max-height: 80vh;
            }

            .drawing-layout {
                grid-template-columns: 1fr;
            }

            .gallery-controls {
                flex-direction: column;
                gap: 5px;
            }

            button {
                font-size: 14px;
            }

            .header {
                flex-direction: column;
                text-align: center;
                gap: 10px;
                padding: 15px;
                align-items: center;
                display: none;
            }

            .main-layout {
                margin-left: 0;
                padding: 8px;
            }

            .header-info {
                font-size: 13px;
            }

            .modal-content img {
                width: 100%;
                max-height: 50vh;
                height: -webkit-fill-available;
                max-width: 100vw;
            }

            .image-details-panel {
                max-height: 35vh;
            }

            .modal-download-btn {
                position: relative;
                bottom: auto;
                right: auto;
                transform: none;
                display: flex;
                margin: 0 auto 15px;
                width: 80%;
                max-width: 200px;
            }

            .modal-close-btn {
                right: 0;
            }

            /* 移动端翻页按钮样式 */
            .modal-prev-btn {
                left: 0;
            }

            .modal-next-btn {
                right: 0;
            }

            /* 调整移动端的图片容器 */
            .modal-image-container {
                width: 100%;
            }

            .drawing-placeholder {
                min-height: 40vh;
            }

            .gallery-container {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
                padding: 0;
                margin-bottom: 90px;
                gap: 10px;
            }

            .empty-gallery {
                padding: 30px;
            }

            .history-image {
                height: 140px;
            }
        }