/*
Theme Name: Timevip
Theme URI: https://timevip.net
Author: Timevip Team
Author URI: https://timevip.net
Description: Timevip 复刻手表商城主题，支持产品展示、博客、FAQ 等功能，支持一二级分类筛选
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: timevip
Tags: e-commerce, mobile-first, responsive
*/

:root {
    --tv-primary: #1a4a8d;
    --tv-accent: #2ecc71;
    --tv-text: #333;
    --tv-gray: #f5f5f5;
    --tv-price: #e74c3c;
    --tv-border: #eee;
    --tv-heart: #ff6b6b;
    --tv-bg: #e8e8e8;
    --tv-nav-inactive: #999;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--tv-bg);
    color: var(--tv-text);
    line-height: 1.5;
}

#tv-app-container {
    background: #fff;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    position: relative;
    padding-bottom: 60px;
    overflow-x: hidden;
}

/* ========== Header ========== */
.tv-header {
    background: var(--tv-primary);
    padding: 15px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tv-header.hidden {
    display: none;
}

.tv-logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.tv-logo span { 
color: #0f8;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0,255,136,.5);
}

.tv-search-box {
    flex: 1;
    position: relative;
    min-width: 0;
}

.tv-search-box input {
    width: 100%;
    padding: 9px 38px 9px 14px;
    border-radius: 22px;
    border: none;
    outline: none;
    font-size: 13px;
    background: #fff;
    color: #333;
    height: 38px;
}

.tv-search-box input::placeholder {
    color: #999;
}

.tv-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    cursor: pointer;
}

/* ========== Pages ========== */
.tv-page {
    display: none;
    animation: fadeIn 0.25s ease;
    min-height: calc(100vh - 60px);
}

#tv-home.tv-page {

}

#tv-blog.tv-page, 
#tv-faq.tv-page, 
#tv-me.tv-page {
    padding: 20px 15px;
	    background: #f8f8f8;
}

.tv-page.active {
    display: block;
}

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

/* ========== Brand Grid (一级分类) ========== */
.tv-brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.tv-brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    padding: 15px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 90px;
    text-align: center;
}

.tv-brand-item:hover { 
    background: #f0f0f0; 
}

.tv-brand-item.active { 
    background: #e8e8e8;

}

.tv-brand-icon {
    font-size: 24px;
    margin-bottom: 6px;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 100%;
}

.tv-brand-name111111 {
    font-size: 11px;
    text-align: center;
    color: #333;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
}

/* ========== Series Grid (二级分类) ========== */
.tv-series-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.tv-series-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.tv-series-item:hover { 
    transform: scale(1.05); 
}

.tv-series-item.active .tv-series-img { 
    background: #e8e8e8;

}

