
/* ===== HuaQuan Library Site — Independent CSS ===== */

:root {
    --primary: #d42020;
    --primary-dark: #a01818;
    --primary-light: #f0d0d0;
    --dark: #1a1a2e;
    --darker: #0f0f1a;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --bg: #12121f;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --border: #2a2a40;
    --border-light: #3a3a50;
    --success: #28a745;
    --warning: #f0ad4e;
    --danger: #dc3545;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.3s ease;
    --max-width: 1200px;

    --font-heading: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
}

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

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #ff4444; text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}
h1 { font-size: 2.2em; border-bottom: 2px solid var(--primary); padding-bottom: 0.3em; }
h2 { font-size: 1.7em; border-left: 4px solid var(--primary); padding-left: 12px; }
h3 { font-size: 1.35em; }
h4 { font-size: 1.15em; }

p { margin-bottom: 1em; }

/* === HEADER === */
.site-header {
    background: var(--darker);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}
.logo {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--white);
}
.logo span { color: var(--primary); }
.logo small { display: block; font-size: 0.5em; color: var(--text-muted); font-weight: 400; }

/* === NAV === */
.site-nav { background: var(--bg-card); border-bottom: 1px solid var(--border); }
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 20px;
}
.nav-inner a {
    display: block;
    padding: 12px 18px;
    color: var(--text);
    font-size: 0.95em;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.nav-inner a:hover,
.nav-inner a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* === NETWORK BAR === */
.network-bar {
    background: var(--darker);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    overflow-x: auto;
}
.network-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.82em;
}
.network-bar-inner a { color: var(--text-muted); white-space: nowrap; }
.network-bar-inner a:hover { color: var(--primary); text-decoration: none; }

/* === CONTAINER === */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs span { margin: 0 8px; }

/* === CARDS === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}
.card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.card-icon { font-size: 2em; margin-bottom: 12px; }
.card h3 { margin-top: 0; font-size: 1.2em; }
.card p { color: var(--text-muted); font-size: 0.92em; }
.card .btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9em;
    transition: var(--transition);
}
.card .btn:hover { background: var(--primary-dark); text-decoration: none; }

/* === DOWNLOAD CARDS (Library specific) === */
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}
.download-card:hover { border-color: var(--primary); background: var(--bg-card-hover); }
.download-card .file-icon { font-size: 2.5em; color: var(--primary); flex-shrink: 0; }
.download-card .file-info { flex: 1; }
.download-card .file-info h4 { margin: 0 0 4px 0; font-size: 1.05em; }
.download-card .file-info .file-meta { font-size: 0.82em; color: var(--text-muted); }
.download-card .dl-btn {
    padding: 10px 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    transition: var(--transition);
}
.download-card .dl-btn:hover { background: var(--primary-dark); text-decoration: none; }

/* === TABLE === */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.92em;
}
table thead { background: var(--primary-dark); color: var(--white); }
table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
}
table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
table tbody tr:hover { background: var(--bg-card-hover); }
table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* === FAQ === */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-item .faq-q {
    padding: 14px 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
    transition: var(--transition);
}
.faq-item .faq-q:hover { color: var(--primary); }
.faq-item .faq-a { padding: 0 18px 14px; color: var(--text-muted); font-size: 0.93em; }

/* === KEY TAKEAWAYS BOX === */
.key-takeaways {
    background: linear-gradient(135deg, rgba(212,32,32,0.15), rgba(212,32,32,0.05));
    border: 1px solid rgba(212,32,32,0.3);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin: 20px 0;
}
.key-takeaways h3 { color: var(--primary); margin-top: 0; font-size: 1.1em; }
.key-takeaways ul { padding-left: 18px; }
.key-takeaways li { margin-bottom: 6px; font-size: 0.93em; }

/* === IMAGE PLACEHOLDER === */
.img-placeholder {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.9em;
    min-height: 160px;
}
.img-placeholder .placeholder-icon { font-size: 2.5em; margin-bottom: 8px; }

/* === TOC === */
.toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin: 24px 0;
}
.toc h3 { margin-top: 0; color: var(--primary); }
.toc ol { padding-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 0.93em; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--primary); }

/* === ALERT / CALL-OUT BOXES === */
.alert-box {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.92em;
}
.alert-box.info { background: rgba(23, 162, 184, 0.15); border: 1px solid rgba(23, 162, 184, 0.3); }
.alert-box.warning { background: rgba(240, 173, 78, 0.15); border: 1px solid rgba(240, 173, 78, 0.3); }
.alert-box.success { background: rgba(40, 167, 69, 0.15); border: 1px solid rgba(40, 167, 69, 0.3); }

/* === CTA BUTTON === */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--darker));
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin: 32px 0;
    text-align: center;
}
.cta-section h3 { margin-top: 0; }
.cta-btn {
    display: inline-block;
    padding: 12px 36px;
    background: var(--white);
    color: var(--primary-dark);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1em;
    margin-top: 12px;
    transition: var(--transition);
}
.cta-btn:hover { background: var(--primary-light); text-decoration: none; }

/* === ACCENT BOXES (spec sheet, highlight) === */
.accent-box {
    border-left: 4px solid var(--primary);
    background: var(--bg-card);
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* === FOOTER === */
.site-footer {
    background: var(--darker);
    border-top: 3px solid var(--primary);
    padding: 40px 20px 20px;
    margin-top: 60px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.footer-col h4 {
    color: var(--primary);
    font-size: 1em;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-col a,
.footer-col p {
    display: block;
    font-size: 0.88em;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.6;
}
.footer-col a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
    max-width: var(--max-width);
    margin: 20px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82em;
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.3em; }
    .card-grid { grid-template-columns: 1fr; }
    .download-card { flex-direction: column; align-items: flex-start; }
    .nav-inner { flex-direction: column; }
    .header-inner { flex-direction: column; }
}
