/* =========================================
   1. 全局变量与基础设置
   ========================================= */
:root {
    --bg-color: #0f0f0f;
    --text-color: #f0f0f0;
    --text-secondary: #999;
    --accent-color: #818cf8;
    --border-color: #333;
    --particle-bg-color: rgba(255, 255, 255, 0.2);
    --particle-text-color: #ffffff;
    --fab-bg: #2c2c2c;
    --card-bg: #1e1e1e;
    --shadow-color: rgba(0,0,0,0.4);

    /* 景观卡片：深色模式 */
    --ls-sky-start: #0f172a;
    --ls-sky-end: #312e81;
    --ls-ocean-start: #1e1b4b;
    --ls-ocean-end: #3730a3;
    --ls-sun-bg: #fefce8;
    --ls-sun-shadow: rgba(255, 255, 255, 0.2);
    --ls-hill-1: #334155;
    --ls-hill-2: #475569;
    --ls-hill-3: #1e293b;
    --ls-hill-4: #0f172a;
    --ls-tree-color: #94a3b8;
    --ls-text: #e2e8f0;
}

body.light-mode {
    --bg-color: #f3f4f6;
    --text-color: #111827;
    --text-secondary: #6b7280;
    --accent-color: #4f46e5;
    --border-color: #e5e7eb;
    --particle-bg-color: rgba(0, 0, 0, 0.3);
    --particle-text-color: #1f2937; 
    --fab-bg: #ffffff;
    --card-bg: #ffffff;
    --shadow-color: rgba(0,0,0,0.08);

    /* 景观卡片：浅色模式 */
    --ls-sky-start: rgba(247, 225, 87, 1);
    --ls-sky-end: rgba(233, 101, 148, 1);
    --ls-ocean-start: rgba(241, 192, 125, 1);
    --ls-ocean-end: rgba(247, 218, 150, 1);
    --ls-sun-bg: #ffffff;
    --ls-sun-shadow: white;
    --ls-hill-1: #e6b29d;
    --ls-hill-2: #c29182;
    --ls-hill-3: #b77873;
    --ls-hill-4: #a16773;
    --ls-tree-color: #b77873;
    --ls-text: #ffffff;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; position: relative;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* 头部 */
header {
    text-align: center; position: relative; z-index: 2; width: 100%;
    margin-top: 8vh; margin-bottom: 20px;
}
#title-canvas-wrapper { position: relative; width: 100%; height: 120px; }
canvas#title-canvas { display: block; width: 100%; height: 100%; }

/* 主容器 */
.main-wrapper {
    width: 90%; max-width: 800px; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    gap: 30px; margin-bottom: 40px;
}

/* 景观时钟 */
.dashboard-section { width: 100%; display: flex; justify-content: center; }
.landscape-card {
    position: relative; width: 100%; max-width: 500px; height: 280px;
    border-radius: 24px; overflow: hidden;
    box-shadow: 0 15px 35px var(--shadow-color);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    transition: transform 0.3s;
}
.landscape-card:hover { transform: translateY(-5px); }

.landscape-section { position: relative; width: 100%; height: 100%; overflow: hidden; }
.landscape-section * { position: absolute; transition: background-color 0.5s, fill 0.5s; }

.sky { width: 100%; height: 100%; background: linear-gradient(0deg, var(--ls-sky-start) 0%, var(--ls-sky-end) 100%); }
.ocean { bottom: 0; width: 100%; height: 30%; background: linear-gradient(0deg, var(--ls-ocean-start) 0%, var(--ls-ocean-end) 100%); z-index: 4; }
.sun {
    display: flex; align-items: center; justify-content: center;
    width: 50px; height: 50px; border-radius: 50%;
    background-color: var(--ls-sun-bg);
    bottom: 45%; left: 20%;
    filter: drop-shadow(0px 0px 15px var(--ls-sun-shadow));
    z-index: 2; transition: all 0.5s;
}
.reflection { background-color: rgba(255,255,255,0.3); z-index: 5; }
.reflection:nth-child(1) { width: 40px; height: 10px; clip-path: polygon(0% 0%, 100% 0%, 50% 20%); top: 10%; left: 30%; }
.reflection:nth-child(2) { width: 80px; height: 15px; clip-path: polygon(0% 0%, 100% 0%, 60% 20%, 40% 20%); top: 20%; left: 35%; }
.reflection:nth-child(3) { width: 60px; height: 2px; clip-path: polygon(0% 50%, 40% 0%, 60% 0%, 100% 50%, 60% 100%, 40% 100%); top: 27%; right: 15%; }
.reflection:nth-child(4) { width: 70px; height: 2px; clip-path: polygon(0% 50%, 40% 0%, 60% 0%, 100% 50%, 60% 100%, 40% 100%); top: 37%; right: 28%; }
.reflection:nth-child(5) { width: 70px; height: 3px; clip-path: polygon(0% 50%, 40% 0%, 60% 0%, 100% 50%, 60% 100%, 40% 100%); top: 46%; right: 8%; }

.hill-1 { right: -20%; bottom: 25%; width: 160px; height: 50px; border-radius: 50%; background-color: var(--ls-hill-1); z-index: 3;}
.hill-2 { right: -30%; bottom: 15%; width: 160px; height: 90px; border-radius: 50%; background-color: var(--ls-hill-2); z-index: 3;}
.hill-3 { left: -20%; bottom: -30%; width: 300px; height: 140px; border-radius: 50%; background-color: var(--ls-hill-3); z-index: 3;}
.hill-4 { right: -50%; bottom: -40%; width: 300px; height: 150px; border-radius: 50%; background-color: var(--ls-hill-4); z-index: 3;}
.tree-1 { bottom: 25%; left: 5%; width: 50px; height: 70px; z-index: 3; color: var(--ls-tree-color); }
.tree-3 { bottom: 15%; right: 5%; width: 60px; height: 80px; z-index: 3; color: var(--ls-tree-color); }

.filter {
    height: 100%; width: 100%;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 6; pointer-events: none;
}

.clock-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    color: var(--ls-text); text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.clock-time { font-size: 3.5rem; font-weight: 800; font-family: 'Courier New', monospace; line-height: 1.1; }
.clock-date { font-size: 1.1rem; font-weight: 500; opacity: 0.9; letter-spacing: 1px; margin-bottom: 5px; }
.clock-location {
    margin-top: 10px; display: flex; align-items: center; gap: 5px; 
    font-size: 0.9rem; opacity: 0.8; background: rgba(0,0,0,0.2);
    padding: 4px 12px; border-radius: 20px; backdrop-filter: blur(4px);
}
.clock-location svg { width: 14px; height: 14px; }

.section-divider {
    width: 100%; text-align: center; position: relative; margin: 10px 0; opacity: 0.6;
}
.section-divider span {
    background: var(--bg-color); padding: 0 15px; position: relative; z-index: 2;
    font-size: 0.85rem; color: var(--text-secondary); letter-spacing: 2px; text-transform: uppercase;
}
.section-divider::before {
    content: ""; position: absolute; top: 50%; left: 10%; right: 10%;
    height: 1px; background: var(--border-color); z-index: 1;
}

/* 导航列表 */
.nav-section { width: 100%; }
.nav-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px;
}
.nav-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
    text-decoration: none; color: var(--text-color);
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.nav-card:hover {
    transform: translateY(-5px); border-color: var(--accent-color);
    box-shadow: 0 10px 20px var(--shadow-color);
}
.nav-card .icon-box {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: rgba(129, 140, 248, 0.1); border-radius: 10px; transition: background 0.3s;
}
.nav-card:hover .icon-box { background: var(--accent-color); }
.nav-card svg { width: 24px; height: 24px; fill: var(--text-color); transition: all 0.3s; stroke: none; }
.nav-card:hover svg { fill: white; stroke: white; }
.shop-card svg { fill: none; stroke: var(--text-color); stroke-width: 2; }
.shop-card:hover svg { fill: none; stroke: white; }

