/* NoteForum - Retro Style CSS */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "SimSun", "Songti SC", serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background-color: #fff;
    min-height: 100vh;
}

/* Header */
.header {
    border-bottom: 2px solid #666;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 24px;
    font-weight: bold;
}

.header h1 a {
    color: #333;
    text-decoration: none;
}

.tagline {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Navigation */
.nav {
    background-color: #eee;
    border: 1px solid #ccc;
    padding: 8px 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav a {
    color: #0066cc;
    text-decoration: none;
}

.nav a:hover {
    text-decoration: underline;
}

.user-info {
    font-size: 12px;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 15px;
}

.flash {
    padding: 10px;
    border: 1px solid;
    margin-bottom: 5px;
}

.flash-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.flash-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.flash-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Main Content */
.main {
    margin-bottom: 20px;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Tables - Forum Style */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.table th,
.table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.table th {
    background-color: #eee;
    font-weight: bold;
}

.table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table tr:hover {
    background-color: #f0f0f0;
}

/* Block/Forum List */
.block {
    margin-bottom: 20px;
    border: 1px solid #ccc;
}

.block-header {
    background-color: #e0e0e0;
    padding: 8px 12px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}

.forum-list {
    width: 100%;
}

.forum-list td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.forum-name {
    font-weight: bold;
    font-size: 14px;
}

.forum-description {
    color: #666;
    font-size: 12px;
}

.forum-stats {
    text-align: center;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* Thread List */
.thread-list {
    width: 100%;
}

.thread-list th,
.thread-list td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.thread-list th {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: left;
}

.thread-pinned {
    background-color: #fffde7;
}

.thread-title {
    font-size: 14px;
}

.thread-meta {
    font-size: 11px;
    color: #666;
}

.pinned-badge {
    color: #c00;
    font-weight: bold;
    font-size: 11px;
}

/* Posts */
.post {
    border: 1px solid #ccc;
    margin-bottom: 15px;
}

.post-header {
    background-color: #f0f0f0;
    padding: 8px 12px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-author {
    font-weight: bold;
}

.post-meta {
    font-size: 12px;
    color: #666;
}

.post-content {
    padding: 15px;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 10px;
}

.post-content pre {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: "Courier New", Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
}

.post-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    font-family: "Courier New", Consolas, monospace;
    font-size: 12px;
}

.post-content blockquote {
    border-left: 3px solid #ccc;
    padding-left: 10px;
    margin: 10px 0;
    color: #666;
    background-color: #f9f9f9;
    padding: 10px 10px 10px 15px;
}

/* Tables in post content */
.post-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    border: 1px solid #333;
}

.post-content th,
.post-content td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}

.post-content th {
    background-color: #e8e8e8;
    font-weight: bold;
}

.post-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Lists in post content */
.post-content ul,
.post-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.post-content li {
    margin-bottom: 5px;
    line-height: 1.6;
}

.post-actions {
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.post-actions a {
    margin-right: 10px;
}

/* Thread Tree View - Updated */
.thread-tree {
    margin: 15px 0;
}

.tree-root {
    margin-left: 0;
}

.tree-children {
    margin-left: 20px;
    border-left: 1px dotted #ccc;
    padding-left: 10px;
}

.tree-item {
    margin: 5px 0;
    padding: 3px 0;
}

.tree-item.current {
    background-color: #fff9e6;
}

.tree-icon {
    margin-right: 5px;
}

.tree-branch {
    color: #999;
    margin-right: 5px;
}

.tree-title {
    font-size: 14px;
}

.tree-meta {
    font-size: 11px;
    color: #666;
}

/* Current Post Display */
.current-post {
    margin-bottom: 20px;
}

.current-post h2 {
    margin-bottom: 5px;
}

.post-meta-header {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 14px;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

select.form-control {
    width: auto;
    min-width: 200px;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    color: #333;
}

.btn:hover {
    background-color: #ddd;
    text-decoration: none;
}

.btn-primary {
    background-color: #0066cc;
    color: #fff !important;
    border-color: #0055aa;
}

.btn-primary:hover {
    background-color: #0055aa;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border-color: #c82333;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Pagination */
.pagination {
    margin: 15px 0;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ccc;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #eee;
}

.pagination .current {
    background-color: #0066cc;
    color: #fff;
    border-color: #0055aa;
}

/* Admin Panel */
.admin-section {
    margin-bottom: 30px;
}

.admin-section h2 {
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.admin-table {
    width: 100%;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background-color: #f0f0f0;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
}

.tag-thread {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Code Highlighting - Pygments Default Style */
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #808080 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */

/* ReST Admonitions */
.admonition {
    border: 1px solid #ccc;
    border-left: 4px solid #999;
    padding: 12px;
    margin: 15px 0;
    background-color: #f9f9f9;
}

.admonition-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.admonition.note {
    border-left-color: #2196F3;
    background-color: #e3f2fd;
}

.admonition.warning {
    border-left-color: #ff9800;
    background-color: #fff3e0;
}

.admonition.danger, .admonition.error {
    border-left-color: #f44336;
    background-color: #ffebee;
}

.admonition.hint, .admonition.tip {
    border-left-color: #4CAF50;
    background-color: #e8f5e9;
}

.admonition.important, .admonition.caution, .admonition.attention {
    border-left-color: #ff5722;
    background-color: #fbe9e7;
}

/* Print Version */
@media print {
    .nav,
    .post-actions,
    .btn,
    .pagination {
        display: none !important;
    }
    
    body {
        background-color: #fff;
    }
    
    .container {
        max-width: 100%;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .table,
    .thread-list,
    .forum-list {
        font-size: 12px;
    }
    
    .table th,
    .table td,
    .thread-list th,
    .thread-list td {
        padding: 5px;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .post-content {
        padding: 10px;
    }
    
    .tree-children {
        margin-left: 10px;
        padding-left: 5px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }
.small { font-size: 12px; }
.bold { font-weight: bold; }
