/* ==========================================
   海拓選品 - 统一样式表
   配色：深海军蓝 + 高级金（Consulting Firm）
   风格：Fortune 500 高级商务 / 沉稳权威 / 低调奢华
   ========================================== */

/* ==========================================
   1. CSS 变量
   ========================================== */

:root {
    --primary-color: #1E3A8A;
    --primary-light: #3B5998;
    --primary-dark: #152C6B;
    --primary-subtle: rgba(30, 58, 138, 0.06);

    --dark-color: #0F172A;
    --dark-light: #1E293B;
    --dark-deep: #0A101F;

    --bg-color: #FFFFFF;
    --bg-subtle: #F1F4F8;
    --bg-section: #E8ECF2;
    --card-bg: #FFFFFF;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --border-color: #DDE3EC;
    --border-light: #EDF0F5;

    --accent-gold: #C6901A;
    --accent-gold-light: rgba(198, 144, 26, 0.08);
    --accent-gold-deep: #A6760D;

    --success-color: #059669;
    --error-color: #DC2626;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 36px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-card-hover: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --sidebar-width: 280px;
}


/* ==========================================
   2. 基础样式
   ========================================== */

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

body {
    font-family: 'Noto Sans JP', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

::selection {
    background-color: rgba(30, 58, 138, 0.12);
    color: var(--text-primary);
}


/* ==========================================
   3. 动画
   ========================================== */

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

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.card-hover {
    transition: transform 0.35s ease-out, box-shadow 0.35s ease-out;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.btn-hover {
    transition: all 0.25s ease-out;
}

.btn-hover:hover {
    transform: translateY(-1px);
}

.modal-backdrop {
    animation: fadeIn 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .card-hover,
    .btn-hover,
    .gallery-img,
    .modal-backdrop {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}


/* ==========================================
   4. 分类标签样式
   ========================================== */

.level1-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.level1-tag {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease-out;
    color: var(--text-secondary);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}

.level1-tag:hover {
    color: var(--primary-color);
    border-color: rgba(30, 58, 138, 0.3);
    background-color: var(--primary-subtle);
}

.level1-tag.active {
    background: linear-gradient(135deg, #4A6FA5 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.level2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 18px 0 8px;
    border-top: 1px solid var(--border-light);
}

.level2-tag {
    font-size: 0.76rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease-out;
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid var(--border-light);
}

.level2-tag:hover {
    color: var(--primary-color);
    border-color: rgba(30, 58, 138, 0.25);
    background-color: var(--primary-subtle);
}

.level2-tag.active {
    background: linear-gradient(135deg, #4A6FA5 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}


/* ==========================================
   5. 产品卡片样式
   ========================================== */

.product-card {
    break-inside: avoid;
    border-radius: var(--radius-lg);
    border: none;
    background: var(--card-bg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.product-card-img {
    cursor: pointer;
}

.product-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease-out;
    border: none;
    outline: none;
}

.product-card-btn.btn-scene {
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.product-card-btn.btn-scene:hover {
    background: linear-gradient(135deg, #4A6FA5 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
}

.product-card-btn.btn-scene-disabled {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.product-card-btn.btn-scene-disabled:hover {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}


/* ==========================================
   6. 画廊样式
   ========================================== */

.gallery-img {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.gallery-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}


/* ==========================================
   7. 顶部导航栏样式
   ========================================== */

.top-bar {
    background: linear-gradient(135deg, #0a101f 0%, #0f172a 30%, #1e293b 60%, #1e3a5f 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 13px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lang-btn {
    transition: all 0.3s ease-out;
    font-family: 'Noto Sans JP', 'Noto Sans SC', sans-serif;
}

.lang-btn:hover:not([style*="primary"]) {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}


/* ==========================================
   8. Toast 提示消息样式
   ========================================== */

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--primary-color);
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
}

.toast.hidden {
    animation: slideOutRight 0.3s ease forwards;
}


/* ==========================================
   9. 响应式设计
   ========================================== */

@media (max-width: 640px) {
    .level1-tag {
        font-size: 0.76rem;
        padding: 7px 16px;
    }
    .level2-tag {
        font-size: 0.72rem;
        padding: 4px 12px;
    }
    .product-card-btn {
        font-size: 0.72rem;
        padding: 6px 12px;
    }
    .top-bar-inner {
        padding: 12px 16px;
    }
}


/* ==========================================
   10. 产品详情模态框样式
   ========================================== */

.detail-modal-inner {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-modal-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.detail-image-col {
    width: 50%;
    background-color: var(--bg-subtle);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow: hidden;
    flex-shrink: 0;
}

.detail-image-col img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.detail-text-col {
    width: 50%;
    padding: 32px;
    overflow-y: auto;
    flex-shrink: 0;
}

.detail-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-product-title {
    font-size: 1.22rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.detail-md-body h1,
.detail-md-body h2,
.detail-md-body h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.detail-md-body h1 { font-size: 1.12rem; font-weight: 600; }
.detail-md-body h2 { font-size: 1.02rem; font-weight: 600; }
.detail-md-body h3 { font-size: 0.95rem; font-weight: 500; }
.detail-md-body p {
    margin-bottom: 10px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.detail-md-body ul,
.detail-md-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}
.detail-md-body li {
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.75;
}
.detail-md-body strong {
    color: var(--text-primary);
    font-weight: 600;
}
.detail-md-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 0.8rem;
}
.detail-md-body th,
.detail-md-body td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}
.detail-md-body th {
    background-color: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .detail-modal-body {
        flex-direction: column;
    }
    .detail-image-col {
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        min-height: 200px;
        max-height: 40vh;
    }
    .detail-text-col {
        width: 100%;
    }
}


/* ==========================================
   11. 场景页面样式
   ========================================== */

.scene-page {
    background-color: var(--dark-deep);
    overflow: hidden;
    height: 100vh;
}

.scene-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 56px);
}

.scene-empty-content {
    text-align: center;
    padding: 40px;
}

.scene-slideshow-container {
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-image-wrapper {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 60px;
}

.scene-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.scene-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
}

.scene-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.scene-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.scene-nav-prev {
    left: 24px;
}

.scene-nav-next {
    right: 24px;
}

@media (max-width: 768px) {
    .scene-image-wrapper {
        padding: 20px 16px;
    }
    .scene-nav-btn {
        width: 40px;
        height: 40px;
    }
    .scene-nav-prev {
        left: 8px;
    }
    .scene-nav-next {
        right: 8px;
    }
}


/* ==========================================
   12. 面包屑样式
   ========================================== */

#breadcrumb {
    letter-spacing: 0.02em;
}


/* ==========================================
   13. 产品分组标题样式
   ========================================== */

.product-group-title {
    position: relative;
    padding-left: 16px;
    font-size: 0.95rem;
}

.product-group-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
}

.product-group-divider {
    height: 1px;
    margin-top: 8px;
    background: linear-gradient(90deg, var(--border-color) 0%, transparent 100%);
}