.nav-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.nav-info p { font-size: 0.8rem; color: var(--text-secondary); }

.shop-card {
    grid-column: 1 / -1; flex-direction: row; align-items: center;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(129, 140, 248, 0.05) 100%);
}
.shop-card .icon-box { width: 50px; height: 50px; border-radius: 12px; }
.shop-card .arrow-icon {
    margin-left: auto; font-size: 1.2rem; opacity: 0.5; transition: transform 0.3s;
}
.shop-card:hover .arrow-icon { transform: translateX(5px); opacity: 1; color: var(--accent-color); }

/* 悬浮窗 */
.fab-container {
    position: fixed; bottom: 40px; right: 30px; z-index: 100;
    display: flex; flex-direction: column-reverse; align-items: center;
}
.fab-trigger {
    width: 56px; height: 56px; background: var(--fab-bg); border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); border: 1px solid var(--border-color);
    display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 2;
    transition: transform 0.3s;
}
.fab-trigger svg { width: 28px; height: 28px; fill: var(--text-secondary); transition: 0.3s; }
.fab-container.active .fab-trigger { transform: rotate(45deg); border-color: var(--accent-color); }
.fab-container.active .fab-trigger svg { fill: var(--accent-color); }
.fab-options { position: absolute; bottom: 0; right: 0; width: 60px; height: 0; pointer-events: none; }
.fab-btn {
    position: absolute; width: 48px; height: 48px; background: var(--fab-bg); border-radius: 50%;
    display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer; border: 1px solid var(--border-color); right: 4px; bottom: 4px;
    transform: scale(0); opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fab-btn svg { width: 22px; height: 22px; fill: var(--text-color); }
.fab-container.active .fab-options { pointer-events: auto; }
.fab-container.active .fab-btn { transform: translateY(-70px) scale(1); opacity: 1; }
.fab-tooltip {
    position: absolute; right: 60px; background: var(--fab-bg); color: var(--text-color);
    padding: 4px 8px; border-radius: 4px; font-size: 12px; opacity: 0; pointer-events: none;
    border: 1px solid var(--border-color); transition: 0.3s; transform: translateX(10px);
}
.fab-btn:hover .fab-tooltip { opacity: 1; transform: translateX(0); }

footer {
    margin-top: auto; padding: 30px 0; width: 100%; text-align: center; z-index: 2;
}
.copyright { font-size: 14px; color: var(--text-color); font-weight: 500; margin-bottom: 8px; }
.icp-link { font-size: 12px; color: var(--text-secondary); text-decoration: none; opacity: 0.7; transition: 0.3s; }
.icp-link:hover { opacity: 1; color: var(--accent-color); }

/* === 赞赏弹窗样式 (核心优化) === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    z-index: 1000; /* 顶级层级 */
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.3s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }

