:root {
    --primary-color: #d32f2f;
    --primary-hover: #b71c1c;
    --bg-color: #eef2f6;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #4a5568;
    --solution-color: #1565c0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 2rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-wrapper {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    display: inline-block;
    border-bottom: 4px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    text-decoration: none;
    color: white;
    background-color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: var(--primary-hover);
}

.topology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.subject-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.subject-card h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subject-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detail-content {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    margin-bottom: 2rem;
}

.detail-content h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0.5rem;
}

.qa-block {
    margin-bottom: 2rem;
}

.qa-block h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.solution {
    color: var(--solution-color);
    background-color: #f0f7ff; 
    padding: 0.8rem 1rem;
    border-left: 4px solid var(--solution-color);
    border-radius: 0 4px 4px 0;
    margin-bottom: 0.5rem;
}

.solution-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.solution-table th, 
.solution-table td {
    border: 1px solid #cbd5e0;
    padding: 0.75rem;
    text-align: left;
}

.solution-table th {
    background-color: #edf2f7;
    color: var(--text-main);
    font-weight: bold;
}

.site-footer {
    background-color: #ffffff; 
    border-top: 2px solid #cbd5e0; 
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem; 
    width: 100%;
}

.site-footer p {
    color: #718096; 
    font-size: 0.95rem;
    margin: 0;
}

.red-link {
    color: var(--primary-color);
    text-decoration: none;
}

.red-link:hover {
    text-decoration: underline;
}