/*
 * YTHT Reborn — 仿老站"蓝色理想"浅色主题
 * 色板取自老站 bbssg.css: #f8f5ff 淡紫白, #abc8f2 蓝色调, #369 深蓝
 * 布局: 左侧栏 155px + 右侧主内容
 */

:root {
  --ytht-classic-bg: #f8f5ff;
  --ytht-classic-bg-soft: #f0f2fa;
  --ytht-classic-bg-panel: #ffffff;
  --ytht-classic-line: #abc8f2;
  --ytht-classic-line-strong: #3366cc;
  --ytht-classic-text: #000000;
  --ytht-classic-muted: #666666;
  --ytht-classic-dim: #999999;
  --ytht-classic-link: #0000f0;
  --ytht-classic-gold: #3366cc;
  --ytht-classic-green: #006600;
  --ytht-classic-red: #cc0000;
  --ytht-classic-font: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

html,
body {
  background: #f8f5ff;
  color: var(--ytht-classic-text);
  font-family: var(--ytht-classic-font);
}

body {
  font-size: 12px;
  line-height: 1.5;
}

a {
  color: var(--ytht-classic-link);
}

a:hover,
a:focus {
  color: #ff0000;
  text-decoration: underline;
  background: #ddd;
}

#misago-container {
  min-height: 100vh;
  margin-left: 155px;
}

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

