/* ============================================
   静穆斋易占 - 公共样式表
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --bg: #faf8f2;
    --card: #fffef9;
    --text: #2c2416;
    --text-light: #6b5e4a;
    --sub: #6b5e4a;
    --border: #e0d5c1;
    --accent: #8b6914;
    --accent-light: rgba(139, 105, 20, 0.12);
    --warn: #c0392b;
    --warn-bg: #fef6f5;
    --warn-border: #f5d5d3;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 3px 12px rgba(0, 0, 0, 0.08);
    --radius: 10px;
    --font-serif: "Noto Serif SC", "SimSun", "STSong", serif;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- Base ---- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---- Links ---- */
a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
a:hover {
    opacity: 0.75;
}

/* ---- Top Navigation Bar ---- */
.topbar {
    width: 100%;
    padding: 16px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.topbar a {
    text-decoration: none;
    color: var(--accent);
    font-size: 0.95rem;
    white-space: nowrap;
}
.topbar h2 {
    font-size: 1.15rem;
    color: #3a2f1a;
    font-weight: 600;
}

/* ---- Content Container ---- */
.container {
    max-width: 760px;
    width: 100%;
    padding: 32px 24px 60px;
    flex: 1;
}

/* ---- Section Card ---- */
.section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #3a2f1a;
    font-weight: 600;
}
.section p {
    font-size: 0.93rem;
    color: var(--sub);
}
.section p + p {
    margin-top: 8px;
}
.section ul {
    padding-left: 20px;
    margin-top: 6px;
}
.section li {
    font-size: 0.93rem;
    color: var(--sub);
    margin-bottom: 4px;
}

/* ---- Warn Variant ---- */
.section.warn {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-left: 4px solid var(--warn);
}
.section.warn h3 {
    color: var(--warn);
}
.section.warn li {
    color: #7a2e26;
}

/* ---- Page Heading ---- */
.page-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    color: #2c2416;
}

/* ---- Update Date ---- */
.update-date {
    font-size: 0.85rem;
    color: var(--sub);
    margin-bottom: 32px;
}

/* ---- Hero (Homepage) ---- */
.hero {
    width: 100%;
    background: linear-gradient(135deg, #f5ecd7 0%, #e8dbb8 50%, #f5ecd7 100%);
    padding: 80px 20px 60px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.hero h1 {
    font-size: 2.8rem;
    letter-spacing: 0.3em;
    color: #4a3724;
    margin-bottom: 8px;
}
.hero h2 {
    font-size: 1.6rem;
    letter-spacing: 0.25em;
    color: #6b5e4a;
    font-weight: 400;
    margin-bottom: 20px;
}
.hero .tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
}

/* ---- Cards (Homepage links) ---- */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 28px 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
    text-decoration: none;
    color: inherit;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.card h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    color: #3a2f1a;
}
.card p {
    font-size: 0.92rem;
    color: var(--sub);
}
.card .arrow {
    float: right;
    color: #c0b090;
    font-size: 1.1rem;
}

/* ---- Feature List (Homepage) ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.feature-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}
.feature-item h4 {
    font-size: 1rem;
    color: #3a2f1a;
    margin-bottom: 4px;
}
.feature-item p {
    font-size: 0.85rem;
    color: var(--sub);
}

/* ---- Download Section ---- */
.download-card {
    background: linear-gradient(135deg, #f5ecd7, #e8dbb8);
    border: 1px solid var(--accent);
    text-align: center;
    padding: 28px 32px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.download-card h3 {
    color: #3a2f1a;
    margin-bottom: 8px;
    font-size: 1.15rem;
}
.download-card p {
    color: var(--sub);
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.btn-download {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 32px;
    border-radius: 24px;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
}
.btn-download:hover {
    background: #7a5a10;
    transform: translateY(-1px);
    opacity: 1;
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--sub);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 760px;
}
.footer a {
    color: var(--accent);
    text-decoration: none;
}
.footer .footer-sep {
    margin: 0 8px;
    color: var(--border);
}
.footer .icp {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: #999;
}
.footer .icp a {
    color: #999;
}

/* ---- 404 Page ---- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page .error-code {
    font-size: 6rem;
    color: var(--accent);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.3;
}
.error-page h2 {
    font-size: 1.4rem;
    color: #3a2f1a;
    margin-bottom: 12px;
}
.error-page p {
    color: var(--sub);
    margin-bottom: 32px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .hero {
        padding: 50px 16px 36px;
    }
    .hero h1 {
        font-size: 1.8rem;
        letter-spacing: 0.2em;
    }
    .hero h2 {
        font-size: 1.15rem;
        letter-spacing: 0.15em;
    }
    .page-title {
        font-size: 1.4rem;
    }
    .section {
        padding: 18px 20px;
    }
    .card {
        padding: 20px 22px;
    }
    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .topbar {
        padding: 12px 16px;
        gap: 8px;
    }
    .topbar h2 {
        font-size: 1rem;
    }
    .container {
        padding: 20px 16px 40px;
    }
}

@media (max-width: 380px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Utility ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
