:root {
  --bg: #eef2ff;
  --post-bg: #d6daf0;
  --post-border: #b7c5d9;
  --header-bg: #af0a0f;
  --topbar-border: transparent;
  --text: #000;
  --text-light: #333;
  --name-color: #117743;
  --subject-color: #0f0c5d;
  --trip-color: #228854;
  --link-color: #34345c;
  --greentext: #789922;
  --highlight: #d6bad0;
  --reply-bg: #d6daf0;
  --input-bg: #fff;
  --input-border: #b7c5d9;
  --btn-bg: #d6daf0;
  --btn-hover: #c5c9e3;
  --danger: #af0a0f;
  --omitted: #707070;
  --serif: Georgia, 'Times New Roman', Times, serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  min-height: 100vh;
}

.soytan-bg {
  position: fixed;
  bottom: 0; right: 30px;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 0.25s;
}
.soytan-bg img { width: 250px; display: block; }

.greentext { color: var(--greentext); }
.spoiler-text { background: #000; color: #000; border-radius: 2px; padding: 0 2px; }
.spoiler-text:hover { color: #fff; }
.blue-text { color: #0055ff; }

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

.top-bar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--topbar-border);
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar a { color: #fff; }
.top-bar .site-name { color: #fff; font-size: 15px; font-family: var(--serif); font-style: italic; }
.mod-badge a { color: #ff0; }

hr { border: none; border-top: 1px solid var(--post-border); margin: 4px 0; }

.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  position: relative;
  z-index: 1;
}

.board-banner {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto 8px;
  box-sizing: border-box;
}

h1 { font-size: 20px; margin: 8px 0; font-family: var(--serif); }
h2 { font-size: 16px; margin: 12px 0 6px; color: var(--subject-color); font-family: var(--serif); }

.subtitle { color: var(--text-light); margin-bottom: 8px; }
.emblem { display: block; width: 120px; height: auto; margin-bottom: 4px; }
.footer { text-align: center; padding: 8px; color: var(--omitted); }

.board-list { border-collapse: collapse; width: 100%; }
.board-list th { text-align: left; padding: 4px 12px; border-bottom: 1px solid var(--post-border); background: var(--post-bg); white-space: nowrap; }
.board-list td { padding: 6px 12px; border-bottom: 1px solid #ccc; }
.board-list td:first-child { width: 90px; }
.board-list td:nth-child(2) { width: 140px; }
.board-link { font-weight: bold; font-family: monospace; font-size: 14px; color: var(--link-color); }
.empty { color: var(--omitted); margin: 12px 0; }
.rules { margin: 8px 0 8px 20px; color: var(--text-light); line-height: 1.7; }
.rules b { color: var(--text); }

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.board-title { color: var(--subject-color); }
.board-desc { color: var(--text-light); margin-bottom: 6px; }
.overboard-board-tag {
  display: block;
  background: var(--header-bg);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.overboard-board-tag a { color: #fff; }
.view-toggle { flex-shrink: 0; margin-top: 4px; font-size: 12px; color: var(--text-light); }

.profile-header { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0; }
.ph-identicon { flex-shrink: 0; }
.ph-info { display: flex; flex-direction: column; gap: 4px; }
.ph-name { font-size: 18px; font-weight: bold; color: var(--name-color); font-family: var(--serif); }
.ph-trip { font-size: 14px; font-weight: bold; color: var(--trip-color); font-family: var(--serif); margin: 0; }
.ph-stats { font-size: 12px; color: var(--text-light); }
.ph-boards { font-size: 12px; color: var(--text-light); }
.profile-source { color: var(--link-color); font-size: 11px; }
.profile-post { margin: 8px 0; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.profile-post:last-child { border-bottom: none; }

.post-form { margin: 8px 0; }
.form-table { border-collapse: collapse; }
.form-table td { padding: 2px 4px; vertical-align: top; }
.form-label { text-align: right; font-weight: bold; white-space: nowrap; width: 70px; }

.help-icon {
  display: inline-block;
  width: 16px; height: 16px; line-height: 16px;
  text-align: center; font-size: 11px; font-weight: bold;
  color: var(--text-light); background: var(--btn-bg);
  border: 1px solid var(--post-border); border-radius: 50%;
  cursor: help; position: relative; vertical-align: middle;
}
.help-icon:hover .help-popup { display: block; }
.help-popup {
  display: none; position: absolute; right: 0; bottom: 100%;
  margin-bottom: 6px; background: var(--post-bg);
  border: 1px solid var(--post-border); border-radius: 4px;
  padding: 8px 12px; font-size: 12px; font-weight: normal;
  color: var(--text); white-space: nowrap;
  box-shadow: 2px 2px 8px rgba(0,0,0,.2); z-index: 100; line-height: 1.5;
}
.help-popup code { background: var(--btn-bg); padding: 0 3px; border-radius: 2px; }
.trip-preview {
  display: inline-flex; align-items: center; gap: 3px;
  vertical-align: middle; margin-left: 4px;
}
.trip-preview svg { border-radius: 2px; }
.file-queue-list { margin-top: 4px; }
.file-queue-item { font-size: 11px; padding: 2px 0; color: var(--text-light); }
.fq-name { font-weight: bold; color: var(--text); }
.fq-info { margin-left: 4px; }
.fq-remove { color: var(--danger); margin-left: 6px; font-size: 10px; }
.fq-remove:hover { text-decoration: underline; }
.file-counter { font-size: 11px; color: var(--text-light); margin-left: 4px; }
.file-size-hint { font-size: 11px; color: var(--text-light); margin-left: 4px; }

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  background: var(--input-bg); border: 1px solid var(--input-border);
  padding: 3px 5px; font-size: 13px; font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus { border-color: var(--link-color); outline: none; }
input[type="submit"], button, .btn {
  background: var(--btn-bg); border: 1px solid var(--post-border);
  padding: 3px 12px; font-size: 13px; cursor: pointer; font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}
input[type="submit"]:hover, button:hover, .btn:hover { background: var(--btn-hover); }

.btn-sm { padding: 1px 6px; font-size: 11px; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c00; color: #fff; }

.mod-table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.mod-table th { text-align: left; padding: 4px 8px; border-bottom: 2px solid var(--post-border); background: var(--post-bg); }
.mod-table td { padding: 6px 8px; border-bottom: 1px solid var(--post-border); vertical-align: middle; }
.mod-table td code { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-table tr:hover { background: var(--reply-bg); }

.thread { margin: 8px 0; overflow: hidden; }
.thread-nav { margin: 8px 0 4px 0; }
.thread-nav a { margin: 0 8px; }
.thread-update-controls { font-size: 13px; margin-bottom: 4px; }
.thread-update-controls a { margin-right: 8px; }
.update-label { cursor: pointer; }
.update-label input { vertical-align: middle; margin: 0 4px 0 0; }

.post-meta { font-size: 12px; margin-bottom: 2px; clear: both; }
.subject { color: var(--subject-color); font-weight: bold; font-size: 14px; font-family: var(--serif); }
.poster-name { color: var(--name-color); font-weight: bold; }
.poster-name.has-trip { cursor: pointer; }
.poster-name.has-trip:hover { text-decoration: underline; }
.trip-mention { color: var(--name-color); font-weight: bold; }
.identicon-sm { vertical-align: middle; margin-left: 2px; border-radius: 2px; }
.reply-btn { color: var(--link-color); font-size: 11px; margin-left: 4px; font-weight: normal; opacity: 0.7; }
.reply-btn:hover { opacity: 1; }
.post-highlight { background: var(--highlight); transition: background 0.3s; }

.post-menu { position: relative; display: inline-block; margin-left: 4px; }
.post-menu-toggle {
  font-size: 16px; line-height: 1; color: var(--text-light);
  cursor: pointer; vertical-align: middle; text-decoration: none; user-select: none;
}
.post-menu-toggle:hover { color: var(--text); }
.post-menu-dropdown {
  display: none; position: fixed; background: var(--post-bg);
  border: 1px solid var(--post-border); border-radius: 3px;
  z-index: 100; min-width: 80px; box-shadow: 2px 2px 8px rgba(0,0,0,.2);
}
.post-menu-dropdown.open { display: block; }
.post-menu-dropdown a { display: block; padding: 4px 10px; font-size: 12px; color: var(--link-color); white-space: nowrap; }
.post-menu-dropdown a:hover { background: var(--btn-hover); text-decoration: none; }
.quote-text-btn { margin-left: 2px; vertical-align: middle; }
.quote-icon { width: 13px; height: 13px; vertical-align: middle; opacity: 0.65; }
.quote-text-btn:hover .quote-icon { opacity: 1; }
.capcode { font-size: 11px; font-weight: bold; padding: 1px 4px; border-radius: 2px; }
.capcode-admin { background: #af0a0f; color: #fff; }
.capcode-mod { background: #789922; color: #fff; }
.capcode-label { font-size: 11px; color: var(--text-light); cursor: pointer; }
.capcode-label:hover { color: var(--text); }
.profile-link { color: var(--name-color); text-decoration: none; }
.profile-link:hover { text-decoration: underline; }

.op-post { padding: 4px 0; display: inline-block; max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
.op-post .files-container { margin-bottom: 4px; }
.op-post .file-entry { float: left; margin: 0 12px 4px 0; }

.reply-post {
  background: var(--reply-bg); border: none;
  border-right: 1px solid var(--post-border);
  border-bottom: 1px solid var(--post-border);
  border-radius: 0 0 2px 0; padding: 6px 10px; margin: 4px 0 4px 20px;
  display: table; max-width: calc(100% - 20px); overflow-wrap: break-word; word-break: break-word;
}
.reply-post .files-container { margin-bottom: 4px; overflow: hidden; }
.reply-post .file-entry { float: left; margin: 0 12px 4px 0; }

.files-container { }
.files-container::after { content: ''; display: table; clear: both; }

.file-info { font-size: 11px; color: var(--text-light); margin-bottom: 2px; max-width: 200px; overflow-wrap: break-word; word-break: break-word; }

.post-body { overflow-wrap: break-word; word-break: break-word; }

.thumb { max-width: 200px; max-height: 200px; display: block; cursor: pointer; }
.thumb.expanded { max-width: none; max-height: none; }
.img-expanded { overflow-x: visible !important; }

.video-thumb { position: relative; display: inline-block; cursor: pointer; }
.video-thumb-preview { max-width: 200px; max-height: 200px; display: block; background: #000; border-radius: 2px; min-width: 200px; min-height: 150px; }
.video-play-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 50px; height: 50px; background: rgba(0,0,0,.6); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; pointer-events: none; transition: background .15s;
}
.video-thumb:hover .video-play-overlay { background: rgba(0,0,0,.8); }
.video-play-overlay svg { margin-left: 3px; }

.audio-card {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--post-bg); border: 1px solid var(--post-border);
  border-radius: 3px; cursor: pointer; max-width: 300px; clear: both; margin: 4px 0; transition: background .1s;
}
.audio-card:hover { background: var(--btn-hover); }
.audio-icon { color: var(--link-color); flex-shrink: 0; }
.audio-meta { display: flex; flex-direction: column; min-width: 0; }
.audio-filename { font-size: 12px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-size { font-size: 10px; color: var(--text-light); }

.media-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--post-bg); border-top: 2px solid var(--post-border);
  z-index: 300; box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}
.mb-inner { max-width: 500px; margin: 0 auto; padding: 6px 12px; }
.mb-info { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mb-icon { color: var(--link-color); flex-shrink: 0; }
.mb-title {
  font-size: 12px; font-weight: bold; color: var(--text-light);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-link { font-size: 11px; color: var(--link-color); margin-right: 6px; white-space: nowrap; }
.mb-btn {
  background: none; border: none; font-size: 13px; font-weight: bold;
  color: var(--danger); cursor: pointer; padding: 0 4px;
}
.mb-btn:hover { color: #d00; }
.mb-audio { width: 100%; height: 36px; }

.video-player {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 301; background: #000; display: flex; flex-direction: column;
  min-width: 240px; max-width: calc(100vw - 40px); max-height: calc(100vh - 120px); user-select: none;
}
.vp-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px; background: var(--reply-bg);
  border-bottom: 1px solid var(--post-border); flex-shrink: 0; cursor: move; min-height: 28px;
}
.vp-title {
  font-size: 11px; color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; margin-right: 6px;
}
.vp-video { display: block; width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.vp-close-btn {
  background: none; border: none; color: var(--text-light); font-size: 18px;
  cursor: pointer; padding: 0 4px; line-height: 1; flex-shrink: 0;
}
.vp-close-btn:hover { color: var(--danger); }

body.mb-open { padding-bottom: 80px; }
body.vp-open { overflow: hidden; }

.quick-reply {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--post-bg); border: 2px solid var(--post-border);
  border-radius: 4px; padding: 8px 12px; z-index: 200;
  box-shadow: 3px 3px 12px rgba(0,0,0,.25); min-width: 320px; max-width: 480px;
}
.qr-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--post-border);
  font-weight: bold; color: var(--text);
}
.qr-close { font-size: 13px; font-weight: bold; color: var(--danger); text-decoration: none; }
.qr-close:hover { color: #d00; }

.quote-preview {
  position: absolute; z-index: 150; background: var(--post-bg);
  border: 1px solid var(--post-border); border-radius: 3px;
  padding: 6px 10px; max-width: 500px; box-shadow: 2px 2px 8px rgba(0,0,0,.2); pointer-events: none;
}

.tripcard-popup {
  position: absolute; z-index: 160; background: var(--post-bg);
  border: 1px solid var(--post-border); border-radius: 4px;
  padding: 10px 14px; box-shadow: 2px 2px 8px rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 10px;
}
.tc-icon { flex-shrink: 0; }
.tc-info { display: flex; flex-direction: column; }
.tc-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; }
.tc-name { font-size: 14px; font-weight: bold; color: var(--name-color); margin-bottom: 2px; }
.tc-trip { font-size: 13px; font-weight: bold; color: var(--trip-color); font-family: monospace; }

.ban-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 400;
}
.ban-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--post-bg); border: 2px solid var(--post-border);
  border-radius: 4px; padding: 16px 20px; z-index: 401;
  box-shadow: 3px 3px 15px rgba(0,0,0,.3); min-width: 320px;
}
.ban-modal h3 { margin: 0 0 10px; color: var(--text); font-size: 14px; }
.ban-modal table { border-collapse: collapse; }
.ban-modal td { padding: 4px 6px; vertical-align: top; }
.ban-modal input[type="text"] { width: 200px; }

.media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 120px; height: 120px; background: #ccc; border: 2px dashed #999;
  border-radius: 4px; color: #666;
}
.media-placeholder span { font-size: 11px; margin-top: 4px; }

.spoiler-placeholder { display: inline-block; cursor: pointer; }

.media-preview-link { cursor: pointer; }
.media-preview-link:hover { opacity: 0.8; }

.media-float-preview {
  position: fixed; z-index: 500; max-width: 300px; max-height: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4); border-radius: 4px; pointer-events: none;
}
.media-float-preview img { display: block; max-width: 300px; max-height: 300px; border-radius: 4px; }

.report-preview { max-width: 300px; }
.report-thumb { max-width: 60px; max-height: 60px; float: left; margin-right: 6px; border-radius: 2px; }
.report-body-preview { font-size: 12px; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.report-reasons { font-size: 12px; max-width: 200px; }
.report-reasons div { padding: 1px 0; border-bottom: 1px dotted var(--post-border); }
.report-actions { white-space: nowrap; }
.report-actions form { margin-bottom: 2px; }

.media-btn { padding: 4px 12px; font-size: 13px; }

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.catalogue-tile {
  display: block; background: var(--post-bg); border: 1px solid var(--post-border);
  border-radius: 4px; overflow: hidden; text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.catalogue-tile:hover { border-color: var(--link-color); box-shadow: 0 2px 8px rgba(0,0,0,.12); text-decoration: none; }
.cat-thumb-wrap {
  width: 100%; height: 180px; overflow: hidden; background: #ddd;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.cat-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-video-thumb { background: #000; }
.cat-play-overlay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.cat-play-overlay svg { display: block; }
.cat-audio-icon-wrap {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--post-bg);
}
.cat-audio-icon { font-size: 72px; line-height: 1; color: var(--link-color); opacity: 0.5; }
.cat-no-media { color: var(--omitted); font-size: 12px; }
.cat-info { padding: 8px 10px 4px; }
.cat-subject {
  font-weight: bold; color: var(--subject-color); font-size: 13px;
  font-family: var(--serif); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-body {
  font-size: 11px; color: var(--text-light); line-height: 1.4; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.cat-meta { padding: 4px 10px 8px; font-size: 11px; color: var(--omitted); }
.cat-replies { font-size: 11px; }

.log-delete-row:hover { background: var(--reply-bg); }
.log-extra td { padding: 8px 12px; background: var(--post-bg); }
.deleted-post { max-width: 500px; }

@media (max-width: 768px) {
  .content { padding: 6px 8px; max-width: 100%; overflow-x: hidden; }
  body { overflow-x: hidden; }

  .top-bar { font-size: 11px; flex-wrap: wrap; padding: 4px 6px; }

  .form-table { width: 100%; }
  .form-table input[type="text"],
  .form-table input[type="password"],
  .form-table textarea,
  .form-table input[type="file"] {
    width: 100%; box-sizing: border-box; max-width: 100%;
  }
  .form-table input[type="submit"] { width: auto; }

  .reply-post { margin-left: 4px; max-width: calc(100% - 8px); display: block; }
  .thumb { max-width: 150px; max-height: 150px; }
  .video-thumb-preview { max-width: 150px; max-height: 150px; min-width: 150px; min-height: 112px; }
  .audio-card { max-width: 100%; }

  .quick-reply {
    position: fixed !important; top: auto !important; left: 0 !important; right: 0 !important;
    bottom: 0 !important; transform: none !important; width: auto !important;
    min-width: auto; max-width: none; max-height: 60vh; overflow-y: auto; border-radius: 4px 4px 0 0;
  }

  .video-player {
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important;
    bottom: 0 !important; width: 100% !important; max-width: 100% !important;
    max-height: 100vh !important; transform: none !important; border: none !important;
    background: var(--reply-bg) !important;
  }
  .vp-header { min-height: 40px; padding: 6px 10px; }
  .vp-title { font-size: 14px; }
  .vp-close { font-size: 16px; }
  .vp-video { width: 100%; height: auto; object-fit: contain; }

  body.vp-open { overflow: hidden; }

  .ban-modal { min-width: auto; width: 90%; }
  .ban-modal input[type="text"] { width: 100%; }
  .mod-table td code { max-width: 100px; }
  .quote-preview { max-width: 90vw; }
  .tripcard-popup { max-width: 90vw; }
  .media-float-preview { max-width: 200px; max-height: 200px; }
  .media-float-preview img { max-width: 200px; max-height: 200px; }

  .mod-page { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mod-table { min-width: 550px; font-size: 12px; }
  .mod-media-table { min-width: 650px; }
  .mod-wide-table { min-width: 750px; }
  .mod-table th, .mod-table td { padding: 4px 6px; }
  .mod-table .btn-sm { padding: 3px 8px; font-size: 12px; margin: 1px 2px; }
  .mod-table .media-btn { display: block; width: 100%; margin: 2px 0 !important; }
  .mod-table .report-actions .btn-sm { display: inline-block; margin: 2px; }
  .mod-section { min-width: 0; }
}

[data-theme="jardee"] {
  --bg: #eef2ff; --post-bg: #d6daf0; --post-border: #b7c5d9; --header-bg: #af0a0f;
  --text: #000; --text-light: #333; --name-color: #117743; --subject-color: #0f0c5d;
  --trip-color: #228854; --link-color: #34345c; --greentext: #789922; --highlight: #d6bad0;
  --reply-bg: #d6daf0; --input-bg: #fff; --input-border: #b7c5d9; --btn-bg: #d6daf0;
  --btn-hover: #c5c9e3; --danger: #af0a0f; --omitted: #707070; --topbar-border: transparent;
}
[data-theme="dark"] {
  --bg: #1e1e1e; --post-bg: #2d2d2d; --post-border: #444; --header-bg: #1a1a1a;
  --text: #ddd; --text-light: #999; --name-color: #6db36d; --subject-color: #e06c75;
  --trip-color: #6db36d; --link-color: #61afef; --greentext: #98c379; --highlight: #3a3a3a;
  --reply-bg: #2d2d2d; --input-bg: #333; --input-border: #555; --btn-bg: #3a3a3a;
  --btn-hover: #4a4a4a; --danger: #e74c3c; --omitted: #777; --topbar-border: #555;
}
[data-theme="sepia"] {
  --bg: #f5e6d3; --post-bg: #e8d5b7; --post-border: #c9a96e; --header-bg: #8b4513;
  --text: #3e2723; --text-light: #5d4037; --name-color: #2e7d32; --subject-color: #bf360c;
  --trip-color: #2e7d32; --link-color: #1565c0; --greentext: #558b2f; --highlight: #ffe0b2;
  --reply-bg: #e8d5b7; --input-bg: #fff8f0; --input-border: #c9a96e; --btn-bg: #e8d5b7;
  --btn-hover: #d4c4a8; --danger: #b71c1c; --omitted: #8d6e63;
}
[data-theme="midnight"] {
  --bg: #28282e; --post-bg: #1f1f1f; --post-border: #0099ff; --header-bg: #3f3f3f;
  --text: #eee; --text-light: #aaa; --name-color: #0044ff; --subject-color: #33ddff;
  --trip-color: #33ddff; --link-color: #0099ff; --greentext: #55ff33; --highlight: #2c2c3c;
  --reply-bg: #1f1f1f; --input-bg: #000; --input-border: #a9a9a9; --btn-bg: #333;
  --btn-hover: #444; --danger: #f00; --omitted: #888;
}
[data-theme="light"] {
  --bg: #f4efe6; --post-bg: #e8e0d5; --post-border: #ccc4b8; --header-bg: #5c4a3a;
  --text: #3a3228; --text-light: #8a7e6e; --name-color: #5a8f3c; --subject-color: #3a3228;
  --trip-color: #5a8f3c; --link-color: #6b4c8a; --greentext: #6a8c4a; --highlight: #e0d6c8;
  --reply-bg: #e8e0d5; --input-bg: #faf7f2; --input-border: #ccc4b8; --btn-bg: #e0d6c8;
  --btn-hover: #d4cabc; --danger: #b8423a; --omitted: #b0a898; --topbar-border: #ccc4b8;
}
[data-theme="rose"] {
  --bg: #edf5ee; --post-bg: #dce8dd; --post-border: #bcc8bd; --header-bg: #4a6b4c;
  --text: #2a3a2c; --text-light: #7a8a7c; --name-color: #4a7c6c; --subject-color: #2a3a2c;
  --trip-color: #4a7c6c; --link-color: #5a6abc; --greentext: #5a8a4a; --highlight: #d8e8d8;
  --reply-bg: #dce8dd; --input-bg: #f8fcf8; --input-border: #bcc8bd; --btn-bg: #d0dcd0;
  --btn-hover: #c0d0c0; --danger: #b85c5c; --omitted: #a0b0a8; --topbar-border: #bcc8bd;
}
.quoterope-bg { position: fixed; top: 32px; right: 16px; pointer-events: auto; z-index: 0; cursor: pointer; }
.quoterope-bg img { width: 120px; display: block; transform-origin: 75% 0; transition: transform 0.1s; -webkit-tap-highlight-color: transparent; }
.quoterope-bg.swing img { animation: swing 0.5s ease-in-out; }
@keyframes swing { 0% { transform: rotate(0deg); } 25% { transform: rotate(5deg); } 50% { transform: rotate(-4deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0deg); } }
.media-btn { padding: 4px 12px; font-size: 13px; }
.poll { margin: 8px 0; max-width: 400px; }
.poll-option { position: relative; padding: 4px 8px; margin: 2px 0; border: 1px solid var(--post-border); cursor: pointer; border-radius: 2px; overflow: hidden; }
.poll-voted .poll-option, .poll-option:hover { background: var(--btn-hover); }
.poll-bar { position: absolute; top: 0; left: 0; bottom: 0; background: var(--link-color); z-index: 0; transition: width 0.3s; opacity: 0.30; }
.poll-label { position: relative; z-index: 1; font-size: 12px; }
.poll-count { position: relative; z-index: 1; font-size: 11px; color: var(--text-light); float: right; }
.log-delete-row:hover { background: var(--reply-bg); }
.log-extra td { padding: 8px 12px; background: var(--post-bg); }
.deleted-post { max-width: 500px; }
.backlinks { font-size: 11px; margin-right: 6px; }
.trip-clear { cursor: pointer; margin-left: 6px; font-size: 14px; color: var(--text-light); }
.trip-clear:hover { color: var(--danger); }
.backlinks a { margin-right: 2px; }
.you-tag { font-size: 11px; font-weight: bold; color: var(--link-color); }
.embed-img { max-width: 100%; max-height: 400px; border-radius: 4px; margin: 4px 0; display: block; }
.embed-blocked { font-size: 11px; color: var(--danger); }
.redtext { color: var(--danger); }
.booru-inline { display: inline-block; margin: 2px 0; }
.booru-inline-title { font-size: 11px; color: var(--link-color); text-decoration: none; }
.booru-inline-title:hover { text-decoration: underline; }
.booru-inline .thumb { max-width: 180px; max-height: 180px; cursor: pointer; border-radius: 2px; display: block; }
.quick-reply textarea { max-width: 100%; resize: vertical; }
@media (max-width: 640px) { .soytan-bg { display: none; } }

.news-item { padding: 8px 0; }
.news-meta { font-size: 12px; color: var(--text-light); margin-bottom: 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.news-date { font-weight: bold; }
.news-author { color: var(--name-color); }
.news-link { font-size: 11px; }
.news-body { margin-top: 4px; line-height: 1.5; }
.news-body .post-body { padding: 0; margin: 0; }
.news-files { margin: 6px 0; }
.news-thumb { max-width: 150px; max-height: 150px; border-radius: 4px; cursor: pointer; }
.news .empty { color: var(--text-light); font-style: italic; }

/* Booru */
.booru-search { margin-bottom: 8px; }
.booru-popular-tags { margin-top: 6px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 3px; }
.booru-popular-label { font-size: 11px; color: var(--text-light); margin-right: 6px; line-height: 22px; }
.booru-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.booru-tile { display: block; border: 1px solid var(--post-border); background: var(--post-bg); border-radius: 2px; text-decoration: none; color: var(--text-color); overflow: hidden; width: 180px; }
.booru-tile:hover { border-color: var(--link-color); }
.booru-thumb-wrap { width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-color); }
.booru-thumb { max-width: 180px; max-height: 180px; display: block; }
.booru-tile-info { padding: 4px 6px; font-size: 10px; border-top: 1px solid var(--post-border); }
.rating-safe { color: var(--greentext); }
.rating-questionable { color: #d4a017; }
.rating-explicit { color: var(--danger); }
.rating-unrated { color: var(--text-light); }

/* Booru post */
.booru-post-nav { margin-bottom: 8px; font-size: 12px; }
.booru-post-nav a { margin-right: 4px; }
.booru-post-nav .mod-controls a { margin-right: 0; }
.booru-dup-notice { padding: 6px 10px; margin-bottom: 10px; background: var(--post-bg); border: 1px solid var(--post-border); font-size: 12px; color: var(--text-light); border-radius: 2px; }
.booru-clear { font-size: 11px; margin-left: 6px; }
.booru-explicit-toggle { font-size: 11px; margin-left: 10px; color: var(--text-light); cursor: pointer; }
.booru-explicit-toggle input { vertical-align: middle; margin: 0 3px 0 0; }

.booru-post-image { margin-bottom: 12px; }
.booru-post-img { max-width: 100%; max-height: 85vh; border-radius: 2px; display: block; margin: 0 auto; cursor: zoom-in; }
.booru-post-img.expanded { max-height: none; cursor: zoom-out; }
.booru-post-thumb { max-width: 200px; max-height: 200px; cursor: pointer; border-radius: 2px; }
.booru-post-file { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.booru-post-source { font-size: 12px; margin-bottom: 10px; }
.booru-post-source .poster-name { font-weight: bold; color: var(--name-color); }
.booru-post-info .booru-field { margin-bottom: 4px; font-size: 12px; }
.booru-post-info .booru-label { display: inline; width: auto; padding-top: 0; margin-right: 4px; margin-bottom: 0; font-size: 12px; color: var(--text-light); }
.booru-edit-form { margin-top: 10px; }
.booru-field { margin-bottom: 10px; }
.booru-label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 3px; }
.booru-label-hint { font-size: 10px; color: var(--omitted); }
.booru-select { font-size: 12px; padding: 3px 6px; background: var(--post-bg); color: var(--text-color); border: 1px solid var(--post-border); border-radius: 2px; }
.booru-text-input { font-size: 13px; padding: 4px 8px; background: var(--post-bg); color: var(--text-color); border: 1px solid var(--post-border); border-radius: 2px; width: 100%; max-width: 400px; display: block; }
.booru-submit-row { padding-top: 10px; }
.booru-tag-list { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-bottom: 6px; }
.booru-tag { display: inline-block; background: var(--post-border); color: var(--text-color); padding: 2px 8px; border-radius: 2px; font-size: 12px; white-space: nowrap; }
.booru-tag a { color: var(--text-light); text-decoration: none; font-size: 13px; margin-left: 2px; vertical-align: middle; }
.booru-tag a:hover { color: var(--danger); }
.booru-tag-area { }
.booru-tag-input { font-size: 13px; padding: 4px 8px; background: var(--post-bg); color: var(--text-color); border: 1px solid var(--post-border); border-radius: 2px; min-width: 200px; }
.booru-tag-input-row { display: flex; gap: 6px; align-items: center; }
.booru-tag-suggestions { background: var(--post-bg); border: 1px solid var(--post-border); max-width: 400px; z-index: 100; display: block; margin-top: 2px; }
.booru-tag-suggestion { display: block; padding: 3px 8px; font-size: 12px; cursor: pointer; color: var(--text-color); }
.booru-tag-suggestion:hover { background: var(--post-border); }
.booru-add-link { font-size: 11px; margin-left: 8px; white-space: nowrap; }
.booru-add-link a { color: var(--link-color); text-decoration: none; }
.booru-add-link a:hover { text-decoration: underline; }
.booru-tag-link { text-decoration: none; }
.booru-tag-link:hover { background: var(--link-color); color: #fff; }
.booru-error { color: var(--danger); font-size: 12px; margin-bottom: 6px; }