.modal-content {
    background: var(--card-bg); width: 320px; max-width: 90%;
    border-radius: 20px; padding: 20px; border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; flex-direction: column; gap: 15px;
}
.modal-overlay.show .modal-content { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.modal-header h3 { margin: 0; font-size: 1.2rem; color: var(--text-color); }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; padding: 0 5px; }
.close-btn:hover { color: var(--accent-color); }

.modal-tabs { display: flex; background: rgba(128, 128, 128, 0.1); border-radius: 10px; padding: 4px; }
.tab-btn {
    flex: 1; border: none; background: none; padding: 8px 0; border-radius: 8px;
    color: var(--text-secondary); cursor: pointer; font-size: 0.9rem; transition: all 0.3s;
}
.tab-btn.active { background: var(--card-bg); color: var(--accent-color); box-shadow: 0 2px 5px rgba(0,0,0,0.1); font-weight: 600; }

/* 二维码区域优化：去内边距，占满全屏 */
.qr-container {
    width: 100%; aspect-ratio: 1/1;
    background: white; /* 确保二维码底色 */
    border-radius: 12px; 
    display: flex; justify-content: center; align-items: center;
    overflow: hidden;
    padding: 0; /* 移除 padding */
}
.qr-container img {
    width: 100%; height: 100%; 
    object-fit: fill; /* 强制拉伸占满 */
    display: block;
    transition: opacity 0.2s;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .clock-time { font-size: 2.8rem; }
    .landscape-card { height: 240px; }
    
    /* 修正：移动端保持商店卡片横向布局，与PC一致 */
    /* 移除之前的 .shop-card flex-direction: column 覆写 */
    
    header { margin-top: 8vh; }
    .fab-container { bottom: 30px; right: 20px; }
}