:root {
    --primary-color: #c0392b;
    --secondary-color: #d35400;
    --accent-color: #f39c12;
    --background-color: #fffaf0;
    --text-color: #34495e;
    --light-color: #fff9e6;
    --gradient-primary: linear-gradient(135deg, #c0392b, #d35400);
    --gradient-accent: linear-gradient(135deg, #f39c12, #e67e22);
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.2);
    --gold: #d4af37;
    --dark-red: #8b0000;
    --jade: #00a86b;
    --porcelain-blue: #2874a6;
    --bronze: #cd7f32;
    --wood-brown: #784212;
    --grid-color: rgba(50, 50, 50, 0.1);
    --grid-size: 40px;
    --base-font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: var(--base-font-size);
}

.header {
    background: var(--gradient-primary);
    color: white;
    padding: 15px 0;
    text-align: center;
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.8;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.logo img {
    height: 45px;
    margin-right: 15px;
}

.logo h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.slogan {
    font-size: 16px;
    font-weight: 300;
    margin: 0;
    opacity: 0.9;
}

/* 导航菜单 */
.main-navigation {
    margin-top: 10px;
}

.main-navigation ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 30px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.main-navigation a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.main-navigation li.active a {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 主布局 - 30/70拆分 */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧输入面板 - 30%宽度 */
.input-panel {
    width: 30%;
    padding: 20px;
    background-color: var(--light-color);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 130px);
}

.intro-card {
    background: linear-gradient(135deg, #f0d0a0, #e9e2d0);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border-left: 3px solid var(--accent-color);
    border-right: 3px solid var(--primary-color);
}

.intro-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d35400' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.intro-card h2 {
    color: var(--primary-color);
    margin: 0 0 10px;
    font-size: 26px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.intro-card p {
    margin: 0;
    font-size: 16px;
    position: relative;
    z-index: 1;
    color: var(--text-color);
}

.control-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    display: block;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: #fefefe;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

/* 风格选择器 */
.style-selector h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--text-color);
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.style-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #f9f5eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0d0c0;
}

.style-item:hover {
    background-color: #f5efe0;
    transform: translateY(-2px);
}

.style-item.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.style-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.style-name {
    font-size: 14px;
    font-weight: bold;
}

/* 生成按钮区域 */
.generate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(192, 57, 43, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(192, 57, 43, 0.4);
}

.primary-btn:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 发布选项 */
.publish-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f5eb;
    border-radius: 8px;
}

.invite-code-container {
    width: 100%;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.invite-code-container label {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 5px;
    display: block;
}

.invite-code-container input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0d0c0;
    border-radius: 6px;
    font-size: 15px;
    background-color: white;
    transition: all 0.3s;
}

.invite-code-container input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

.error-message {
    color: #c0392b;
    font-size: 14px;
    margin-top: 5px;
    animation: shakeError 0.5s ease;
}

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

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.publish-option input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.publish-option label {
    font-weight: normal;
    cursor: pointer;
}

.btn-icon {
    font-size: 24px;
}

.status-bar {
    background-color: #f1f1f1;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    color: #555;
}

.gallery-link-btn {
    display: inline-block;
    margin-left: 10px;
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.3);
}

/* 历史作品区域 */
.history-section h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--text-color);
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    background-color: #f9f5eb;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--accent-color);
    transition: all 0.2s;
}

.history-item:hover {
    background-color: #f5efe0;
    transform: translateX(2px);
}

.history-item button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* 右侧渲染面板 - 70%宽度 */
.render-panel {
    width: 70%;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    position: relative;
}

.render-container {
    flex: 1;
    position: relative;
    background-color: #fff;
    height: calc(100vh - 180px);
    overflow: hidden;
}

#scene-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
}

.model-description {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    max-width: 300px;
    font-size: 15px;
    z-index: 5;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    opacity: 0;
    border-left: 3px solid var(--accent-color);
}

.render-container:hover .model-description {
    opacity: 1;
    transform: translateY(0);
}

.model-description strong {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 18px;
}

.model-description p {
    margin: 8px 0 0;
    font-size: 15px;
    color: #555;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.96);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: none;
    backdrop-filter: blur(5px);
}

.spinner {
    border: 5px solid rgba(243, 156, 18, 0.2);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.2);
}

#loading-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

.progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 80%;
    max-width: 500px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85px;
    position: relative;
    opacity: 0.4;
    transition: all 0.3s;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 100%;
    width: 15px;
    height: 2px;
    background-color: #ccc;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active {
    opacity: 1;
    transform: scale(1.1);
}

.progress-step.completed {
    opacity: 0.7;
}

.progress-step.completed::after {
    background-color: var(--accent-color);
}

