/* ========================================
   前台样式 - 二次元/动漫风格
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

:root {
    --bg-main: #0d0b1e;
    --bg-card: rgba(25, 22, 50, 0.85);
    --bg-glass: rgba(40, 35, 80, 0.6);
    --border: rgba(255, 107, 157, 0.12);
    --border-hover: rgba(255, 107, 157, 0.35);
    --text: #e8e8f5;
    --text-secondary: rgba(230, 230, 245, 0.65);
    --text-muted: rgba(230, 230, 245, 0.4);
    --pink: #ff6b9d;
    --purple: #c084fc;
    --blue: #60a5fa;
    --cyan: #22d3ee;
    --green: #34d399;
    --yellow: #fbbf24;
    --gradient: linear-gradient(135deg, #ff6b9d, #c084fc, #60a5fa);
    --gradient-soft: linear-gradient(135deg, rgba(255,107,157,0.15), rgba(192,132,252,0.15));
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(255, 107, 157, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-main);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- 星空背景 ---- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255,107,157,0.4), transparent),
        radial-gradient(1px 1px at 20% 50%, rgba(192,132,252,0.3), transparent),
        radial-gradient(1.5px 1.5px at 35% 15%, rgba(96,165,250,0.5), transparent),
        radial-gradient(1px 1px at 50% 80%, rgba(255,107,157,0.3), transparent),
        radial-gradient(1px 1px at 65% 30%, rgba(34,211,238,0.3), transparent),
        radial-gradient(1.5px 1.5px at 80% 60%, rgba(192,132,252,0.4), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(96,165,250,0.3), transparent),
        radial-gradient(1px 1px at 15% 70%, rgba(255,107,157,0.2), transparent),
        radial-gradient(1.5px 1.5px at 45% 45%, rgba(34,211,238,0.3), transparent),
        radial-gradient(1px 1px at 75% 85%, rgba(192,132,252,0.2), transparent);
    background-size: 100% 100%;
    animation: twinkle 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

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

/* ---- 导航栏 ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13, 11, 30, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo .logo-icon {
    font-size: 28px;
    -webkit-text-fill-color: initial;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: var(--pink);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 16px 8px 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 220px;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: rgba(255, 107, 157, 0.4);
    width: 280px;
    background: rgba(255, 255, 255, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* ---- 主内容区 ---- */
.main-content {
    position: relative;
    z-index: 1;
    padding: 90px 30px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- 英雄区 ---- */
.hero {
    text-align: center;
    padding: 60px 20px 50px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ---- 商品网格 ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.product-card .card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .card-image img {
    transform: scale(1.08);
}

.product-card .card-image .sku-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(13, 11, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--purple);
    font-weight: 500;
}

.product-card .card-body {
    padding: 18px;
}

.product-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-price {
    font-size: 13px;
    color: var(--pink);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-footer {
    padding: 0 18px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card .view-btn {
    font-size: 12px;
    color: var(--purple);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- 无图片占位 ---- */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, rgba(255,107,157,0.08), rgba(192,132,252,0.08));
}

/* ---- 详情页 ---- */
.detail-container {
    max-width: 1100px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.detail-gallery {
    flex: 0 0 450px;
    position: sticky;
    top: 90px;
}

.detail-gallery .main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.detail-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.detail-gallery .thumb-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-gallery .thumb-item {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.6;
}

.detail-gallery .thumb-item:hover,
.detail-gallery .thumb-item.active {
    border-color: var(--pink);
    opacity: 1;
}

.detail-gallery .thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-info .product-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.detail-info .product-sku {
    display: inline-block;
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.25);
    color: var(--purple);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 20px;
}

.detail-info .price-box {
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 20px;
}

.detail-info .price-box h3 {
    font-size: 14px;
    color: var(--pink);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-info .price-box pre {
    font-family: 'Noto Sans SC', sans-serif;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    font-size: 14px;
    line-height: 1.8;
}

.detail-info .description-box {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 20px;
}

.detail-info .description-box h3 {
    font-size: 14px;
    color: var(--purple);
    margin-bottom: 10px;
}

.detail-info .description-box p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.purchase-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--gradient);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.4);
}

/* ---- 宣传素材区 ---- */
.promo-section {
    margin-top: 50px;
}

.promo-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.promo-tab {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.promo-tab:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.promo-tab.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
    font-weight: 500;
}

.promo-content {
    display: none;
}

.promo-content.active {
    display: block;
    animation: fadeUp 0.4s ease;
}

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

/* 素材网格 */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.material-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.material-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.material-item img,
.material-item video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.material-item .material-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s;
}

.material-item:hover .material-actions {
    opacity: 1;
}

.material-actions .action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn.download-btn {
    background: rgba(52, 211, 153, 0.2);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.action-btn.download-btn:hover {
    background: rgba(52, 211, 153, 0.35);
}

/* 文案列表 */
.copy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.copy-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    position: relative;
    transition: all 0.3s;
}

.copy-card:hover {
    border-color: var(--border-hover);
}

.copy-card .copy-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}

.copy-card .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 107, 157, 0.12);
    border: 1px solid rgba(255, 107, 157, 0.25);
    border-radius: 20px;
    color: var(--pink);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.copy-card .copy-btn:hover {
    background: rgba(255, 107, 157, 0.25);
}

.copy-card .copy-btn.copied {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--green);
}

/* ---- 配对模式 ---- */
.paired-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.paired-item {
    display: flex;
    gap: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.paired-item:hover {
    border-color: var(--border-hover);
}

.paired-item .paired-media {
    flex: 0 0 250px;
    aspect-ratio: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.paired-item .paired-media img,
.paired-item .paired-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paired-item .paired-media .material-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.paired-item .paired-copy {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.paired-item .paired-copy .copy-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

/* ---- 分页 ---- */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pagination a:hover {
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-2px);
}

.pagination .active {
    background: var(--gradient);
    color: white;
    border: none;
}

/* ---- 页脚 ---- */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ---- 灯箱 ---- */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- 视频标记 ---- */
.video-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .navbar { padding: 0 15px; }
    .main-content { padding: 80px 15px 40px; }
    .hero h1 { font-size: 28px; }
    .hero { padding: 30px 10px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .detail-header { flex-direction: column; gap: 25px; }
    .detail-gallery { flex: none; position: static; }
    .search-box input { width: 160px; }
    .search-box input:focus { width: 200px; }
    .paired-item { flex-direction: column; }
    .paired-item .paired-media { flex: none; aspect-ratio: 16/9; }
    .material-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 107, 157, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 107, 157, 0.4); }

/* ---- 加载动画 ---- */
.fade-in {
    animation: fadeUp 0.5s ease;
}

/* ---- 回到顶部 ---- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 100px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--pink);
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.back-to-top:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}
