﻿/* 优象AI模型 — 前端样式 */

/* 暗色主题（默认） */
.yam-page-wrap {
    --yam-bg: #0a0a0f;
    --yam-surface: #141420;
    --yam-surface2: #1a1a2e;
    --yam-border: #2a2a3e;
    --yam-text: #e0e0e8;
    --yam-text-dim: #8888a0;
    --yam-accent: #6c5ce7;
    --yam-accent-hover: #7c6cf7;
    --yam-success: #00b894;
    --yam-danger: #e17055;
    --yam-radius: 12px;
}
/* 亮色主题 */
body.theme-light .yam-page-wrap {
    --yam-bg: #f5f5f7;
    --yam-surface: #ffffff;
    --yam-surface2: #f0f0f4;
    --yam-border: #e0e0e6;
    --yam-text: #1a1a2e;
    --yam-text-dim: #666680;
}

.yam-page-wrap {
    background: var(--yam-bg);
    color: var(--yam-text);
    border-radius: 0;
}

/* ── Hero ── */
.yam-hero {
    text-align: center;
    padding: 48px 24px 24px;
}
.yam-hero h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.yam-hero-sub {
    color: var(--yam-text-dim);
    margin-top: 8px;
    font-size: 16px;
}

/* ── Main Container ── */
.yam-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* ── Tabs ── */
.yam-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--yam-border);
    padding-bottom: 0;
}
.yam-tab {
    background: none;
    border: none;
    color: var(--yam-text-dim);
    font-size: 15px;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.yam-tab:hover { color: var(--yam-text); }
.yam-tab.active {
    color: var(--yam-accent);
    border-bottom-color: var(--yam-accent);
}

/* ── Grid Layout ── */
.yam-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.yam-left, .yam-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.yam-upload-zone,
.yam-viewer-container {
    min-height: 360px;
}
@media (max-width: 768px) {
    .yam-grid { grid-template-columns: 1fr; }
}

/* ── 批量队列 ── */
.yam-batch-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--yam-surface);
    border-radius: var(--yam-radius);
    border: 1px solid var(--yam-border);
    max-height: 200px;
    overflow-y: auto;
}
.yam-q-item {
    position: relative;
    width: 64px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.yam-q-item:hover { border-color: var(--yam-accent); }
.yam-q-item.yam-q-processing { border-color: var(--yam-accent); }
.yam-q-item.yam-q-done { border-color: var(--yam-success); }
.yam-q-item.yam-q-failed { border-color: var(--yam-danger); opacity: 0.6; }
.yam-q-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}
.yam-q-name {
    display: none; /* 隐藏文件名，鼠标悬停时通过 title 显示 */
}
.yam-q-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}
.yam-q-ok { background: var(--yam-success); }
.yam-q-fail { background: var(--yam-danger); }
.yam-q-spin {
    background: var(--yam-accent);
    animation: yam-spin 1s linear infinite;
}
@keyframes yam-spin { to { transform: rotate(360deg); } }
.yam-q-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    padding: 0;
    display: none;
}
.yam-q-item:hover .yam-q-remove { display: block; }

/* ── 按钮行 ── */
.yam-btn-row {
    display: flex;
    gap: 8px;
}
.yam-btn-row .yam-btn-primary { flex: 1; }
.yam-btn-outline {
    background: transparent;
    border: 1px solid var(--yam-border);
    color: var(--yam-text);
    padding: 10px 16px;
    border-radius: var(--yam-radius);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.yam-btn-outline:hover {
    background: var(--yam-surface2);
    border-color: var(--yam-accent);
}

/* ── 批量总进度 ── */
.yam-batch-progress {
    font-size: 13px;
    color: var(--yam-text-dim);
    text-align: center;
    padding: 4px 0;
}

/* ── Upload Zone ── */
.yam-upload-zone {
    border: 2px dashed var(--yam-border);
    border-radius: var(--yam-radius);
    background: var(--yam-surface);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}
.yam-upload-zone:hover,
.yam-upload-zone.dragover {
    border-color: var(--yam-accent);
    background: var(--yam-surface2);
}
.yam-upload-placeholder {
    text-align: center;
    color: var(--yam-text-dim);
    padding: 20px;
}
.yam-upload-placeholder svg { margin-bottom: 12px; opacity: 0.5; }
.yam-upload-placeholder p { margin: 4px 0; font-size: 14px; }
.yam-link { color: var(--yam-accent); cursor: pointer; }
.yam-hint { font-size: 12px !important; opacity: 0.6; margin-top: 8px !important; }
.yam-preview-img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 8px;
}