.ytht-sb-header {
  background: #3366cc; 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 #abc8f2; background: #f0f0fa;
}
.ytht-sb-user a { color: #0000f0 !important; }

.ytht-sb-folder { border-bottom: 1px solid #ddd; }
.ytht-sb-folder summary {
  padding: 4px 8px; font-size: 12px; font-weight: bold;
  color: #3366cc; cursor: pointer; background: #f0f2fa;
  border-bottom: 1px solid #ddd; list-style: none;
  display: flex; align-items: center; gap: 4px;
}
.ytht-sb-folder summary::before { content: "▸"; font-size: 10px; }
.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: #000 !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: #f00 !important; background: #dde4f4 !important;
  text-decoration: underline !important;
}

.ytht-sb-search { padding: 6px 8px; border-top: 1px solid #ddd; }
.ytht-sb-search input {
  width: 100%; font-size: 11px; padding: 3px 6px;
  border: 1px solid #abc8f2; background: #fff; color: #000;
}
.ytht-sb-search input:focus { border-color: #3366cc; outline: none; }

.ytht-sb-foot {
  padding: 4px 8px; font-size: 10px; color: #999;
  border-top: 1px solid #ddd; text-align: center;
}

/* ═══ SHELL ═══ */
.ytht-shell {
  width: min(980px, calc(100vw - 180px));
  margin: 8px auto 16px;
}

/* ═══ MASTHEAD (浅蓝导航) ═══ */
.ytht-masthead,
.ytht-screen,
.ytht-footer {
  border: 1px solid #abc8f2;
  background: #ffffff;
}

.ytht-masthead {
  margin-bottom: 8px;
}

.ytht-masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
}

.ytht-masthead-top {
  background: #abc8f2;
  border-bottom: 2px solid #3366cc;
}

.ytht-brand-title {
  color: #3366cc;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
}

.ytht-brand-subtitle,
.ytht-nav-meta,
.ytht-screen-subtitle,
.ytht-faded {
  color: #666;
  font-size: 11px;
}

.ytht-masthead-nav {
  background: #f0f2fa;
  border-top: 1px solid #ddd;
}

.ytht-account-strip,
.ytht-main-nav,
.ytht-screen-meta,
.ytht-zone-meta,
.ytht-pager,
.ytht-filter-line,
.ytht-subboard-strip,
.ytht-post-links,
.ytht-post-meta,
.ytht-footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ytht-top-link,
.ytht-main-nav a,
.ytht-filter-line a,
.ytht-subboard-strip a,
.ytht-pager a,
.ytht-footer a {
  color: #0000f0;
}

.ytht-button-reset {
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.ytht-button-reset:hover,
.ytht-button-reset:focus {
  color: #f00;
}

.ytht-inline-form {
  display: inline-flex;
  margin: 0;
}

.ytht-body-start-outlets {
  margin-bottom: 8px;
}

/* Hide non-sidebar BODY_START outlets on home/categories (sidebar is fixed, not affected) */
.ytht-page-home .ytht-body-start-outlets > *:not(#ytht-sidebar),
.ytht-page-categories .ytht-body-start-outlets > *:not(#ytht-sidebar) {
  display: none;
}

/* ═══ SCREEN (Content panels) ═══ */
.ytht-screen {
  padding: 10px;
}

.ytht-screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid #abc8f2;
}

.ytht-screen-title,
.ytht-zone-title,
.ytht-reply-head {
  color: #3366cc;
  font-size: 14px;
  font-weight: bold;
}

/* ═══ ZONE / BOARD TABLES ═══ */
.ytht-zone-strip,
.ytht-subboard-strip,
.ytht-filter-line,
.ytht-pager,
.ytht-zone-head,
.ytht-thread-event,
.ytht-reply-actions,
.ytht-post-head {
  padding: 6px 8px;
  border: 1px solid #abc8f2;
  background: #f4f4f8;
}

.ytht-zone-strip,
.ytht-subboard-strip,
.ytht-filter-line,
.ytht-pager {
  margin-bottom: 8px;
}

.ytht-zone-section + .ytht-zone-section {
  margin-top: 12px;
}

.ytht-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 0;
  background: #abc8f2;
}

.ytht-board-table,
.ytht-thread-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 8px;
}

.ytht-board-table th,
.ytht-board-table td,
.ytht-thread-table th,
.ytht-thread-table td {
  border: 1px solid #ddd;
  padding: 4px 8px;
  vertical-align: top;
  word-break: break-word;
  font-size: 12px;
}

.ytht-board-table th,
.ytht-thread-table th {
  color: #000;
  background: #abc8f2;
  font-weight: bold;
}

.ytht-board-table tbody tr:nth-child(odd),
.ytht-thread-table tbody tr:nth-child(odd) {
  background: #f4f4f8;
}

.ytht-board-table tbody tr:nth-child(even),
.ytht-thread-table tbody tr:nth-child(even) {
  background: #ffffff;
}

.ytht-board-table tr.is-unread,
.ytht-thread-table tr.is-unread {
  box-shadow: inset 3px 0 0 0 #c00;
}

.ytht-board-table th:nth-child(1),
.ytht-thread-table th:nth-child(1),
.ytht-board-table td:nth-child(1),
.ytht-thread-table td:nth-child(1) {
  width: 50px;
  text-align: center;
}

.ytht-board-table th:nth-child(4),
.ytht-board-table td:nth-child(4),
.ytht-board-table th:nth-child(5),
.ytht-board-table td:nth-child(5),
.ytht-thread-table th:nth-child(6),
.ytht-thread-table td:nth-child(6) {
  width: 80px;
  text-align: right;
}

.ytht-thread-table th:nth-child(2),
.ytht-thread-table td:nth-child(2) {
  width: 80px;
  text-align: center;
}

.ytht-thread-table th:nth-child(4),
.ytht-thread-table td:nth-child(4),
.ytht-thread-table th:nth-child(5),
.ytht-thread-table td:nth-child(5) {
  width: 120px;
}

.ytht-last-post div,
.ytht-thread-title div,
.ytht-post-edit-note {
  margin-top: 2px;
}

.ytht-inline-flag {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #abc8f2;
  color: #3366cc;
  background: #eef4ff;
  font-size: 11px;
}

.ytht-markers span + span {
  margin-left: 3px;
}

.ytht-empty-row {
  padding: 12px;
  border: 1px solid #ddd;
  background: #f4f4f8;
  color: #999;
}

/* ═══ THREAD FEED / POSTS ═══ */
.ytht-thread-feed {
  display: grid;
  gap: 8px;
}

.ytht-post-card {
  border: 1px solid #ddd;
  background: #fff;
}

.ytht-post-card.is-new {
  box-shadow: inset 0 0 0 1px rgba(51,102,204,0.3);
}

.ytht-post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #ddd;
  margin: 0;
  background: #f4f4f8;
}