.tv-series-img {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 6px;
    object-fit: cover;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.tv-series-name111111 {
    font-size: 10px;
    text-align: center;
    color: #666;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== Product Grid ========== */
.tv-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.tv-product-card {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tv-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.tv-prod-img-box {
    width: 100%;
    aspect-ratio: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 25px;
}

.tv-prod-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tv-prod-heart {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tv-prod-heart:hover, 
.tv-prod-heart.active { 
    color: var(--tv-heart); 
}

.tv-prod-heart i { 
    font-size: 12px; 
}

.tv-prod-info { 
    padding: 10px; 
    text-align: center; 
}

.tv-prod-title { 
    font-size: 12px; 
    margin: 4px 0; 
    font-weight: 500; 
    color: #333; 
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 4px;
}

.tv-prod-price { 
    color: var(--tv-price); 
    font-weight: 700; 
    font-size: 14px; 
    margin: 6px 0 8px 0; 
}

.tv-btn-order {
    display: block;
    width: 100%;
    background: #0f0;
    color: #000;
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.tv-btn-order:hover { 
    background: #0f0;
    color: #000;
}

/* ========== Blog Page ========== */
.tv-blog-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px 0 20px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.tv-blog-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tv-blog-add-btn {
    position: absolute;
    right: 0;
    width: 28px;
    height: 28px;
    background: #0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
    flex-shrink: 0;
}

.tv-blog-add-btn i { 
    color: #fff; 
    font-size: 16px; 
}

.tv-blog-post {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tv-blog-post:last-child { 
    border-bottom: none; 
}

.tv-user-info { 
    display: flex; 
    align-items: center; 
    margin-bottom: 10px; 
}

.tv-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    background: #ddd; 
    margin-right: 10px; 
    object-fit: cover; 
    flex-shrink: 0;
}

.tv-username { 
    font-weight: 600; 
    font-size: 14px; 
    color: #333; 
}

.tv-post-content { 
    font-size: 14px; 
    margin-bottom: 10px; 
    color: #555; 
    line-height: 1.5; 
}

.tv-post-img { 
    width: 100%; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    cursor: pointer; 
    background: #f5f5f5;
    object-fit: cover;
}

.tv-post-actions { 
    display: flex; 
    gap: 20px; 
    color: #666; 
    font-size: 13px; 
}

.tv-action-item { 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    transition: color 0.2s; 
}

.tv-action-item:hover { 
    color: var(--tv-primary); 
}

/* ========== FAQ Page ========== */
.tv-faq-header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 10px;
}

.tv-faq-icon {
    width: 50px;
    height: 50px;
    background: #1a1a2e;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.tv-faq-icon i {
    font-size: 34px;
    color: var(--tv-accent);
}

.tv-faq-header h2 {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tv-faq-item {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.tv-faq-question {
    padding: 16px 15px;
    background: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 13px;
    transition: background 0.2s;
    color: #333;
}

.tv-faq-question:hover { 
    background: #fafafa; 
}

.tv-faq-number {
    background: linear-gradient(135deg, #0f0, #0c0);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-right: 10px;
    font-weight: 700;
    flex-shrink: 0;
	box-shadow: 0 2px 6px #00ff004d;
}
.tv-faq2026 {
    background: #f5f5f5;
}
.tv-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #fff;
    padding: 0 15px;
    font-size: 12px;
    color: #888;
    line-height: 1.7;
    border-top: 1px solid #f9f9f9;
}

.tv-faq-item.open .tv-faq-answer {
    padding: 14px 15px 16px 15px;
    max-height: 500px;
}

.tv-faq-item.open .tv-faq-question i {
    transform: rotate(180deg);
    color: var(--tv-accent);
}

/* ========== Me Page ========== */
.tv-me-container {
    text-align: center;
    padding: 60px 20px;
}

.tv-me-icon { 
    font-size: 64px; 
    color: #ddd; 
    margin-bottom: 15px; 
}

.tv-me-title { 
    font-size: 18px; 
    margin-bottom: 8px; 
    color: #333; 
    font-weight: 600; 
}

.tv-me-desc { 
    color: #888; 
    font-size: 13px; 
    margin-bottom: 20px; 
}

/* ========== Bottom Nav ========== */
.tv-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

.tv-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--tv-nav-inactive);
    text-decoration: none;
    font-size: 10px;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s;
}

.tv-nav-item i { 
    font-size: 20px; 
    margin-bottom: 4px; 
}

.tv-nav-item.active { 
    color: var(--tv-accent); 
}

.tv-nav-item:hover { 
    color: var(--tv-primary); 
}

/* ========== Modal ========== */
.tv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.tv-modal-content {
    background: #fff;
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    animation: modalPop 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.tv-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f5f5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
    z-index: 10;
}

.tv-modal-close:hover { 
    background: #e8e8e8; 
    color: #333; 
}

.tv-modal-img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    margin-bottom: 15px;
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
}

.tv-modal-title { 
    font-size: 17px; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: #333; 
}

.tv-modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
}

.tv-modal-heart {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 20px;
    transition: all 0.2s;
}

.tv-modal-heart:hover, 
.tv-modal-heart.active { 
    color: var(--tv-heart); 
}

.tv-modal-heart i { 
    font-size: 14px; 
}

.tv-modal-price { 
    font-size: 22px; 
    color: var(--tv-price); 
    font-weight: 700; 
    margin-bottom: 18px; 
}

.tv-payment-icons { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 20px; 
    font-size: 22px; 
    color: #666; 
    flex-wrap: wrap; 
}

.tv-modal-actions { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.tv-btn-msg {
    background: #0084ff; 
    color: #fff; 
    border: none; 
    padding: 12px; 
    border-radius: 8px;
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    font-size: 13px; 
    transition: background 0.2s;
}

.tv-btn-msg:hover { 
    background: #0073e6; 
}

.tv-btn-wa {
    background: #25D366; 
    color: #fff; 
    border: none; 
    padding: 12px; 
    border-radius: 8px;
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    font-size: 13px; 
    transition: background 0.2s;
}

.tv-btn-wa:hover { 
    background: #20bd5a; 
}

/* ========== Image Viewer ========== */
.tv-image-viewer {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.92); 
    z-index: 3000; 
    display: none;
    justify-content: center; 
    align-items: center; 
    padding: 20px;
}

.tv-image-viewer img { 
    max-width: 100%; 
    max-height: 100%; 
    border-radius: 8px; 
}

.tv-image-viewer-close {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    color: #fff;
    font-size: 30px; 
    cursor: pointer; 
    opacity: 0.8; 
    transition: opacity 0.2s;
}

.tv-image-viewer-close:hover { 
    opacity: 1; 
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { 
    width: 5px; 
}

::-webkit-scrollbar-track { 
    background: #f1f1f1; 
}

::-webkit-scrollbar-thumb { 
    background: #ccc; 
    border-radius: 3px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: #aaa; 
}

/* ========== WordPress Admin Bar ========== */
.admin-bar #tv-app-container {
    margin-top: 32px;
}

@media (max-width: 782px) {
    .admin-bar #tv-app-container {
        margin-top: 46px;
    }
}

/* ========== Loading State ========== */
.tv-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.tv-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 在原有 CSS 基础上，确保 FAQ 样式正确 */

.tv-faq-question {
    cursor: pointer;
    user-select: none;
}

.tv-faq-item.open .tv-faq-answer {
    padding: 14px 15px 16px 15px;
    max-height: 500px;
}

.tv-faq-item.open .tv-faq-question i {
    transform: rotate(180deg);
    color: var(--tv-accent);
}

/* ========== Brand Grid (一级分类) ========== */
.tv-brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 强制 4 列平分 */
    gap: 10px;
    margin-bottom: 2px;
    width: 100%;
	padding: 15px 15px 5px 15px;
}