/* ── Options ── */
.yam-options { margin: 16px 0; }
.yam-label {
    display: block;
    font-size: 13px;
    color: var(--yam-text-dim);
    margin-bottom: 8px;
}
.yam-radio-group {
    display: flex;
    gap: 16px;
}
.yam-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    color: var(--yam-text);
}
.yam-sub {
    font-size: 12px;
    color: var(--yam-text-dim);
    margin-left: 2px;
}

/* ── Buttons ── */
.yam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.yam-btn-primary {
    width: 100%;
    background: var(--yam-accent);
    color: #fff;
    font-size: 16px;
    padding: 14px;
}
.yam-btn-primary:hover { background: var(--yam-accent-hover); }
.yam-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.yam-btn-download {
    flex-direction: column;
    gap: 2px;
    background: var(--yam-surface2);
    color: var(--yam-text);
    border: 1px solid var(--yam-border);
    padding: 12px 20px;
    min-width: 100px;
}
.yam-btn-download:hover {
    border-color: var(--yam-accent);
    background: var(--yam-surface);
}
.yam-btn-download strong { font-size: 16px; }
.yam-btn-download span { font-size: 11px; color: var(--yam-text-dim); }

/* ── Progress ── */
.yam-progress { margin-top: 16px; }
.yam-progress-bar {
    height: 6px;
    background: var(--yam-surface2);
    border-radius: 3px;
    overflow: hidden;
}
.yam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--yam-accent), #a29bfe);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}
.yam-progress-text {
    font-size: 13px;
    color: var(--yam-text-dim);
    margin-top: 8px;
}

/* ── 3D Viewer ── */
.yam-viewer-container {
    background: var(--yam-surface);
    border: 1px solid var(--yam-border);
    border-radius: var(--yam-radius);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.yam-viewer-container model-viewer {
    width: 100%;
    height: 360px;
    --poster-color: transparent;
}
.yam-viewer-empty {
    text-align: center;
    color: var(--yam-text-dim);
}
.yam-viewer-empty p { margin-top: 12px; font-size: 14px; }

/* ── 生成动画 ── */
.yam-generating {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--yam-surface);
    z-index: 10;
}
.yam-gen-scene {
    width: 200px;
    height: 200px;
    position: relative;
    perspective: 600px;
}
/* 旋转线框立方体 */
.yam-gen-cube {
    width: 120px;
    height: 120px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    animation: yamCubeRotate 6s linear infinite;
    margin: -60px 0 0 -60px;
}
.yam-gen-cube .face {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 1.5px solid rgba(108, 92, 231, 0.35);
    border-radius: 4px;
    background: rgba(108, 92, 231, 0.03);
}
.yam-gen-cube .face:nth-child(1) { transform: rotateY(0deg) translateZ(60px); }
.yam-gen-cube .face:nth-child(2) { transform: rotateY(90deg) translateZ(60px); }
.yam-gen-cube .face:nth-child(3) { transform: rotateY(180deg) translateZ(60px); }
.yam-gen-cube .face:nth-child(4) { transform: rotateY(270deg) translateZ(60px); }
.yam-gen-cube .face:nth-child(5) { transform: rotateX(90deg) translateZ(60px); }
.yam-gen-cube .face:nth-child(6) { transform: rotateX(-90deg) translateZ(60px); }

@keyframes yamCubeRotate {
    0%   { transform: rotateX(-20deg) rotateY(0deg); }
    100% { transform: rotateX(-20deg) rotateY(360deg); }
}

/* 内球体脉冲 */
.yam-gen-sphere {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -25px 0 0 -25px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.4) 0%, rgba(162, 155, 254, 0.1) 60%, transparent 70%);
    animation: yamPulse 2s ease-in-out infinite;
}
@keyframes yamPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50%      { transform: scale(1.3); opacity: 1; }
}

