:root {
    --bg-color: #050505;
    --cell-bg: #2d2d2d;
    --cell-hover: #3d3d3d;
    --neon-blue: #00f3ff;
    --neon-red: #ff0055;
    --neon-green: #00ff9d;
    --neon-purple: #bc13fe;
    --neon-yellow: #ffdd00;
    --text-color: #fff;
    --text-secondary: #aaa;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 改為 flex-start 並增加 padding，確保內容多時可以正常捲動 */
    justify-content: flex-start; 
    min-height: 100vh;
    margin: 0;
    padding: 40px 20px;
    overflow-x: hidden;
    line-height: 1.6;

    /* 動態網格背景 */
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: bg-scroll 20s linear infinite;
}

@keyframes bg-scroll {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* 標題區塊優化 */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: clamp(2rem, 8vw, 3.5rem); /* 響應式字體大小 */
    margin: 0;
    color: #fff;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px var(--neon-blue),
        0 0 40px var(--neon-blue);
    animation: neon-pulse 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from { text-shadow: 0 0 5px #fff, 0 0 20px var(--neon-blue); }
    to { text-shadow: 0 0 10px #fff, 0 0 40px var(--neon-blue), 0 0 80px var(--neon-blue); }
}

#vfx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* 遊戲控制項排版 */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

.difficulty-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.diff-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    cursor: pointer;
    border-radius: 20px;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: bold;
}

.diff-btn:hover { border-color: #fff; color: #fff; }
.diff-btn.active {
    border-color: var(--neon-purple);
    color: #fff;
    background: rgba(188, 19, 254, 0.2);
    box-shadow: 0 0 15px var(--neon-purple);
}

.game-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 25px;
    border-radius: 10px;
    border: 1px solid #333;
}

#timer {
    font-family: 'Courier New', monospace;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    font-size: 1.4rem;
    min-width: 70px;
    text-align: center;
}

/* 遊戲網格優化 */
#grid {
    display: grid;
    gap: 2px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
    border: 1px solid #333;
    margin: 0 auto;
}

.cell {
    width: 32px;
    height: 32px;
    background-color: var(--cell-bg);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.15s ease;
}

.cell:hover { background-color: var(--cell-hover); transform: scale(1.1); z-index: 2; }
.cell.revealed { background-color: #1a1a1a; cursor: default; transform: none; box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5); }

/* 數字顏色 */
.cell[data-num="1"] { color: #00d4ff; }
.cell[data-num="2"] { color: #00ff9d; }
.cell[data-num="3"] { color: #ff0055; }
.cell[data-num="4"] { color: #bc13fe; }

/* SEO 內容區塊樣式 (新增) */
.seo-article {
    margin-top: 60px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(0, 243, 255, 0.15);
    max-width: 800px;
    width: 90%;
    text-align: left;
}

.seo-article h2 {
    color: var(--neon-blue);
    font-size: 1.8rem;
    border-left: 4px solid var(--neon-blue);
    padding-left: 15px;
    margin-bottom: 20px;
}

.seo-article h3 {
    color: var(--neon-green);
    margin-top: 25px;
}

.seo-article p, .seo-article li {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
}

.seo-article strong {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

/* 排行榜優化 */
#leaderboard-section {
    margin-top: 40px;
    width: 90%;
    max-width: 450px;
    border: 1px solid #333;
    padding: 25px;
    border-radius: 15px;
    background: rgba(10, 10, 10, 0.9);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th { color: #666; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; padding-bottom: 10px; border-bottom: 2px solid #222; }
td { padding: 12px 5px; border-bottom: 1px solid #222; }
td:nth-child(2) { color: var(--neon-blue); text-align: right; font-family: 'Courier New', monospace; }

/* 頁尾 */
footer {
    margin-top: 60px;
    padding-bottom: 40px;
    color: #444;
    font-size: 0.8rem;
}

/* 手機版適應 */
@media (max-width: 600px) {
    body { padding: 20px 10px; }
    .cell { width: 28px; height: 28px; font-size: 14px; }
    .game-info { gap: 10px; padding: 10px 15px; font-size: 0.9rem; }
    .seo-article { padding: 20px; }
}

/* 其餘動畫與特效保持不變 */
.restart-btn {
    margin-top: 25px;
    padding: 12px 40px;
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}
.restart-btn:hover { background: var(--neon-green); color: #000; box-shadow: 0 0 20px var(--neon-green); }

/* 新增：商務與訪客區塊排版 */
.business-section {
    width: 90%;
    max-width: 800px;
    margin: 40px 0;
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* 左右分欄 */
    gap: 20px;
}

.stat-card {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--neon-blue);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.stat-icon { font-size: 2rem; }
.stat-label { display: block; font-size: 0.8rem; color: #888; }
.stat-value { font-size: 1.8rem; color: var(--neon-blue); font-family: monospace; text-shadow: 0 0 10px var(--neon-blue); }

.contact-card {
    background: rgba(188, 19, 254, 0.05);
    border: 1px solid var(--neon-purple);
    padding: 20px;
    border-radius: 15px;
    text-align: left;
}

.contact-card h3 { color: var(--neon-purple); margin: 0 0 10px 0; font-size: 1.2rem; }
.contact-card p { font-size: 0.8rem; color: #aaa; margin-bottom: 15px; }

.contact-form { display: flex; flex-direction: column; gap: 8px; }
.contact-form input, .contact-form textarea {
    background: #111;
    border: 1px solid #333;
    padding: 8px;
    color: #fff;
    border-radius: 5px;
    font-size: 0.85rem;
}
.contact-form textarea { height: 60px; resize: none; }

.submit-btn {
    background: var(--neon-purple);
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.submit-btn:hover { background: #fff; color: var(--neon-purple); box-shadow: 0 0 15px var(--neon-purple); }

/* 手機版自動改為單欄排版 */
@media (max-width: 768px) {
    .business-section { grid-template-columns: 1fr; }
}

.email-link {
    color: var(--neon-blue);
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    border-bottom: 1px dashed var(--neon-blue);
}

.email-link:hover {
    text-shadow: 0 0 10px var(--neon-blue);
    border-bottom: 1px solid var(--neon-blue);
}

.footer-links {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.3s;
}

.footer-link:hover {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
}

.separator {
    color: #333;
    font-size: 0.8rem;
}