.tv-brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    padding: 10px 5px; /* 稍微减小左右内边距，给文字留空间 */
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
    
    /* 【关键修复】限制最大宽度，防止文字撑破布局 */
    max-width: 100%; 
    min-width: 0; /* 允许 Flex 子项缩小 */
}

.tv-brand-img {
    width: 100%;
    aspect-ratio: 5/3;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;

    display: block;
}

.tv-brand-name {
    font-size: 11px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    
    /* 【关键修复】单行省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* 占满父容器宽度 */
    display: block;
}

/* ========== Series Grid (二级分类) ========== */
.tv-series-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 强制 5 列平分 */
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
	padding: 15px 15px 5px 15px;
}

.tv-series-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    
    /* 【关键修复】限制最大宽度 */
    max-width: 100%;
    min-width: 0;
}

.tv-series-img {
    width: 100%;
    aspect-ratio: 3/5;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 6px;
    object-fit: cover;
    transition: all 0.2s;
    border: 1px solid #ffffff;
    display: block;
	padding: 18px 8px;
}

.tv-series-name {
    font-size: 10px;
    color: #666;
    font-weight: 500;
    line-height: 1.2;
	text-align: center;
    
    /* 【关键修复】单行省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.tv-product-grid2026 {
    padding: 15px;
	background: #f8f8f8;
}
.tv-payment-icons img{
    height: 20px;
    width: auto;
    object-fit: contain;
}	