/* General Resets & Body Styles */
body {
    font-family: sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

a {
    color: #0645ad; /* Standard link blue */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #0b0080; /* Standard visited purple */
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    padding-bottom: 0.17em;
    border-bottom: 1px solid #aaa;
    line-height: 1.3;
}

h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }
h5 { font-size: 1em; font-weight: bold; border-bottom: none;} /* Toolbox heading */

p {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

ul, ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.5em;
}

img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    padding: 3px;
    margin-bottom: 1em;
}

/* --- Layout Structure --- */

#page-container {
    max-width: 1200px; /* Adjust as needed */
    margin: 0 auto;
    padding: 0 1em;
    position: relative; /* For potential absolute positioning of sidebar */
    overflow: hidden; /* Contains floats */
}

/* Header */
#site-header {
    background-color: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
    margin-bottom: 1em;
    text-align: center; /* Center logo if no sidebar */
}

#site-header .logo {
    display: inline-block;
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}
#site-header .logo:hover {
    text-decoration: none;
}


/* --- Sidebar Panel --- */
#panel {
    width: 180px; /* Typical sidebar width */
    float: left;
    margin-right: 20px;
    padding-top: 10px;
    font-size: 0.9em;
}

#p-logo {
    margin-bottom: 1em;
}

/* Logo in sidebar - assuming it uses the background image */
#p-logo a {
    display: block;
    width: 135px; /* Example width */
    height: 135px; /* Example height */
    background-image: url(/lib/tpl/vector/static/3rd/dokuwiki/logo.png); /* Placeholder from HTML */
    background-repeat: no-repeat;
    background-size: contain; /* Or cover/auto */
    text-indent: -9999px; /* Hide text */
    overflow: hidden;
    border: 1px solid #ccc;
}

#p-tb { /* Toolbox */
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 1em;
}

#p-tb h5 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1em;
    border-bottom: none;
}

#p-tb ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#p-tb li {
    margin-bottom: 0.3em;
}

/* --- Main Content Area --- */
#content {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 1em 1.5em;
    margin-left: 200px; /* Space for the floated sidebar (width + margin-right) */
    overflow: hidden; /* Clear floats within content */
    min-height: 400px; /* Ensure footer doesn't jump up */
}

/* Breadcrumbs */
.catlinks {
    font-size: 0.9em;
    color: #555;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}
.catlinks .bchead {
    font-weight: bold;
}
.catlinks a {
    margin: 0 0.2em;
}


/* Main content body */
#bodyContent {
    /* Styles applied directly to #content or inherited */
}

/* Table of Contents */
#dw__toc {
    border: 1px solid #aaa;
    background-color: #f9f9f9;
    padding: 10px;
    margin-bottom: 1.5em;
    float: right; /* Common TOC placement */
    margin-left: 1em;
    max-width: 300px; /* Prevent it from getting too wide */
    font-size: 0.9em;
}

#dw__toc h3.toggle {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.1em;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    cursor: pointer; /* If it's meant to be toggled */
}

#dw__toc ul.toc {
    list-style: none;
    margin: 0;
    padding: 0;
}

#dw__toc ul.toc ul { /* Indent nested levels */
    margin-left: 1.5em;
}

#dw__toc li {
    margin-bottom: 0.3em;
}

/* Content Levels (Structure within bodyContent) */
.level1, .level2, .level3, .level4, .level5 {
    /* These might just be structural wrappers, often no specific style needed */
    margin-bottom: 1em;
}

/* Specific List Styles from ciyu.html */
li.items, li.popular-item {
    display: inline-block; /* Arrange items horizontally */
    margin-right: 15px;
    margin-bottom: 8px;
    list-style: none;
    padding: 3px 8px;
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9em;
}
li.items a, li.popular-item a {
    text-decoration: none;
}
li.items a:hover, li.popular-item a:hover {
    text-decoration: underline;
}

/* Horizontal Rule style from ciyu.html */
.hr {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 2em 0;
}

/* Clearfix Utility */
.clearer {
    clear: both;
    height: 0;
    line-height: 0;
    font-size: 0;
    overflow: hidden;
}


/* --- Footer --- */
#footer {
    clear: both; /* Ensure it's below floated elements */
    margin-top: 2em;
    padding: 1em 0;
    border-top: 1px solid #ccc;
    font-size: 0.85em;
    color: #555;
    text-align: center;
}

#footer ul#footer-info {
    list-style: none;
    margin: 0;
    padding: 0;
}

#footer li#footer-info-copyright {
    /* Center alignment is handled by #footer text-align */
}
#footer .license bdi {
    font-weight: bold;
}

/* --- Print Styles --- */
@media print {
    body {
        background-color: #fff;
        color: #000;
        font-size: 10pt; /* Adjust for print */
    }
    #site-header, #panel, #head, #head-base, #page-base, #footer, .catlinks, #dw__toc, #left-navigation, #p-namespaces {
        display: none !important; /* Hide non-content elements */
    }
    .noprint {
        display: none !important;
    }
    #page-container {
        max-width: 100%;
        padding: 0;
        margin: 0;
        border: none;
    }
    #content {
        margin-left: 0 !important; /* Remove sidebar margin */
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    a {
        color: #000 !important; /* Black links for print */
        text-decoration: underline !important; /* Ensure links are identifiable */
    }
    /* Optionally show URL for links in print */
    a[href^="http"]:after {
       /* content: " (" attr(href) ")"; */ /* Uncomment if needed */
       /* font-size: 90%; */
    }
    h1, h2, h3 {
        page-break-after: avoid;
        border-bottom: 1px solid #999;
    }
}


/* --- Basic Responsive Adjustments --- */
@media (max-width: 768px) {
    #panel {
        float: none;
        width: 100%;
        margin-right: 0;
        margin-bottom: 1em;
        text-align: center; /* Center sidebar content */
    }
    #p-logo a {
        margin: 0 auto; /* Center logo block */
    }
    #p-tb {
        text-align: left; /* Reset text-align for toolbox */
    }
    #content {
        margin-left: 0; /* Full width */
    }
    #dw__toc {
        float: none; /* Stack TOC */
        margin-left: 0;
        max-width: 100%;
        margin-bottom: 1em;
    }
    /* Adjust list item display for smaller screens if needed */
    li.items, li.popular-item {
       /* display: block; */ /* Uncomment to stack list items */
       /* margin-right: 0; */
    }
}