/*
 * YTHT Reborn Classic Theme — 仿老站"蓝色理想"风格
 * 浅色背景 + 蓝色调 + 左侧栏布局
 * 色板直接取自老站 bbssg.css / bbsboa.css / bbscon.css
 */

/* ═══ CSS Variables ═══ */
:root {
  --ytht-bg-base: #f8f5ff;
  --ytht-bg-surface: #ffffff;
  --ytht-bg-elevated: #f4f4f8;
  --ytht-bg-nav: #abc8f2;
  --ytht-bg-sidebar: #e8ecf8;
  --ytht-bg-deep: #ebebf0;
  --ytht-text-primary: #000000;
  --ytht-text-secondary: #666;
  --ytht-text-muted: #999;
  --ytht-accent-blue: #3366cc;
  --ytht-accent-light: #abc8f2;
  --ytht-accent-link: #0000f0;
  --ytht-accent-link-hover: #ff0000;
  --ytht-accent-gold: #c9a052;
  --ytht-border: #abc8f2;
  --ytht-border-subtle: #ddd;
  --ytht-border-accent: #3366cc;
}

/* ═══ GLOBAL ═══ */
body {
  background: var(--ytht-bg-base) !important;
  color: var(--ytht-text-primary) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif !important;
}

/* ═══ LEFT SIDEBAR ═══ */
#ytht-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 155px;
  background: var(--ytht-bg-sidebar);
  border-right: 1px solid var(--ytht-border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  font-size: 12px;
  padding: 0;
  scrollbar-width: thin;
}
#ytht-sidebar::-webkit-scrollbar { width: 4px; }
#ytht-sidebar::-webkit-scrollbar-thumb { background: var(--ytht-border); }

/* Sidebar sections */
.ytht-sb-header {
  background: var(--ytht-accent-blue);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid #2255aa;
}
.ytht-sb-header a { color: #fff !important; text-decoration: none !important; }

.ytht-sb-user {
  padding: 6px 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--ytht-border);
  background: #f0f0fa;
}
.ytht-sb-user a { color: var(--ytht-accent-link) !important; }

/* Collapsible folders */
.ytht-sb-folder {
  border-bottom: 1px solid var(--ytht-border-subtle);
}
.ytht-sb-folder summary {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  color: var(--ytht-accent-blue);
  cursor: pointer;
  background: #f0f2fa;
  border-bottom: 1px solid var(--ytht-border-subtle);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ytht-sb-folder summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.15s;
}
.ytht-sb-folder[open] summary::before {
  content: "▾";
}
.ytht-sb-folder summary:hover { background: #e4e8f4; }

.ytht-sb-links {
  padding: 2px 0 4px 0;
}
.ytht-sb-links a {
  display: block;
  padding: 1px 8px 1px 16px;
  color: var(--ytht-text-primary) !important;
  text-decoration: none !important;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ytht-sb-links a:hover {
  color: var(--ytht-accent-link-hover) !important;
  background: #dde4f4 !important;
  text-decoration: underline !important;
}

/* Zone icon in sidebar */
.ytht-sb-zone-icon { margin-right: 2px; }

/* Sidebar search */
.ytht-sb-search {
  padding: 6px 8px;
  border-top: 1px solid var(--ytht-border-subtle);
}
.ytht-sb-search input {
  width: 100%;
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--ytht-border);
  background: #fff;
  color: #000;
}
.ytht-sb-search input:focus {
  border-color: var(--ytht-accent-blue);
  outline: none;
}

/* Sidebar footer */
.ytht-sb-foot {
  padding: 4px 8px;
  font-size: 10px;
  color: var(--ytht-text-muted);
  border-top: 1px solid var(--ytht-border-subtle);
  text-align: center;
}

/* ═══ PUSH MAIN CONTENT RIGHT ═══ */
#misago-container {
  margin-left: 155px !important;
}