/* 轨道粒子 */
.yam-gen-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    margin: -80px 0 0 -80px;
    border-radius: 50%;
    animation: yamOrbitSpin 4s linear infinite;
}
.yam-gen-orbit:nth-child(4) {
    width: 130px;
    height: 130px;
    margin: -65px 0 0 -65px;
    animation-duration: 3s;
    animation-direction: reverse;
}
.yam-gen-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yam-accent);
    position: absolute;
    box-shadow: 0 0 8px rgba(108, 92, 231, 0.6);
}
.yam-gen-orbit:nth-child(3) .yam-gen-dot:nth-child(1) { top: 0; left: 50%; margin-left: -3px; }
.yam-gen-orbit:nth-child(3) .yam-gen-dot:nth-child(2) { bottom: 0; left: 50%; margin-left: -3px; }
.yam-gen-orbit:nth-child(3) .yam-gen-dot:nth-child(3) { top: 50%; right: 0; margin-top: -3px; }
.yam-gen-orbit:nth-child(4) .yam-gen-dot:nth-child(1) { top: 0; left: 50%; margin-left: -3px; }
.yam-gen-orbit:nth-child(4) .yam-gen-dot:nth-child(2) { top: 50%; left: 0; margin-top: -3px; }

@keyframes yamOrbitSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 扫描线 */
.yam-gen-scan {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--yam-accent), transparent);
    opacity: 0.5;
    animation: yamScan 2.5s ease-in-out infinite;
}
@keyframes yamScan {
    0%, 100% { top: 15%; }
    50%      { top: 85%; }
}

/* 状态文字 */
.yam-gen-text {
    margin-top: 20px;
    font-size: 14px;
    color: var(--yam-accent);
    letter-spacing: 1px;
    animation: yamTextPulse 2s ease-in-out infinite;
}
@keyframes yamTextPulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}
.yam-gen-step {
    margin-top: 6px;
    font-size: 12px;
    color: var(--yam-text-dim);
}

/* ── 批量预览网格 ── */
.yam-viewer-container.batch-grid {
    overflow-y: auto;
    max-height: 600px;
    align-items: flex-start;
    justify-content: flex-start;
}
.yam-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    width: 100%;
}
.yam-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--yam-border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    cursor: pointer;
}
.yam-preview-card.active {
    border-color: var(--yam-accent);
}
.yam-preview-card model-viewer {
    width: 100%;
    height: 200px;
    --poster-color: transparent;
}
.yam-card-dl {
    display: flex;
    gap: 6px;
    padding: 4px 6px;
    justify-content: center;
}
.yam-card-dl-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--yam-accent);
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
}
.yam-card-dl-btn:hover {
    opacity: 0.85;
}

/* ── Downloads ── */
.yam-downloads { margin-top: 0; }

.yam-download-btns {
    display: flex;
    gap: 12px;
}

/* ── History ── */
.yam-history-list { min-height: 200px; }
.yam-history-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    background: var(--yam-surface);
    border: 1px solid var(--yam-border);
    border-radius: 8px;
    margin-bottom: 8px;
}
.yam-history-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--yam-surface2);
}
.yam-history-info { font-size: 13px; }
.yam-history-info .yam-name { font-weight: 500; color: var(--yam-text); }
.yam-history-info .yam-meta { color: var(--yam-text-dim); font-size: 12px; margin-top: 2px; }
.yam-history-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}
.yam-status-done { background: rgba(0,184,148,0.15); color: var(--yam-success); }
.yam-status-pending, .yam-status-processing { background: rgba(108,92,231,0.15); color: var(--yam-accent); }
.yam-status-failed { background: rgba(225,112,85,0.15); color: var(--yam-danger); }
.yam-history-actions { display: flex; gap: 8px; }
.yam-history-actions a {
    font-size: 12px;
    color: var(--yam-accent);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--yam-border);
    border-radius: 4px;
}
.yam-history-actions a:hover { border-color: var(--yam-accent); }

.yam-empty {
    text-align: center;
    padding: 40px;
    color: var(--yam-text-dim);
}

/* ── Login Prompt ── */
.yam-login-prompt {
    text-align: center;
    padding: 60px 20px;
}
.yam-login-prompt h2 { font-size: 24px; margin-bottom: 8px; }
.yam-login-prompt p { color: var(--yam-text-dim); margin-bottom: 20px; }
.yam-login-prompt .yam-btn {
    background: var(--yam-accent);
    color: #fff;
    padding: 12px 32px;
}

