*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: #0d1117; color: #c9d1d9; }

#app { display: flex; height: 100vh; overflow: hidden; }
#sidebar { width: 280px; min-width: 280px; background: #161b22; border-right: 1px solid #30363d; display: flex; flex-direction: column; }
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.sidebar-header { padding: 12px; border-bottom: 1px solid #30363d; }
.sidebar-header input { width: 100%; padding: 8px 12px; background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px; font-size: 13px; outline: none; }
.sidebar-header input:focus { border-color: #1f6feb; }

.contact-list { flex: 1; overflow-y: auto; padding: 4px; }
.contact-item { padding: 8px 12px; margin: 2px 0; border-radius: 6px; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; gap: 10px; }
.contact-item:hover { background: #1c2333; }
.contact-item.active { background: #1c2333; border: 1px solid rgba(31,111,235,0.33); }
.contact-item .contact-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: #21262d; }
.contact-item .contact-info { flex: 1; min-width: 0; }
.contact-item .name { font-size: 13px; font-weight: 600; color: #c9d1d9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-item .meta { font-size: 11px; color: #8b949e; margin-top: 2px; display: flex; justify-content: space-between; }
.type-badge { font-size: 10px; padding: 1px 6px; border-radius: 3px; }
.type-badge.group { background: rgba(31,111,235,0.13); color: #58a6ff; }
.type-badge.user { background: rgba(255,138,101,0.13); color: #ff8a65; }

.chat-header { padding: 10px 16px; border-bottom: 1px solid #30363d; display: flex; align-items: center; gap: 10px; background: #161b22; }
.chat-header .header-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: #21262d; }
.chat-header .header-info { display: flex; align-items: baseline; gap: 12px; }
.chat-name { font-size: 14px; font-weight: 700; color: #58a6ff; }
.chat-stats { font-size: 11px; color: #8b949e; }

.filter-bar { padding: 10px 16px; border-bottom: 1px solid #30363d; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #161b22; }
.filter-bar input, .filter-bar select { background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 4px; padding: 5px 10px; font-size: 12px; outline: none; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #1f6feb; }
#filter-keyword { width: 180px; }
#filter-date-start, #filter-date-end, #jump-date { width: 115px; }
.date-sep { color: #484f58; font-size: 12px; }
.filter-result-count { font-size: 10px; color: #8b949e; margin-left: auto; }

.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #484f58; }
.welcome-icon { font-size: 48px; margin-bottom: 16px; }
.welcome h2 { color: #8b949e; font-size: 18px; margin-bottom: 8px; }
.welcome p { font-size: 13px; }

.message-list { flex: 1; overflow-y: auto; padding: 16px 20px; }
.date-divider { text-align: center; margin: 20px 0 14px; }
.date-divider span { background: #21262d; color: #8b949e; padding: 3px 14px; border-radius: 12px; font-size: 11px; }

/* Chat bubble messages */
.msg-row { display: flex; margin-bottom: 12px; cursor: pointer; align-items: flex-start; }
.msg-row.me { justify-content: flex-end; }
.msg-row.other { justify-content: flex-start; }

.msg-avatar { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; overflow: hidden; }
.msg-avatar img { width: 100%; height: 100%; border-radius: 4px; object-fit: cover; }
.msg-row.other .msg-avatar { margin-right: 8px; }
.msg-row.me .msg-avatar { margin-left: 8px; }

.msg-bubble { max-width: 72%; padding: 0; border-radius: 8px; transition: background 0.1s; }
.msg-row.me .msg-bubble { background: #1a3a5c; border: 1px solid rgba(31,111,235,0.2); }
.msg-row.other .msg-bubble { background: #1c2128; border: 1px solid #30363d; }
.msg-row.me .msg-bubble:hover { background: #1f4068; }
.msg-row.other .msg-bubble:hover { background: #21262d; }

.msg-meta { display: flex; align-items: center; gap: 8px; padding: 6px 12px 2px; font-size: 11px; }
.msg-row.me .msg-meta { justify-content: flex-end; }
.msg-sender { font-weight: 600; font-size: 11px; }
.msg-row.me .msg-sender { color: #ff8a65; }
.msg-row.other .msg-sender { color: #58a6ff; }
.msg-time { color: #484f58; font-family: monospace; font-size: 10px; }
.msg-num { color: #484f58; font-family: monospace; font-size: 10px; min-width: 24px; }

.msg-text { padding: 4px 12px 8px; font-size: 13px; color: #c9d1d9; line-height: 1.5; word-break: break-word; }

.msg-type-tag { padding: 1px 6px; border-radius: 3px; font-size: 10px; margin-right: 4px; white-space: nowrap; }
.msg-type-tag.image { background: rgba(255,138,101,0.13); color: #ff8a65; }
.msg-type-tag.voice { background: rgba(77,182,172,0.13); color: #4db6ac; }
.msg-type-tag.video { background: rgba(233,69,96,0.13); color: #e94560; }
.msg-type-tag.location { background: rgba(88,166,255,0.13); color: #58a6ff; }
.msg-type-tag.link { background: rgba(255,213,79,0.13); color: #ffd54f; }
.msg-type-tag.card { background: rgba(120,144,156,0.13); color: #78909c; }
.msg-type-tag.file { background: rgba(255,138,101,0.13); color: #ff8a65; }
.msg-type-tag.emoji { background: rgba(186,104,200,0.13); color: #ba68c8; }
.msg-type-tag.system { background: rgba(120,144,156,0.13); color: #78909c; }

/* Expanded bubble detail */
.msg-bubble-detail { padding: 12px 16px; margin: 4px 0 16px; background: #161b22; border: 1px solid #21262d; border-radius: 8px; font-size: 12px; cursor: default; }
.msg-bubble-detail.own { margin-left: auto; max-width: 72%; }
.msg-bubble-detail.other { margin-right: auto; max-width: 72%; }
.bubble-image { max-width: 320px; border-radius: 6px; cursor: pointer; }
.bubble-voice { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.bubble-voice .vp-play-btn { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; background: #1f6feb; border: none; color: #fff; font-size: 15px; cursor: pointer; line-height: 34px; text-align: center; padding: 0; transition: background 0.15s; }
.bubble-voice .vp-play-btn:hover { background: #388bfd; }
.bubble-voice .vp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bubble-voice .vp-time-row { display: flex; align-items: center; gap: 2px; font-size: 10px; color: #8b949e; font-family: monospace; }
.bubble-voice .vp-time-sep { color: #484f58; }
.bubble-voice .vp-time-dur { color: #8b949e; }
.bubble-voice .vp-bar-track { height: 6px; background: #30363d; border-radius: 3px; cursor: pointer; position: relative; margin: 1px 0; }
.bubble-voice .vp-bar-track:hover { background: #3a3f47; }
.bubble-voice .vp-bar-fill { height: 6px; background: #4db6ac; border-radius: 3px; pointer-events: none; transition: width 0.1s linear; }
.bubble-voice .vp-speed-row { display: flex; gap: 3px; margin-top: 2px; }
.bubble-voice .vp-speed-btn { height: 20px; padding: 0 5px; border-radius: 3px; background: transparent; border: 1px solid rgba(77,182,172,0.2); color: #8b949e; font-size: 10px; font-family: monospace; cursor: pointer; transition: all 0.15s; line-height: 18px; }
.bubble-voice .vp-speed-btn:hover { border-color: rgba(77,182,172,0.5); color: #c9d1d9; }
.bubble-voice .vp-speed-btn.active { background: rgba(77,182,172,0.2); border-color: #4db6ac; color: #4db6ac; font-weight: 600; }
.bubble-voice .vp-trans-btn { width: 26px; height: 26px; min-width: 26px; border-radius: 4px; background: rgba(77,182,172,0.15); border: 1px solid rgba(77,182,172,0.3); color: #4db6ac; font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; line-height: 24px; text-align: center; transition: background 0.15s; }
.bubble-voice .vp-trans-btn:hover { background: rgba(77,182,172,0.25); }
.bubble-voice .vp-trans-btn:disabled { opacity: 0.5; cursor: default; }
.bubble-voice .vp-dl-btn { color: #484f58; font-size: 12px; text-decoration: none; padding: 4px; border-radius: 3px; transition: color 0.15s; }
.bubble-voice .vp-dl-btn:hover { color: #58a6ff; }
.vp-trans-result { margin-top: 6px; padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 1.4; }
.vp-trans-result.success { background: rgba(77,182,172,0.08); color: #c9d1d9; border: 1px solid rgba(77,182,172,0.2); }
.vp-trans-result.empty { background: rgba(120,144,156,0.08); color: #8b949e; border: 1px solid rgba(120,144,156,0.2); }
.vp-trans-result.error { background: rgba(233,69,96,0.08); color: #e94560; border: 1px solid rgba(233,69,96,0.2); }
.bubble-location { border: 1px solid #30363d; border-radius: 6px; overflow: hidden; }
.bubble-location .map-placeholder { height: 120px; background: #1a2332; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #8b949e; }
.bubble-location .addr-info { padding: 8px 12px; }
.bubble-link { border: 1px solid #30363d; border-radius: 6px; overflow: hidden; cursor: pointer; }
.bubble-link:hover { border-color: #1f6feb; }
.bubble-link .link-title { padding: 10px 12px 4px; font-weight: 600; }
.bubble-link .link-desc { padding: 0 12px 10px; color: #8b949e; font-size: 11px; }
.bubble-contact { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #30363d; border-radius: 6px; }
.bubble-system { text-align: center; padding: 4px 0; }
.bubble-system span { background: rgba(120,144,156,0.12); color: #78909c; padding: 2px 12px; border-radius: 10px; font-size: 11px; }

/* Non-text message placeholders */
.nontext-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px; gap: 6px; color: #8b949e; font-size: 13px; background: #0d1117; border: 1px solid #21262d; border-radius: 6px; }
.nontext-placeholder > span:first-child { font-size: 28px; }
.image-plc { border-color: rgba(255,138,101,0.2); }
.voice-plc { border-color: rgba(77,182,172,0.2); }
.location-plc { border-color: rgba(88,166,255,0.2); }
.link-plc { border-color: rgba(255,213,79,0.2); }
.card-plc { border-color: rgba(120,144,156,0.2); }
.emoji-plc { border-color: rgba(186,104,200,0.2); }
.file-plc { border-color: rgba(255,138,101,0.2); }

.pagination-bar { padding: 10px 16px; border-top: 1px solid #30363d; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #161b22; }
.pg-btn { padding: 5px 10px; background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pg-btn:hover { border-color: #1f6feb; color: #58a6ff; }
.pg-btn:disabled { color: #484f58; cursor: default; border-color: #21262d; }
.pg-btn.active { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.page-numbers { display: flex; gap: 4px; }
.pagination-info { font-size: 10px; color: #484f58; margin-left: auto; }

.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); align-items: center; justify-content: center; z-index: 1000; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 32px; cursor: pointer; }

.hidden { display: none !important; }
.loading { text-align: center; padding: 40px; color: #8b949e; }
.loading-icon { font-size: 28px; margin-bottom: 8px; }
.error-msg { text-align: center; padding: 40px; color: #e94560; }
.empty-msg { text-align: center; padding: 40px; color: #484f58; font-size: 13px; line-height: 1.8; }
.empty-msg .hint { margin-top: 12px; font-size: 12px; color: #484f58; background: #161b22; padding: 12px 20px; border-radius: 8px; display: inline-block; text-align: left; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* === Top Navigation === */
#top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  position: sticky;
  top: 0;
  z-index: 100;
}
#top-nav .nav-brand {
  font-size: 16px;
  font-weight: 600;
  color: #f0f6fc;
  text-decoration: none;
}
#top-nav .nav-brand:hover { color: #58a6ff; }
#top-nav .nav-version {
  font-size: 10px;
  color: #484f58;
  background: #21262d;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-family: "SF Mono", "Cascadia Code", monospace;
}
#top-nav .nav-right { display: flex; gap: 12px; align-items: center; }
#top-nav .nav-link {
  color: #8b949e;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
}
#top-nav .nav-link:hover { color: #f0f6fc; background: #21262d; }
#top-nav .nav-manual {
  color: #8b949e;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 4px;
}
#top-nav .nav-manual:hover { color: #f0f6fc; background: #21262d; }

#content { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* === Dashboard === */
.dashboard-section { margin-bottom: 32px; }
.dashboard-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #f0f6fc;
}
.dashboard-section .section-subtitle {
  font-size: 12px;
  color: #8b949e;
  margin: 0 0 16px 0;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 800px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}
.dashboard-card {
  display: block;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: #c9d1d9;
  transition: border-color 0.15s, background 0.15s;
}
.dashboard-card:hover {
  border-color: #58a6ff;
  background: #1c2333;
}
.dashboard-card .card-icon { font-size: 28px; margin-bottom: 8px; }
.dashboard-card .card-title { font-size: 15px; font-weight: 600; color: #f0f6fc; margin-bottom: 4px; }
.dashboard-card .card-desc { font-size: 12px; color: #8b949e; }

/* === Wizard / Operation Pages === */
.steps-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow-x: auto;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #484f58;
  white-space: nowrap;
}
.step-item.active { color: #58a6ff; font-weight: 600; }
.step-item.done { color: #3fb950; }
.step-arrow { color: #30363d; font-size: 12px; }

.config-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.config-panel label { display: block; font-size: 12px; color: #8b949e; margin-bottom: 4px; }
.config-panel .form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.config-panel input, .config-panel select {
  flex: 1;
  min-width: 150px;
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.config-panel input:focus, .config-panel select:focus {
  border-color: #58a6ff;
  outline: none;
}
.btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-primary:disabled { background: #21262d; color: #484f58; cursor: not-allowed; }
.btn-secondary { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; }
.btn-secondary:hover { background: #30363d; }

.progress-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.progress-bar-outer {
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #238636, #3fb950);
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-detail { font-size: 13px; color: #8b949e; }

.log-console {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.log-line { padding: 1px 0; }
.log-line.stage { color: #58a6ff; }
.log-line.ok { color: #3fb950; }
.log-line.warn { color: #d29922; }
.log-line.error { color: #f85149; }

.result-panel {
  background: #161b22;
  border: 1px solid #3fb950;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}
.result-panel h3 { color: #3fb950; font-size: 15px; margin: 0 0 8px 0; }
.result-stats { font-size: 13px; color: #c9d1d9; }
.result-stats dt { font-size: 11px; color: #8b949e; margin-top: 8px; }
.result-stats dd { margin: 0; }

/* === Selection Dialog === */
.select-panel {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.select-list { display: flex; flex-direction: column; gap: 8px; }
.select-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.select-item:hover { border-color: #58a6ff; background: #1c2333; }
.select-name { font-size: 14px; font-weight: 600; color: #f0f6fc; }
.select-meta { font-size: 11px; color: #8b949e; }
.select-count { font-size: 11px; color: #8b949e; }

/* === Back link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8b949e;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
}
.back-link:hover { color: #58a6ff; }

/* === Contacts Page === */
#contacts-app {
  display: flex;
  height: calc(100vh - 48px);
  overflow: hidden;
}
#contacts-sidebar {
  width: 320px;
  min-width: 320px;
  background: #161b22;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
}
#contacts-detail {
  flex: 1;
  overflow-y: auto;
  background: #0d1117;
}

.contacts-search-bar {
  padding: 12px;
  border-bottom: 1px solid #30363d;
}
.contacts-search-bar input {
  width: 100%;
  padding: 8px 12px;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.contacts-search-bar input:focus {
  border-color: #1f6feb;
}

.contacts-tabs {
  display: flex;
  border-bottom: 1px solid #30363d;
}
.contacts-tab {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b949e;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.contacts-tab:hover { color: #c9d1d9; }
.contacts-tab.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.addr-section-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #58a6ff;
  background: #161b22;
  position: sticky;
  top: 0;
  z-index: 1;
}

.addr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 1px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.addr-item:hover { background: #1c2333; }
.addr-item.active { background: #1c2333; border: 1px solid rgba(31,111,235,0.33); }

.addr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
  background: #21262d;
}

.addr-item-info {
  flex: 1;
  min-width: 0;
}
.addr-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #c9d1d9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.addr-item-sub {
  font-size: 11px;
  color: #8b949e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.addr-msg-badge {
  font-size: 10px;
  color: #8b949e;
  background: #21262d;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.contacts-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #21262d;
  background: #0d1117;
  position: sticky;
  bottom: 0;
}
.pagination-info {
  font-size: 11px;
  color: #8b949e;
}
.pagination-btns {
  display: flex;
  gap: 2px;
}
.pagination-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.pagination-btn:hover:not(:disabled) { background: #30363d; }
.pagination-btn:disabled { opacity: 0.35; cursor: default; }

/* Detail panel */
.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #484f58;
}
.placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.detail-content {
  padding: 24px;
  max-width: 400px;
}
.detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #21262d;
  margin-bottom: 8px;
}
.detail-name {
  font-size: 18px;
  font-weight: 600;
  color: #f0f6fc;
  margin: 8px 0 4px;
  text-align: center;
}
.detail-divider {
  border: none;
  border-top: 1px solid #21262d;
  margin: 16px 0;
}
.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid #161b22;
}
.detail-label {
  color: #8b949e;
  font-size: 12px;
  flex-shrink: 0;
  margin-right: 16px;
}

/* ===== Cleanup Page ===== */
#cleanup-app { display: flex; flex-direction: column; height: calc(100vh - 48px); }
#cleanup-topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #30363d; background: #161b22; }
#cleanup-topbar .cleanup-summary { font-size: 14px; color: #c9d1d9; }
#cleanup-topbar .cleanup-summary span { margin-right: 24px; }
#cleanup-filters { display: flex; gap: 24px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #30363d; background: #161b22; flex-wrap: wrap; }
#cleanup-filters .filter-group { display: flex; align-items: center; gap: 8px; }
#cleanup-filters .filter-label { font-size: 12px; color: #8b949e; }
#cleanup-filters .filter-select { padding: 6px 10px; background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 4px; font-size: 12px; }
#cleanup-filters .filter-select:focus { border-color: #1f6feb; }
#cleanup-filters .filter-date { padding: 6px 10px; background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 4px; font-size: 12px; }
#cleanup-filters .filter-check { font-size: 12px; color: #8b949e; display: flex; align-items: center; gap: 4px; cursor: pointer; }

#cleanup-main { display: flex; flex: 1; overflow: hidden; }
#cleanup-sidebar { width: 360px; min-width: 360px; border-right: 1px solid #30363d; display: flex; flex-direction: column; background: #0d1117; }
#cleanup-detail { flex: 1; overflow-y: auto; padding: 24px; }

.cleanup-sidebar-header { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #30363d; font-size: 12px; color: #8b949e; }
.cleanup-sidebar-header .filter-check { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.cleanup-search-input { width: 100%; padding: 6px 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 12px; outline: none; box-sizing: border-box; }
.cleanup-search-input:focus { border-color: #1f6feb; }
.cleanup-search-input::placeholder { color: #8b949e; }
.cleanup-list { flex: 1; overflow-y: auto; padding: 4px; }

.cleanup-chat-item { padding: 10px 12px; margin: 2px 0; border-radius: 6px; cursor: pointer; transition: background 0.15s; border: 1px solid transparent; }
.cleanup-chat-item:hover { background: #1c2333; }
.cleanup-chat-item.selected { background: #1c2333; border-color: rgba(31,111,235,0.33); }
.cleanup-chat-top { display: flex; align-items: center; gap: 8px; }
.cleanup-chat-cb { flex-shrink: 0; cursor: pointer; }
.cleanup-chat-info { flex: 1; min-width: 0; }
.cleanup-chat-name { font-size: 13px; font-weight: 600; color: #c9d1d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.cleanup-chat-meta { font-size: 11px; color: #8b949e; margin-top: 2px; }
.cleanup-chat-size { font-size: 13px; font-weight: 700; color: #f0883e; white-space: nowrap; flex-shrink: 0; }
.cleanup-bar-track { height: 4px; background: #21262d; border-radius: 2px; margin-top: 6px; display: flex; overflow: hidden; }
.cleanup-bar-seg { height: 100%; }
.cleanup-bar-img { background: #569cd6; }
.cleanup-bar-vid { background: #e94560; }
.cleanup-bar-file { background: #56d364; }

/* Cleanup detail panel */
.cleanup-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.cleanup-detail-header h3 { font-size: 18px; color: #c9d1d9; margin: 0; }
.cleanup-detail-stats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cleanup-stat-row { display: flex; justify-content: space-between; padding: 8px 12px; background: #161b22; border-radius: 6px; font-size: 13px; }
.cleanup-stat-label { color: #8b949e; }
.cleanup-chat-id { margin-top: 24px; }
.cleanup-chat-id code { font-size: 12px; color: #484f58; word-break: break-all; }

/* Cleanup bottombar */
#cleanup-bottombar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #30363d; background: #161b22; }
#cleanup-bottombar-text { font-size: 14px; color: #c9d1d9; }

/* Cleanup modal */
#cleanup-modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 1000; }
#cleanup-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 1001; }
.cleanup-modal-box { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 32px; max-width: 560px; width: 90%; max-height: 80vh; overflow-y: auto; }
.cleanup-modal-box h3 { margin: 0 0 16px 0; font-size: 18px; }
.cleanup-modal-stats { display: flex; gap: 16px; margin: 16px 0; }
.cleanup-stat { text-align: center; padding: 12px 16px; background: #0d1117; border-radius: 8px; flex: 1; font-size: 12px; color: #8b949e; }
.cleanup-stat-num { display: block; font-size: 20px; font-weight: 700; color: #f0883e; margin-bottom: 4px; }
.cleanup-file-list { max-height: 200px; overflow-y: auto; margin: 12px 0; }
.cleanup-file-item { font-size: 11px; color: #8b949e; padding: 4px 0; border-bottom: 1px solid #21262d; }
.cleanup-file-more { font-size: 11px; color: #8b949e; padding: 8px 0; font-style: italic; }
.cleanup-modal-btns { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.cleanup-delete-input { width: 100%; padding: 10px 14px; background: #0d1117; color: #f85149; border: 2px solid #f85149; border-radius: 6px; font-size: 16px; text-align: center; margin: 12px 0; outline: none; font-family: monospace; letter-spacing: 4px; }
.cleanup-modal-errors { margin-top: 16px; padding: 12px; background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.3); border-radius: 6px; font-size: 12px; color: #f85149; max-height: 120px; overflow-y: auto; }

/* Button variants */
.btn { padding: 8px 16px; border: 1px solid #30363d; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.btn-primary { background: #1f6feb; color: white; border-color: #1f6feb; }
.btn-primary:hover { background: #388bfd; }
.btn-primary:disabled { background: #21262d; color: #484f58; border-color: #30363d; cursor: not-allowed; }
.btn-secondary { background: #21262d; color: #c9d1d9; }
.btn-secondary:hover { background: #30363d; }
.btn-danger { background: #da3633; color: white; border-color: #da3633; }
.btn-danger:hover { background: #f85149; }
.btn-danger:disabled { background: #21262d; color: #484f58; border-color: #30363d; cursor: not-allowed; }
