/* style.css */

/* --- 全局变量与重置 --- */
:root {
    --primary: #2563eb;       
    --primary-hover: #1d4ed8;
    --accent: #f43f5e;        
    --bg-body: #f1f5f9;       
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --bg-sticky: rgba(255, 255, 255, 0.95);
    --text-main: #0f172a;     
    --text-sub: #64748b;      
    --text-muted: #cbd5e1;    
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --tag-high-bg: #dbeafe;
    --tag-high-text: #1e40af;
    --tag-low-bg: #f1f5f9;
    --tag-low-text: #64748b;
}

[data-theme="dark"] {
    --primary: #3b82f6;       
    --primary-hover: #60a5fa;
    --accent: #fb7185;         
    --bg-body: #0f172a;        
    --bg-card: #1e293b;        
    --bg-input: #334155;       
    --bg-sticky: rgba(30, 41, 59, 0.95); 
    --text-main: #f1f5f9;      
    --text-sub: #94a3b8;       
    --text-muted: #475569;     
    --border: #334155;         
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --tag-high-bg: rgba(37, 99, 235, 0.2);
    --tag-high-text: #60a5fa;
    --tag-low-bg: #334155;
    --tag-low-text: #94a3b8;
}

* { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.hero, .hero * { transition: none; }
body { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.6; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }

/* --- 顶部 Hero 区域 --- */
.hero {
    position: relative; width: 100%;
    /* 这里定义了一个默认图，防止万一html里没填图片变空白 */
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)), var(--bg-img, url('https://img.axure6.com/imgs/2025/11/headbg.jpg')) center/cover;
    padding: 60px 0 80px; color: #fff; overflow: hidden;
}
.hero::before { content: ''; position: absolute; top: -50px; right: -50px; width: 300px; height: 300px; background: rgba(255,255,255,0.1); border-radius: 50%; filter: blur(40px); }
.hero::after { content: ''; position: absolute; bottom: -30px; left: 10%; width: 200px; height: 200px; background: rgba(255,255,255,0.05); border-radius: 50%; filter: blur(30px); }
.hero-content { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.logo-box { display: flex; align-items: center; gap: 16px; }
.logo-box img { width: 48px; height: 48px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.2); }
.logo-box a { font-size: 24px; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: 0.5px; }

