/* Override JS-calculated min-height */
#dokuwiki__content div.page {
    min-height: 1369.94px !important;
}

/* Router-Recovery Wiki - Match Main Site Style */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-alt);
    max-width: 100%;
    overflow-x: hidden;
}

/* Header - Match main site */
header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 72px;
}
.header-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}
.logo-icon { font-size: 1.5rem; }
.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-link {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    padding: 8px 0;
}
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); }
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Banner - Match main site hero style */
.db-banner {
    margin-top: 72px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 40px 0;
}
.db-banner-inner {
    max-width: 860px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}
.db-section {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.db-section h3 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Tutorial Grid */
.tutorial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.tutorial-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}
.tutorial-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.tutorial-info { flex: 1; }
.tutorial-info strong {
    color: var(--text);
    font-size: 1rem;
    display: block;
    margin-bottom: 4px;
}
.tutorial-info span {
    color: var(--text-light);
    font-size: 0.875rem;
}
.tutorial-btn {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}
.tutorial-card.placeholder .tutorial-btn {
    background: var(--text-muted);
}

/* Main Layout */
.dokuwiki__site {
    max-width: 860px;
    margin: 30px auto;
    padding: 0 24px;
    display: flex;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
#dokuwiki__aside {
    flex: 0 0 200px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    position: sticky;
    top: 96px;
}
#dokuwiki__aside h3.toggle {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
#dokuwiki__aside ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#dokuwiki__aside li { margin: 6px 0; }
#dokuwiki__aside a {
    color: var(--text-light);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    display: block;
    font-size: 0.875rem;
    transition: all 0.2s;
}
#dokuwiki__aside a:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

/* Content */
#dokuwiki__content {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 30px;
    min-width: 0;
}
.page { padding: 0; }
.page-top-nav {
    margin-bottom: 20px;
}
.home-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    background: var(--bg-alt);
    border-radius: 6px;
    display: inline-block;
}
.home-link:hover {
    background: var(--primary);
    color: white;
}
#dokuwiki__content h1 {
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
#dokuwiki__content h2 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
    margin: 24px 0 16px;
}
#dokuwiki__content p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Footer */
footer#dokuwiki__footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-dark, #0f172a);
}
footer#dokuwiki__footer a {
    color: var(--primary);
}

/* Mobile: stack vertical */
@media (max-width: 860px) {
    .dokuwiki__site {
        flex-direction: column;
        padding: 20px 16px;
    }
    #dokuwiki__aside {
        display: none;
    }
    #dokuwiki__content {
        padding: 20px;
    }
}
@media (max-width: 500px) {
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
    .header-nav {
        display: none;
    }
    .db-banner-inner,
    .dokuwiki__site {
        padding: 0 16px;
    }
}

/* 全局链接样式 - 去除下划线 */
a { text-decoration: none !important; }
a:hover { text-decoration: none !important; color: inherit; }