.ytht-post-floor,
.ytht-post-author {
  color: #3366cc;
  font-weight: bold;
}

.ytht-post-body {
  padding: 10px;
}

.ytht-rich-text {
  color: #000;
  line-height: 1.6;
}

.ytht-rich-text a {
  color: #0000f0;
}

.ytht-rich-text p:last-child {
  margin-bottom: 0;
}

.ytht-thread-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ═══ REPLY BOX ═══ */
.ytht-reply-box {
  border: 1px solid #abc8f2;
  background: #fff;
}

.ytht-reply-head {
  padding: 8px 10px;
  border-bottom: 1px solid #abc8f2;
  background: #f0f2fa;
}

.ytht-reply-body {
  padding: 10px;
}

.ytht-reply-actions {
  justify-content: flex-end;
  border: 0;
  border-top: 1px solid #ddd;
  margin: 0;
}

.ytht-reply-box .btn,
.ytht-reply-actions .btn {
  border-radius: 0;
}

/* ═══ FOOTER ═══ */
.ytht-footer {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 10px;
  color: #666;
  font-size: 11px;
}

.ytht-footer-line {
  gap: 6px;
}

.is-active,
.ytht-filter-line a.is-active {
  color: #c00;
  font-weight: bold;
}

.is-disabled {
  color: #999;
}

/* ═══ FORMS ═══ */
.form-control,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  background: #fff;
  border: 1px solid #abc8f2;
  color: #000;
  border-radius: 0;
  font-size: 12px;
}

.form-control:focus,
textarea:focus,
input:focus {
  border-color: #3366cc;
  box-shadow: 0 0 0 2px rgba(51,102,204,0.15);
}

.panel, .panel-body, .panel-footer,
.card, .card-body, .card-header {
  background: transparent;
  border-radius: 0;
}

.btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #333;
  border-radius: 0;
  font-size: 12px;
}
.btn:hover { background: #e0e0e0; }
.btn-primary { background: #3366cc; border-color: #2255aa; color: #fff; }
.btn-primary:hover { background: #2255aa; }

/* ═══ ATTACHMENTS: hidden ═══ */
.posts-feed-item-attachments { margin-top: 12px; border-top: 1px dashed #ddd; padding-top: 8px; }
.posts-feed-item-attachments-header,
.posts-feed-item-attachments-list-item-details { color: #999; }

/* ═══ AVATAR: hidden ═══ */
.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; }
.markup-editor-attachments, .editor-attachments,
[title="Upload file"], button[title="Upload file"],
.markup-editor-toolbar .btn-file-upload { display: none !important; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #abc8f2; border-radius: 4px; }

::selection { background: #abc8f2; color: #000; }

/* ═══ MOBILE ═══ */
@media (max-width: 960px) {
  #ytht-sidebar { display: none !important; }
  #misago-container { margin-left: 0 !important; }

  .ytht-shell {
    width: min(100vw - 12px, 100%);
    margin: 6px auto 12px;
  }

  .ytht-masthead-row,
  .ytht-screen-head,
  .ytht-zone-head,
  .ytht-post-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ytht-board-table, .ytht-thread-table,
  .ytht-board-table thead, .ytht-thread-table thead,
  .ytht-board-table tbody, .ytht-thread-table tbody,
  .ytht-board-table tr, .ytht-thread-table tr,
  .ytht-board-table td, .ytht-thread-table td {
    display: block; width: 100%;
  }
  .ytht-board-table thead, .ytht-thread-table thead { display: none; }
  .ytht-board-table tr, .ytht-thread-table tr {
    margin-bottom: 8px; border: 1px solid #abc8f2;
  }
  .ytht-board-table td, .ytht-thread-table td {
    border: 0; border-bottom: 1px solid #eee;
    padding-left: 100px; position: relative; text-align: left !important;
  }
  .ytht-board-table td:last-child, .ytht-thread-table td:last-child { border-bottom: 0; }
  .ytht-board-table td::before, .ytht-thread-table td::before {
    content: attr(data-label); position: absolute; left: 8px; top: 6px; color: #3366cc;
  }
}