.step-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.step-name {
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

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

/* 场景控制按钮 */
.scene-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.scene-controls button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.scene-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scene-controls button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-icon {
    font-size: 24px;
}

/* 模型参数工具栏 */
.model-params-toolbar {
    padding: 18px;
    background-color: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    z-index: 5;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

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

.param-group label {
    font-size: 15px;
    font-weight: 500;
    color: #555;
    width: 65px;
}

.param-group input[type="range"] {
    width: 120px;
    height: 8px;
}

.param-group select {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 14px;
    min-width: 120px;
}

.param-value {
    font-size: 14px;
    color: #555;
    width: 30px;
    text-align: center;
}

/* 页脚 */
.footer {
    background: var(--gradient-primary);
    color: white;
    padding: 15px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.footer p {
    margin: 5px 0;
    position: relative;
    z-index: 1;
    font-size: 15px;
}

.footer .copyright {
    font-size: 14px;
    opacity: 0.8;
}

.footer .tagline {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 作品展馆页面样式 */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.gallery-header p {
    font-size: 18px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.gallery-item-preview {
    height: 250px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gallery-item-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-item-preview.preview-error {
    background: linear-gradient(135deg, #f0d0a0, #e9e2d0);
}

.gallery-item-preview .preview-error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #c0392b;
    font-weight: bold;
}

.gallery-item-image {
    height: 250px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.gallery-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-item-image.placeholder {
    background: linear-gradient(135deg, #f0d0a0, #e9e2d0);
    position: relative;
    overflow: hidden;
}

.gallery-item-image.placeholder::before {
    content: "非遗3D作品";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #c0392b;
    font-weight: bold;
    opacity: 0.7;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.gallery-item-image.placeholder::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d35400' fill-opacity='0.05'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.gallery-item-details {
    padding: 20px;
}

.gallery-item-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.gallery-item-author {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

.gallery-item-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.gallery-item-description {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-actions {
    display: flex;
    justify-content: space-between;
}

.gallery-item-actions button {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-item-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.gallery-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.gallery-item-tag {
    background-color: #f5efe0;
    color: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.gallery-empty-state {
    text-align: center;
    padding: 80px 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
}

.gallery-empty-state h2 {
    color: #666;
    font-size: 24px;
    margin-bottom: 15px;
}

.gallery-empty-state p {
    color: #888;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 25px;
}

.gallery-empty-state button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-empty-state button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.3);
}

.gallery-filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.gallery-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-filter-group label {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

.gallery-filter-group select {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
    min-width: 150px;
}

.gallery-search {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.gallery-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.gallery-search::before {
    content: "🔍";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #888;
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.gallery-pagination button {
    background-color: white;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.gallery-pagination button:hover:not(.active) {
    background-color: #f5f5f5;
}

/* 模态框样式 */
.model-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.model-modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #555;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.close-modal:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.model-viewer-container {
    width: 100%;
    height: 60vh;
    background-color: #f9f9f9;
    position: relative;
}

#modal-scene-container {
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
}

.model-info {
    padding: 25px;
}

.model-info h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin: 0 0 15px 0;
}

.model-info p {
    margin: 10px 0;
    font-size: 16px;
    color: #555;
}

.model-info strong {
    font-weight: 600;
    color: #333;
}

#modal-description {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 20px;
}

@media (min-width: 1024px) {
    .model-modal-content {
        flex-direction: row;
        height: 80vh;
    }
    
    .model-viewer-container {
        width: 65%;
        height: auto;
    }
    
    .model-info {
        width: 35%;
        padding: 30px;
        overflow-y: auto;
    }
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    
    .input-panel, .render-panel {
        width: 100%;
    }
    
    .input-panel {
        max-height: none;
        overflow: visible;
    }
    
    .render-container {
        height: 500px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .style-grid,
    .style-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .model-params-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    
    .param-group {
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        flex-direction: column;
    }
    
    .gallery-search {
        max-width: none;
    }
    
    .main-navigation ul {
        gap: 15px;
    }
    
    .main-navigation a {
        font-size: 16px;
        padding: 5px 10px;
    }
}

/* Mobile comfort pass: natural scrolling, usable canvas, compact controls. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    body {
        display: block;
        min-height: 100dvh;
    }

    .header {
        padding: 12px 12px 14px;
    }

    .logo {
        margin-bottom: 4px;
    }

    .logo img {
        height: 36px;
        margin-right: 10px;
    }

    .logo h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .slogan {
        font-size: 13px;
        line-height: 1.5;
        padding: 0 8px;
    }

    .main-navigation {
        margin-top: 10px;
    }

    .main-navigation ul {
        gap: 10px;
        flex-wrap: wrap;
    }

    .main-navigation a {
        display: block;
        min-width: 72px;
        padding: 7px 14px;
        font-size: 15px;
    }

    .main-layout {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: visible;
    }

    .input-panel,
    .render-panel {
        width: 100%;
        min-width: 0;
    }

    .input-panel {
        padding: 14px;
        gap: 14px;
        max-height: none;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .intro-card,
    .control-card {
        border-radius: 10px;
        padding: 16px;
    }

    .intro-card h2 {
        font-size: 22px;
    }

    .intro-card p {
        font-size: 14px;
        line-height: 1.6;
    }

    .form-group label,
    .style-selector h3 {
        font-size: 16px;
    }

    textarea,
    input,
    select,
    button {
        font-size: 16px;
    }

    textarea {
        min-height: 96px;
    }

    .style-items {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .style-item {
        min-height: 74px;
        padding: 10px 8px;
    }

    .style-item .style-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .style-item .style-name {
        font-size: 13px;
        line-height: 1.3;
    }

    .generate-actions {
        gap: 12px;
    }

    .primary-btn {
        width: 100%;
        min-height: 48px;
    }

    .publish-option {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        line-height: 1.5;
    }

    .invite-code-container {
        width: 100%;
    }

    .invite-code-container input {
        width: 100%;
        min-width: 0;
    }

    .status-bar {
        font-size: 14px;
        line-height: 1.6;
        padding: 10px 12px;
    }

    .render-container {
        height: min(68dvh, 520px);
        min-height: 360px;
        overflow: hidden;
    }

    #scene-container,
    #scene-container canvas,
    #modal-scene-container,
    #modal-scene-container canvas,
    .gallery-item-preview canvas {
        width: 100% !important;
        height: 100% !important;
        display: block;
        touch-action: none;
    }

    .model-description {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 10px 12px;
        opacity: 1;
        transform: none;
        font-size: 13px;
    }

    .model-description strong {
        font-size: 16px;
    }

    .model-description p {
        font-size: 13px;
        line-height: 1.45;
    }

    .scene-controls {
        left: 10px;
        right: 10px;
        bottom: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .scene-controls button {
        width: 44px;
        height: 44px;
    }

    .control-icon {
        font-size: 22px;
    }

    .model-params-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        padding: 12px 14px;
        gap: 12px;
    }

    .param-group {
        width: 100%;
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr) 34px;
        gap: 10px;
    }

    .param-group label {
        width: auto;
        font-size: 14px;
    }

    .param-group input[type="range"] {
        width: 100%;
        min-width: 0;
    }

    .param-group select {
        grid-column: 2 / 4;
        width: 100%;
        min-width: 0;
    }

    .loading-overlay {
        padding: 20px 14px;
    }

    #loading-text {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 18px;
    }

    .progress-container {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
    }

    .progress-step {
        width: calc(50% - 8px);
    }

    .progress-step::after {
        display: none;
    }

    .footer {
        padding: 14px 16px;
    }

    .footer p {
        font-size: 12px;
        line-height: 1.6;
    }

    .gallery-container {
        padding: 18px 14px;
    }

    .gallery-header {
        margin-bottom: 24px;
    }

    .gallery-header h1 {
        font-size: 26px;
        line-height: 1.25;
    }

    .gallery-header p {
        font-size: 14px;
        line-height: 1.7;
    }

    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .gallery-search {
        max-width: none;
        width: 100%;
    }

    .gallery-search input {
        width: 100%;
    }

    .gallery-filter-group {
        justify-content: space-between;
        width: 100%;
    }

    .gallery-filter-group select {
        min-width: 0;
        flex: 1;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-item-preview,
    .gallery-item-image {
        height: 220px;
    }

    .gallery-item-details {
        padding: 16px;
    }

    .gallery-item-title {
        font-size: 18px;
    }

    .gallery-item-description {
        font-size: 14px;
        line-height: 1.6;
    }

    .gallery-item-actions {
        flex-direction: column;
        gap: 10px;
    }

    .gallery-item-actions button,
    .gallery-empty-state button {
        width: 100%;
        justify-content: center;
    }

    .gallery-pagination {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 24px;
    }

    .gallery-pagination button {
        min-width: 42px;
        padding: 8px 10px;
    }

    .gallery-empty-state {
        padding: 48px 16px;
    }

    .model-modal {
        padding: 12px;
    }

    .model-modal-content {
        width: 100%;
        max-height: calc(100dvh - 24px);
        margin: 0 auto;
        border-radius: 10px;
        overflow: auto;
    }

    .close-modal {
        right: 14px;
        top: 10px;
        font-size: 30px;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
    }

    .model-viewer-container {
        height: 45dvh;
        min-height: 260px;
    }

    .model-info {
        padding: 16px;
    }

    .model-info h2 {
        font-size: 22px;
        padding-right: 36px;
    }

    .model-info p {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media (max-width: 420px) {
    .style-items {
        grid-template-columns: 1fr;
    }

    .render-container {
        height: 58dvh;
        min-height: 320px;
    }

    .gallery-item-preview,
    .gallery-item-image {
        height: 200px;
    }

    .param-group {
        grid-template-columns: 68px minmax(0, 1fr) 32px;
    }
}

.delete-btn {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #cc0000;
}

.delete-btn:active {
    background-color: #990000;
} 