/* ═══ NAVBAR (浅蓝) ═══ */
.page-header { background: transparent !important; border: none !important; min-height: 0 !important; padding: 2px 0 !important; }
.page-header-banner, .page-header-bg-image, .page-header-bg-overlay, .page-header-image, .page-header-details { display: none !important; }
.page-header-container { padding: 0 !important; margin-bottom: 2px !important; }

.navbar, .navbar-default, #misago-navbar {
  background: var(--ytht-bg-nav) !important;
  border-bottom: 2px solid var(--ytht-accent-blue) !important;
  border-color: var(--ytht-accent-blue) !important;
}
.navbar-default .navbar-nav > li > a,
.navbar a,
.site-nav a { color: #000 !important; }
.navbar a:hover, .site-nav a:hover { color: var(--ytht-accent-blue) !important; background: rgba(255,255,255,0.3) !important; }
.navbar-default .navbar-brand, .navbar-branding { color: var(--ytht-accent-blue) !important; font-weight: bold !important; }

/* HTC navbar display */
.navbar-htc-display { color: #000 !important; }
.navbar-htc-display span { color: #333 !important; }
.navbar-htc-display a { color: var(--ytht-accent-blue) !important; }

/* ═══ CARDS & PANELS (白底) ═══ */
.panel, .panel-default, .card {
  background: var(--ytht-bg-surface) !important;
  border: 1px solid var(--ytht-border-subtle) !important;
}
.panel-default > .panel-heading, .card-header {
  background: var(--ytht-bg-elevated) !important;
  border-color: var(--ytht-border-subtle) !important;
  color: var(--ytht-accent-blue) !important;
}
.list-group-item {
  background: var(--ytht-bg-surface) !important;
  border-color: var(--ytht-border-subtle) !important;
  color: var(--ytht-text-primary) !important;
}
.list-group-item:hover { background: #f0f4ff !important; }

/* ═══ LINKS (蓝色，hover 红色) ═══ */
a { color: var(--ytht-accent-link) !important; text-decoration: none !important; }
a:hover { color: var(--ytht-accent-link-hover) !important; text-decoration: underline !important; }

/* ═══ CATEGORIES LIST ═══ */
.ytht-cat-thead {
  background: var(--ytht-bg-nav) !important;
  color: #000 !important;
  border: 1px solid var(--ytht-border) !important;
  font-weight: bold;
}

/* Zone headers */
.ytht-zone-header .list-group-category-item {
  background: #eef2ff !important;
  border-color: var(--ytht-border) !important;
}
.ytht-zone-header .list-group-category-item-name {
  color: var(--ytht-accent-blue) !important;
  font-weight: bold !important;
}

/* Board rows */
.list-group-category-item {
  border-bottom: 1px solid var(--ytht-border-subtle) !important;
  border-left: 1px solid var(--ytht-border-subtle) !important;
  border-right: 1px solid var(--ytht-border-subtle) !important;
}
.list-group-category-item:hover { background: #f0f4ff !important; }

/* ═══ THREADS LIST ═══ */
.threads-list-item {
  background: var(--ytht-bg-surface) !important;
  border-color: var(--ytht-border-subtle) !important;
}
.threads-list-item:nth-child(odd) { background: var(--ytht-bg-elevated) !important; }
.threads-list-item:hover { background: #e8f0ff !important; }
[class*="threads-list-item-"] { color: var(--ytht-text-primary) !important; }

/* Thread flags */
.thread-flag-pinned-globally, .thread-flag-pinned-locally { color: #c00 !important; }
.thread-flag-closed { color: #999 !important; }

/* ═══ POST DISPLAY ═══ */
.post { background: var(--ytht-bg-surface) !important; border: 1px solid var(--ytht-border-subtle) !important; }
.post-body { color: var(--ytht-text-primary) !important; }
.post-heading { color: var(--ytht-accent-blue) !important; }
.post-side { background: var(--ytht-bg-elevated) !important; border-color: var(--ytht-border-subtle) !important; }
.post-footer { border-color: var(--ytht-border-subtle) !important; }

/* Quotes */
blockquote {
  border-left: 3px solid var(--ytht-border) !important;
  color: #808080 !important;
  background: #f4f4f8 !important;
  padding: 6px 12px !important;
}
pre, code {
  background: #f4f4f8 !important;
  color: #333 !important;
  border: 1px solid var(--ytht-border-subtle) !important;
}

/* ═══ FORMS ═══ */
.form-control {
  background: #fff !important;
  border: 1px solid var(--ytht-border-subtle) !important;
  color: #000 !important;
}
.form-control:focus { border-color: var(--ytht-accent-blue) !important; box-shadow: 0 0 0 2px rgba(51,102,204,0.2) !important; }
.btn-primary {
  background: var(--ytht-accent-blue) !important;
  border-color: #2255aa !important;
  color: #fff !important;
}
.btn-primary:hover { background: #2255aa !important; }
.btn { background: #f0f0f0 !important; border: 1px solid #ccc !important; color: #333 !important; }
.btn:hover { background: #e0e0e0 !important; }

/* ═══ HEADINGS ═══ */
h1, h2, h3, h4, h5, h6 { color: var(--ytht-accent-blue) !important; }
h1 { border-bottom: 2px solid var(--ytht-border) !important; }
h2 { background: var(--ytht-bg-nav) !important; padding: 2px 5px !important; }

/* ═══ TABLES ═══ */
.table > thead > tr > th { border-color: var(--ytht-border) !important; background: var(--ytht-bg-nav) !important; color: #000 !important; }
.table > tbody > tr > td { border-color: var(--ytht-border-subtle) !important; }
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--ytht-bg-elevated) !important; }

/* ═══ FOOTER ═══ */
.page-footer { background: var(--ytht-bg-elevated) !important; border-top: 1px solid var(--ytht-border) !important; color: #666 !important; }
.page-footer a { color: var(--ytht-accent-link) !important; }

/* ═══ ALERTS ═══ */
.alert-info { background: #e8f0ff !important; border-color: var(--ytht-border) !important; color: #369 !important; }
.alert-success { background: #e8ffe8 !important; border-color: #8c8 !important; color: #060 !important; }
.alert-danger { background: #fff0f0 !important; border-color: #c88 !important; color: #c00 !important; }
.alert-warning { background: #fff8e0 !important; border-color: #cc8 !important; color: #860 !important; }

/* ═══ PAGINATION ═══ */
.pagination > li > a { background: #fff !important; border-color: var(--ytht-border-subtle) !important; color: var(--ytht-accent-link) !important; }
.pagination > .active > a { background: var(--ytht-accent-blue) !important; border-color: var(--ytht-accent-blue) !important; color: #fff !important; }

/* ═══ BREADCRUMBS ═══ */
.breadcrumb { background: var(--ytht-bg-elevated) !important; }
.breadcrumb > li > a { color: var(--ytht-accent-link) !important; }
.breadcrumb > .active { color: var(--ytht-text-secondary) !important; }

/* ═══ MODALS ═══ */
.modal-content { background: var(--ytht-bg-surface) !important; border: 1px solid var(--ytht-border) !important; }
.modal-header { background: var(--ytht-bg-nav) !important; color: #000 !important; }
.dropdown-menu { background: #fff !important; border: 1px solid var(--ytht-border-subtle) !important; }
.dropdown-menu > li > a { color: var(--ytht-text-primary) !important; }
.dropdown-menu > li > a:hover { background: #e8f0ff !important; color: var(--ytht-accent-blue) !important; }

/* ═══ BADGES ═══ */
.badge { background: var(--ytht-accent-light) !important; color: #000 !important; }

/* ═══ EDITOR ═══ */
.posting-dialog, .posting-dialog-body { background: #fff !important; border: 1px solid var(--ytht-border) !important; }
.posting-dialog textarea { background: #fff !important; color: #000 !important; }
.markup-editor { background: #fff !important; border: 1px solid var(--ytht-border) !important; }
.markup-editor .toolbar { background: var(--ytht-bg-elevated) !important; }

/* ═══ COMPACT LAYOUT ═══ */
.container { max-width: 980px !important; }
.page-container { padding: 4px 8px !important; }

/* Category grid (reuse from dark theme) */
.list-group-category-item {
  display: grid !important;
  grid-template-columns: 30px 1fr 70px 70px 200px !important;
  align-items: center !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  min-height: 28px !important;
}
.list-group-category-item-rest-col { display: contents !important; }
.list-group-category-item-read-status-col { grid-column: 1 !important; text-align: center !important; font-size: 10px !important; }
.list-group-category-item-main-col { grid-column: 2 !important; min-width: 0 !important; }
.list-group-category-item-name { font-size: 13px !important; font-weight: normal !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.list-group-category-item-description { display: none !important; }
.list-group-category-item-children { display: flex !important; flex-wrap: wrap !important; gap: 0 6px !important; margin-top: 2px !important; padding: 0 !important; }
.list-group-category-item-children li { list-style: none !important; font-size: 11px !important; }
.list-group-category-item-children .bullet { display: none !important; }
.list-group-category-item-stats-col { grid-column: 3 / span 2 !important; display: flex !important; text-align: center !important; font-size: 11px !important; color: var(--ytht-text-secondary) !important; }
.category-stat-threads, .category-stat-posts { flex: 1 !important; text-align: center !important; }
.category-stat-threads .text-muted, .category-stat-posts .text-muted { display: none !important; }
.list-group-category-item-last-thread-col { grid-column: 5 !important; font-size: 11px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.list-group-category-item-last-poster-avatar-col { display: none !important; }
.list-group-category-item-last-thread-title { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: block !important; max-width: 180px !important; }

.list-group-category { margin-bottom: 0 !important; border-radius: 0 !important; }
.list-group-category + .list-group-category { margin-top: 0 !important; }

/* ═══ AVATAR: 隐藏 ═══ */
.user-avatar, img.user-avatar, .avatar, .user-card-avatar, .poster-avatar,
.post-side .user-avatar, .thread-starter-card-avatar,
.notification-actor-avatar, .participants-card-avatar { display: none !important; }
.post-side { min-width: 0 !important; text-align: left !important; }
.post-side .media-left { display: none !important; }

/* ═══ ATTACHMENT: 隐藏 ═══ */
.markup-editor-attachments, .editor-attachments,
[title="Upload file"], button[title="Upload file"],
.markup-editor-toolbar .btn-file-upload { display: none !important; }

/* ═══ ZONE COLLAPSING ═══ */
.ytht-zone-header { position: relative; }
.ytht-zone-header::after { content: "▾"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #999; font-size: 14px; }
.ytht-zone-collapsed .ytht-zone-header::after { content: "▸"; }
.ytht-zone-collapsed .ytht-zone-children { display: none; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ytht-bg-elevated); }
::-webkit-scrollbar-thumb { background: var(--ytht-border); border-radius: 4px; }

/* ═══ SELECTION ═══ */
::selection { background: var(--ytht-accent-light); color: #000; }

/* ═══ MOBILE RESPONSIVE ═══ */
@media (max-width: 768px) {
  #ytht-sidebar { display: none !important; }
  #misago-container { margin-left: 0 !important; }
  .ytht-cat-thead { display: none !important; }
  .list-group-category-item { display: flex !important; flex-wrap: wrap !important; }
  .list-group-category-item-rest-col { display: flex !important; flex-wrap: wrap !important; width: 100% !important; }
  .list-group-category-item-last-thread-col { display: none !important; }
}
@media (max-width: 480px) {
  body { font-size: 12px !important; }
  .btn { min-height: 44px !important; }
  .form-control { font-size: 16px !important; }
}
