/* --- Reset & Variables --- */
:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --text-main: #1f2937;
    --text-light: #6b7280;
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --max-width: 1000px; /* 限制最大宽度，无侧栏更聚焦 */
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.site-content {
    flex: 1;
    padding: 40px 0;
}

/* --- Header --- */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Menu --- */
.main-nav { display: block; }
.nav-list { display: flex; gap: 20px; }
.nav-list a {
    font-weight: 600;
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 6px;
}
.nav-list a:hover, .nav-list a.active {
    color: var(--primary-color);
    background: #eef2ff;
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.menu-toggle span {
    display: block; width: 25px; height: 3px; background: var(--text-main);
    margin: 5px 0; transition: 0.3s;
}

/* --- Ad Slots --- */
.ad-slot {
    width: 100%;
    margin: 20px 0;
    text-align: center;
    min-height: 90px; /* Prevent layout shift */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* --- Cards (Home/Category/Search) --- */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e5e7eb;
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-cat {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}
.card-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex: 1;
}
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}
.btn:hover { background: var(--primary-hover); }

/* --- Quiz Intro Page --- */
.intro-header { text-align: center; max-width: 700px; margin: 0 auto 40px; }
.intro-title { font-size: 2.5rem; margin-bottom: 15px;text-align:center; color: var(--text-main); }
.intro-desc { font-size: 1.1rem; color: var(--text-light); margin-bottom: 30px; }
.intro-content { 
    background: var(--bg-card); 
    padding: 30px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}
.intro-content h2, .intro-content h3 { margin-bottom: 15px; color: var(--text-main); }
.intro-content p { margin-bottom: 15px; color: var(--text-light); }

/* --- Quiz Play Page --- */
.quiz-progress {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 600;
}
.question-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}
.question-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}
.options-list { display: flex; flex-direction: column; gap: 15px; }
.option-item {
    position: relative;
}
.option-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.option-label {
    display: block;
    padding: 15px 20px;
    background: #f9fafb;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.option-radio:checked + .option-label {
    border-color: var(--primary-color);
    background: #eef2ff;
    color: var(--primary-color);
}
.option-label:hover { border-color: #d1d5db; }

/* --- Result Page --- */
.result-card {
    text-align: center;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}
.result-img {
    max-width: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
}
.result-title { font-size: 2rem; color: var(--primary-color); margin-bottom: 15px; }
.result-desc { font-size: 1.1rem; color: var(--text-light); margin-bottom: 30px; }

/* --- Footer --- */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: auto;
}
.footer-inner { text-align: center; }
.footer-links { margin-bottom: 20px; }
.footer-links a { margin: 0 10px; color: var(--text-light); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary-color); }
.copyright { color: #9ca3af; font-size: 0.85rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        box-shadow: 0 10px 10px -5px rgba(0,0,0,0.1);
    }
    .main-nav.active { display: block; }
    .nav-list { flex-direction: column; gap: 10px; }
    .intro-title { font-size: 2rem; }
    .question-card { padding: 20px; }
    .question-text { font-size: 1.25rem; }
}