.top-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.top-buttons a { padding: 8px 20px; border-radius: 50px; background: rgba(255,255,255,0.15); backdrop-filter: blur(5px); color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.3s ease; border: 1px solid rgba(255,255,255,0.1); }
.top-buttons a:hover { background: #fff; color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.search-area { max-width: 800px; margin: 0 auto; text-align: center; }
.search-title { font-size: 28px; margin-bottom: 24px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.search-title span.red { color: #ff9cae; font-weight: 800; background: rgba(0,0,0,0.2); padding: 0 8px; border-radius: 4px; }

.search-box { display: flex; gap: 0; background: var(--bg-card); padding: 6px; border-radius: 16px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); transition: transform 0.3s ease; }
.search-box:focus-within { transform: translateY(-2px); }
.search-box input { flex: 1; padding: 16px 24px; border: none; background: transparent; font-size: 16px; color: var(--text-main); outline: none; }
.search-box button { padding: 12px 36px; background: var(--primary); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.3s; }
.search-box button:hover { background: var(--primary-hover); }

/* --- 吸顶栏 --- */
.sticky-header { position: fixed; top: 0; left: 0; width: 100%; background: var(--bg-sticky); backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); z-index: 999; padding: 12px 24px; display: flex; justify-content: center; align-items: center; transform: translateY(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-bottom: 1px solid var(--border); }
.sticky-header.visible { transform: translateY(0); }
.sticky-content { width: 100%; max-width: 1200px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sticky-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); font-weight: 800; font-size: 18px; }
.sticky-logo img { width: 32px; height: 32px; border-radius: 8px; }
.sticky-search { flex: 1; max-width: 600px; display: flex; background: var(--bg-input); border-radius: 50px; padding: 4px; border: 1px solid transparent; transition: all 0.2s; }
.sticky-search:focus-within { background: var(--bg-card); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.sticky-search input { flex: 1; border: none; background: transparent; padding: 8px 16px; font-size: 14px; outline: none; color: var(--text-main); }
.sticky-search button { background: var(--primary); color: #fff; border: none; border-radius: 50px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* --- 内容区域 --- */
.container { max-width: 1200px; margin: -40px auto 0; padding: 0 24px 60px; position: relative; z-index: 3; }

.filter-section { background: var(--bg-card); padding: 24px; border-radius: 16px; box-shadow: var(--shadow-md); margin-bottom: 30px; display: flex; flex-direction: column; gap: 20px; border: 1px solid var(--border); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-label { font-size: 14px; font-weight: 600; color: var(--text-main); margin-right: 8px; min-width: 40px; }
.filter-row button { padding: 8px 16px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-sub); border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.filter-row button:hover { background: var(--bg-input); color: var(--text-main); }
.filter-row button.active { background: rgba(37, 99, 235, 0.1); color: var(--primary); border-color: var(--primary); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 16px; }
.item { background: var(--bg-card); border-radius: 16px; padding: 12px; display: grid; grid-template-columns: 60px 3fr 1.2fr 1fr 1fr 140px; align-items: center; gap: 20px; border: 1px solid transparent; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .item { border: 1px solid var(--border); }
.item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(37, 99, 235, 0.3); }

/* --- 序号字体修正：移除 monospace --- */
.index-num { font-size: 16px; font-weight: 700; color: var(--text-muted); text-align: center; }
.item:hover .index-num { color: var(--primary); }
.item-title { font-weight: 700; font-size: 17px; color: var(--text-main); line-height: 1.4; }
.fidelity-tag { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.fidelity-tag.high { background: var(--tag-high-bg); color: var(--tag-high-text); }
.fidelity-tag.low { background: var(--tag-low-bg); color: var(--tag-low-text); }
.item-info { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-sub); }
.item-info span.val { color: var(--text-main); font-weight: 600; }
.item-price { color: var(--accent); font-weight: 700; font-size: 18px; }
.item-price small { font-size: 12px; color: var(--text-sub); font-weight: normal; }

.view-btn { display: block; padding: 10px 0; border: 1px solid var(--primary); border-radius: 10px; background: transparent; color: var(--primary); text-align: center; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; transition: all 0.2s ease; box-shadow: none; }
.view-btn:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); transform: translateY(-1px); }
.view-btn:active { background: var(--primary-hover); transform: translateY(0); }

/* --- 悬浮按钮 (图标版) --- */
.float-box { position: fixed; right: 30px; bottom: 40px; display: flex; flex-direction: column; gap: 16px; z-index: 99; }

/* 基础按钮样式 */
.float-btn {
    width: 56px; height: 56px; border-radius: 50%;
    background-color: var(--bg-card); 
    cursor: pointer; position: relative;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
    /* 核心：图标居中 */
    background-position: center;
    background-repeat: no-repeat;
    background-size: 24px; /* 图标大小，根据你的图片调整 */
}
/* 悬浮时变成实心蓝底 */
.float-btn:hover { 
    transform: scale(1.1); 
    box-shadow: var(--shadow-lg); 
    background-color: var(--primary); 
    border-color: var(--primary);
}

/* =========================================
   在此处填入你的图标链接 
   建议使用 48x48 或 64x64 的 PNG/SVG 
   ========================================= */

/* 1. 购买帮助 */
#helpBtn { background-image: url('../imgs/buy_bai.svg'); }
#helpBtn:hover, [data-theme="dark"] #helpBtn:hover { background-image: url('../imgs/buy_an.svg'); }

/* 2. 切换模式 (默认显示月亮-蓝) */
#themeBtn { background-image: url('../imgs/moon_lan.svg'); }
#themeBtn:hover { background-image: url('../imgs/moon_an.svg'); }

/* 暗黑模式下的切换按钮 (显示太阳) */
[data-theme="dark"] #themeBtn { background-image: url('../imgs/sun_lan.svg'); }
[data-theme="dark"] #themeBtn:hover { background-image: url('../imgs/sun_an.svg'); }

/* 3. 返回顶部 */
#topBtn { background-image: url('../imgs/top_bai.svg'); }
#topBtn:hover, [data-theme="dark"] #topBtn:hover { background-image: url('../imgs/top_an.svg'); }

/* 暗黑模式下，默认图标要不要变白？
   目前逻辑：暗黑模式默认还是用蓝色图标（因为卡片背景是深灰），鼠标移上去变蓝底白图标。
   如果你希望暗黑模式默认就是白色图标，请修改上面的链接。
*/

.tip { position: absolute; right: 70px; top: 50%; transform: translateY(-50%) translateX(10px); background: #1e293b; color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 6px; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.2); pointer-events: none; }
.float-btn:hover .tip { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }

/* --- 弹窗样式 --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background: var(--bg-card); border-radius: 24px; padding: 40px; width: 90%; max-width: 480px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); transform: scale(0.95); opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); position: relative; border: 1px solid var(--border); }
.modal-overlay.active .modal-content { transform: scale(1); opacity: 1; }
.modal-close { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-body); border: 1px solid var(--border); font-size: 20px; line-height: 1; color: var(--text-sub); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg-input); color: var(--text-main); }
.modal-title { font-size: 22px; font-weight: 800; color: var(--text-main); margin-bottom: 24px; text-align: center; }
.modal-body { color: var(--text-sub); font-size: 15px; line-height: 1.8; }
.modal-body ul { margin-left: 20px; margin-bottom: 24px; color: var(--text-main); }
.highlight { color: var(--accent); font-weight: 700; background: rgba(244, 63, 94, 0.1); padding: 0 4px; border-radius: 4px; }
.purchase-btn { display: block; width: 100%; padding: 16px; background: linear-gradient(135deg, #ff5c00 0%, #ff6f1d 100%); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; text-align: center; text-decoration: none; margin-top: 10px; cursor: pointer; box-shadow: 0 4px 12px rgba(235, 127, 37, 0.3); transition: all 0.3s; }
.purchase-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(235, 127, 37, 0.4); }
.wechat-btn, .taobao-btn { display: block; width: 100%; padding: 16px; background: #25ca77; color: #fff; border: 1px solid #07c160; border-radius: 12px; font-size: 16px; font-weight: 600; text-align: center; margin-top: 12px; cursor: pointer; transition: all 0.3s; }
.wechat-btn:hover { background: #07c160; color: #fff; }
.taobao-btn { color: #ff5000; border-color: #ff5000; }
.taobao-btn:hover { background: #ff5000; color: #fff; }
.qr-code { display: block; max-width: 240px; margin: 20px auto; border-radius: 12px; border: 1px solid var(--border); padding: 10px; background: #fff; }

/* --- 响应式优化 --- */
@media (max-width: 768px) {
    .container { padding: 15px; margin-top: -20px; }
    .hero { padding: 40px 0 60px; }
    header { flex-direction: column; gap: 20px; align-items: center; }
    .logo-box a { font-size: 20px; }
    .top-buttons { justify-content: center; }
    .search-title { font-size: 20px; padding: 0 10px; }
    .search-box { flex-direction: column; padding: 10px; gap: 10px; }
    .search-box input { padding: 12px; text-align: center; border-bottom: 1px solid var(--border); }
    .search-box button { width: 100%; }
    .sticky-header { padding: 10px 15px; }
    .sticky-logo span { display: none; }
    .sticky-search { padding: 2px; }
    .sticky-search input { padding: 8px 12px; }
    .sticky-search button { padding: 6px 16px; }
    .filter-section { padding: 16px; gap: 16px; }
    .filter-row { justify-content: flex-start; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .filter-row::-webkit-scrollbar { display: none; }
    .filter-row button { white-space: nowrap; flex-shrink: 0; }
    
    .item { display: grid; grid-template-columns: 25px max-content max-content 1fr max-content; gap: 6px; padding: 16px; align-items: center; }
    .index-num { display: block; font-size: 14px; grid-column: 1 / 2; grid-row: 1 / 2; margin-top: 2px; }
    .item-title { grid-column: 2 / -1; grid-row: 1 / 2; font-size: 16px; margin-bottom: 4px; line-height: 1.4; }
    .item-info-group { grid-column: 2 / 3; grid-row: 2 / 3; display: flex; align-items: center; }
    .fidelity-tag { display: inline-block; padding: 3px 8px !important; font-size: 12px !important; line-height: 1; border-radius: 4px; white-space: nowrap; margin: 0; transform: none; }
    .item-info { grid-column: 3 / 4; grid-row: 2 / 3; font-size: 12px; color: var(--text-sub); margin-left: 4px; white-space: nowrap; display: flex; align-items: center; }
    .item-price { grid-column: 5 / 6; grid-row: 2 / 3; text-align: right; white-space: nowrap; font-size: 16px; padding: 0; }
    .view-btn { grid-column: 1 / -1; grid-row: 3 / 4; margin-top: 8px; }
    .modal-content { padding: 24px; width: 85%; }
}