/* 导入字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* CSS变量 */
:root {
    --vh: 1vh;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #121212;
    color: #ffffff;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 0;
    margin: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 顶部标题区 */
.top-title {
    text-align: center;
    padding: 30px 0 20px;
    margin: 0 0 20px;
    position: relative;
}

.logo-image {
    max-width: 120px;
    height: auto;
    margin-bottom: 10px;
    display: inline-block;
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.3));
}

.top-title p {
    color: #d18c47;
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.divider {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 10px auto;
    padding-bottom: 5px;
}

.divider::before, .divider::after {
    content: "";
    height: 1px;
    width: 100px;
    background-color: #d18c47;
    display: inline-block;
    opacity: 0.7;
}

.diamond {
    width: 10px;
    height: 10px;
    background-color: transparent;
    border: 2px solid #d18c47;
    transform: rotate(45deg);
    margin: 0 12px;
    position: relative;
}

.diamond::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(209, 140, 71, 0.4);
    top: 2px;
    left: 2px;
}

/* 顶部导航区 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    background: linear-gradient(90deg, #1a7a96, #3b2c7d, #722a5e, #a13066);
    border-radius: 12px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
    height: 80px;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.header-title {
    padding-left: 20px;
    position: relative;
    z-index: 2;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 5px;
}

.header-title p {
    font-size: 12px;
    opacity: 0.8;
}

.main-nav {
    display: flex;
    gap: 30px;
    padding-right: 20px;
    position: relative;
    z-index: 2;
}

.nav-item {
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.3s;
    padding: 8px 12px;
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
}

/* 输入区域 */
.input-area {
    margin: 20px 0;
}

.prompt-box {
    background-color: #222222;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    min-height: 60px;
}

.add-btn {
    width: 40px;
    height: 40px;
    background-color: #333333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.add-btn img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    z-index: 1;
}

.add-btn.has-image::after {
    content: "×";
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 0 6px 0 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.add-btn.has-image:hover::after {
    opacity: 1;
}

.prompt-text {
    color: #888888;
    font-size: 14px;
    background-color: transparent;
    outline: none;
    border: none;
    width: 100%;
    min-height: 24px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 5px 0;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    user-select: text;
    -webkit-user-select: text;
}

.prompt-text:focus {
    color: #ffffff;
}

.prompt-text:empty:before {
    content: '请输入图片生成的提示词，例如：宽敞的新式中式客厅。红木框架装饰天花板、墙壁和橱柜...';
    color: #888888;
}

.prompt-text:focus:empty:before {
    content: '';
}

/* 功能按钮区 */
.function-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.left-buttons, .right-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.top-buttons, .bottom-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.bottom-buttons {
    margin-top: 10px;
}

.bottom-buttons .btn {
    width: 100%;
    justify-content: center;
}

.btn {
    background-color: #333333;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    transition: all 0.3s ease;
}

/* 按钮悬停效果 */
.btn:hover {
    background-color: #444444;
}

.primary-btn {
    background-color: #1a7a96;
}

.btn.disabled {
    background-color: #4d4d4d;
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* 加载动画 */
.loading-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.refresh-btn {
    background-color: #2c7a6a;
    position: relative;
    overflow: hidden;
}

.model-selected {
    background-color: #3b5a78;
    border-left: 3px solid #6bb5ff;
    padding-left: 9px;
    transition: all 0.3s ease;
}

.size-selected {
    background-color: #3b785a;
    border-left: 3px solid #6bffb5;
    padding-left: 9px;
}

/* 不同尺寸类型的样式 */
.size-square {
    border-bottom: 3px solid #ffcc00;
}

.size-landscape {
    border-bottom: 3px solid #66ccff;
}

.size-portrait {
    border-bottom: 3px solid #ff99cc;
}

/* 开关按钮启用状态 */
.toggle-enabled {
    background-color: #2c7a4a;
    box-shadow: 0 0 5px rgba(107, 255, 181, 0.4);
    border-left: 3px solid #6bffb5;
    padding-left: 9px;
}

.toggle-icon {
    color: #6bffb5;
    font-weight: bold;
}

.refresh-btn .icon {
    transition: transform 0.5s ease-in-out;
    display: inline-block;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating .icon {
    animation: rotate 1s linear;
}

.text-btn {
    font-weight: bold;
}

.deep-void-btn {
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    padding: 8px 14px;
}

.deep-void-btn svg {
    opacity: 0.8;
}

.round-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 类别选择区 */
.category-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.categories {
    display: flex;
    gap: 20px;
}

.category {
    font-size: 14px;
    padding: 5px 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.category.active {
    opacity: 1;
    font-weight: 500;
    position: relative;
}

.category.active::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 10px;
    right: 10px;
    height: 2px;
    background-color: #ffffff;
}

.search-box {
    background-color: #333333;
    border-radius: 20px;
    overflow: hidden;
    width: 200px;
}

.search-box input {
    width: 100%;
    background-color: transparent;
    border: none;
    padding: 8px 15px;
    color: #ffffff;
    outline: none;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #888888;
}

/* 图片展示区 */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 15px;
    margin-bottom: 40px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 220px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item.large {
    grid-column: span 3;
    height: 300px;
}

.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.item-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.item-info p {
    font-size: 12px;
    opacity: 0.8;
}

/* 可点击图片样式 */
.gallery-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item.clickable:hover {
    transform: scale(1.03);
}

.gallery-item.clickable::after {
    content: '点击查看大图';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item.clickable:hover::after {
    opacity: 1;
}

/* 灯箱样式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease;
}

.lightbox .thumbnail-preview {
    filter: blur(8px);
    opacity: 1;
    transform: scale(1.02);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1010;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1005;
}

.lightbox-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: rgba(34, 34, 34, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-out;
    text-align: center;
    min-width: 250px;
    border-left: 4px solid #1a7a96;
    padding-right: 35px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* 提示框关闭按钮 */
.toast-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 模态面板样式 - 新设计 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, #1c1c1c, #252525);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(255, 255, 255, 0.1);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
    font-weight: 500;
    position: relative;
    color: #fff;
    background: linear-gradient(90deg, #1a7a96, #3b2c7d);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 18px;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-items {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.modal-items::-webkit-scrollbar {
    width: 6px;
}

.modal-items::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-items::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 3px;
}

/* 网格布局的模态项目 */
.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 20px;
}

.modal-card {
    padding: 15px;
    background-color: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.modal-card:hover {
    background-color: rgba(60, 60, 60, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-card.selected {
    background: linear-gradient(145deg, #1a7a96, #2c7a6a);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-card .icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.modal-card .label {
    font-size: 14px;
    color: #eee;
}

/* 列表式模态项目 */
.modal-list {
    padding: 10px 0;
}

.modal-item {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.modal-item:last-child {
    border-bottom: none;
}

.modal-item:hover {
    background-color: rgba(60, 60, 60, 0.7);
    padding-left: 25px;
}

.modal-item.selected {
    background: linear-gradient(to right, #1a7a96, transparent);
    color: #fff;
    border-left: 3px solid #6bb5ff;
}

.modal-item .icon {
    margin-right: 10px;
    font-size: 16px;
    opacity: 0.7;
}

/* 横向排列的模态项目 */
.modal-horizontal {
    display: flex;
    padding: 30px;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-horizontal-item {
    flex: 1;
    min-width: 120px;
    padding: 20px 15px;
    background-color: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.modal-horizontal-item:hover {
    background-color: rgba(60, 60, 60, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-horizontal-item.selected {
    background: linear-gradient(145deg, #1a7a96, #2c7a6a);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-horizontal-item .icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.modal-horizontal-item .label {
    font-size: 14px;
    color: #eee;
    font-weight: 500;
}

.modal-horizontal-item .description {
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    /* 移动端布局优化 */
    
    /* 顶部导航区响应式 */
    .header {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }
    
    .header-title {
        padding: 0 0 10px 0;
        text-align: center;
        width: 100%;
    }
    
    .main-nav {
        width: 100%;
        padding: 0;
        padding-top: 10px;
        padding-bottom: 5px;
        display: flex;
        flex-wrap: nowrap;
    }
    
    /* 确保导航项平均分布 */
    .nav-item-container {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .nav-item-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 14px;
        text-align: center;
        flex: 0 0 auto;
        margin: 0 3px;
    }
    
    /* 功能按钮区响应式 */
    .function-bar {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 10px;
        padding: 0 5px;
    }
    
    .left-buttons {
        flex-wrap: nowrap;
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .top-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }
    
    .bottom-buttons {
        margin-top: 10px;
        width: 100%;
    }
    
    .btn {
        flex: 1 0 auto;
        text-align: center;
        justify-content: center;
        margin-bottom: 0;
        font-size: 12px;
        min-height: 40px;
        padding: 8px 5px;
        display: flex;
        align-items: center;
    }
    
    .btn .icon {
        margin-right: 3px;
        font-size: 14px;
    }
    
    .refresh-btn {
        background-color: #2c7a6a;
        width: 100%;
        max-width: 100%;
        margin-bottom: 5px;
        padding: 10px;
        font-size: 14px;
        border-radius: 8px;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        height: auto;
    }
    
    .refresh-btn:active {
        transform: translateY(2px);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    .refresh-btn .icon {
        font-size: 16px;
        margin-right: 8px;
    }
    
    /* 图片展示区响应式 */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item {
        height: 180px;
    }
    
    .gallery-item.large {
        grid-column: span 1;
        height: 220px;
    }
    
    /* 输入区域响应式 */
    .prompt-box {
        padding: 10px;
    }
    
    .prompt-text {
        font-size: 13px;
    }
    
    .add-btn {
        min-width: 36px;
        width: 36px;
        height: 36px;
    }
    
    /* 模态框响应式 */
    .modal-content {
        width: 95%;
        max-width: 350px;
        padding: 15px;
    }
    
    .modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .modal-horizontal {
        flex-direction: column;
    }
    
    .modal-horizontal-item {
        width: 100%;
    }
    
    /* 触摸交互优化 */
    .btn {
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.95);
        opacity: 0.9;
    }
    
    .gallery-item:active {
        transform: scale(0.98);
    }
    
    /* 提高触摸目标大小 */
    .nav-item, 
    .btn, 
    .add-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 进一步适配小屏幕手机 */
@media (max-width: 480px) {
    .top-title p {
        font-size: 14px;
    }
    
    .logo-image {
        max-width: 100px;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .header-title p {
        font-size: 11px;
    }
    
    .gallery-item {
        height: 150px;
    }
    
    .prompt-text:empty:before {
        content: '请输入提示词...';
    }
    
    /* 小屏幕手机的图片展示区 */
    .gallery {
        grid-template-columns: repeat(1, 1fr);
    }
    
    /* 小屏幕手机的按钮优化 */
    .top-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .btn {
        padding: 6px 4px;
        font-size: 10px;
        height: 36px;
    }
    
    .btn .icon {
        margin-right: 2px;
        font-size: 12px;
    }
    
    .refresh-btn {
        padding: 8px;
        font-size: 12px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .btn {
        padding: 5px 2px;
        font-size: 9px;
    }
    
    .btn .icon {
        margin-right: 1px;
    }
    
    .top-buttons {
        gap: 4px;
    }
}

@media (min-width: 769px) {
    .left-buttons, .right-buttons {
        flex-direction: row;
        width: auto;
    }
    
    .bottom-buttons {
        margin-top: 0;
    }
    
    .bottom-buttons .btn {
        width: auto;
    }
    
    .top-buttons, .bottom-buttons {
        width: auto;
    }
} 

/* 针对特定设备优化 */
@media (max-width: 375px) and (min-width: 320px) {
    .top-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .btn {
        padding: 6px 3px;
        font-size: 10px;
        height: auto;
        min-height: 36px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .btn .icon {
        margin-right: 0;
        margin-bottom: 2px;
        font-size: 14px;
    }
    
    .primary-btn {
        background-color: #1a7a96;
    }
    
    .refresh-btn {
        flex-direction: row;
    }
    
    .refresh-btn .icon {
        margin-right: 5px;
        margin-bottom: 0;
    }
} 

/* 添加图片加载状态样式 */
.gallery-item.loading {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.gallery-item.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

.gallery-item.loading::after {
    content: '加载中...';
    position: absolute;
    top: calc(50% + 20px);
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* 优化缩略图显示 */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 12px;
    /* 添加缩略图优化效果 */
    filter: blur(0);
    transform: scale(1);
    will-change: transform, filter;
}

/* 缩略图加载中的样式 */
.gallery-item.loading-thumbnail img {
    filter: blur(2px);
    transform: scale(1.05);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 刷新按钮旋转动画 */
.refresh-btn.rotating {
    pointer-events: none;
}

.refresh-btn.rotating .icon {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* 禁用状态的按钮 */
.btn:disabled,
.btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
} 