:root {
  --bg-main: #0b0f19;
  --bg-panel: #111827;
  --bg-card: #161f33;
  --bg-card-hover: #1d2842;
  --bg-input: #0f172a;
  --border: #243049;
  --border-light: #334155;
  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --douyin: #fe2c55;
  --douyin-bg: rgba(254, 44, 85, 0.14);
  --bilibili: #00aeec;
  --bilibili-bg: rgba(0, 174, 236, 0.14);
  --green: #10b981;
  --amber: #f59e0b;
  --purple: #a855f7;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: 14px;
}

/* 顶部导航栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 60px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.env-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.env-badge.cloud {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.nav-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 4px;
}

.nav-tab {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--accent);
  color: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.queue-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* 主体双栏布局 */
.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: calc(100vh - 60px);
}

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plat-pills {
  display: flex;
  gap: 6px;
}

.pill-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn.active {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.account-item.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
}

.acc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.acc-avatar-all {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.acc-meta {
  flex: 1;
  min-width: 0;
}

.acc-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.acc-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plat-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}

.plat-tag.douyin {
  background: var(--douyin-bg);
  color: #ff6b88;
  border: 1px solid rgba(254, 44, 85, 0.35);
}

.plat-tag.bilibili {
  background: var(--bilibili-bg);
  color: #38bdf8;
  border: 1px solid rgba(0, 174, 236, 0.35);
}

.plat-tag.xiaohongshu {
  background: rgba(255, 36, 66, 0.16);
  color: #ff5c74;
  border: 1px solid rgba(255, 36, 66, 0.4);
}

.acc-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 主内容区 */
.main-content {
  padding: 20px 24px 48px;
  min-width: 0;
}

.account-banner {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.banner-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.banner-info h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.banner-bio {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
  max-width: 680px;
}

.banner-stats {
  display: flex;
  gap: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.banner-stats strong {
  color: var(--text-main);
  font-size: 14px;
}

/* 筛选工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.search-box {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.select-ctrl {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
}

.result-count {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* 作品卡片网格 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: #475569;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: #090d16;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-wrap.vertical {
  aspect-ratio: 16 / 12;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}

.post-card:hover .cover-img {
  transform: scale(1.03);
}

.cover-badges-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.badge-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
}

.badge.top {
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
}

.badge.local-ok {
  background: rgba(16, 185, 129, 0.88);
  color: #fff;
}

.badge.note {
  background: rgba(168, 85, 247, 0.88);
  color: #fff;
}

.cover-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 10px 7px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #e2e8f0;
}

.card-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-height: 22px;
  overflow: hidden;
}

.tag-chip {
  font-size: 11px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.comment-pill {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.comment-pill .q-highlight {
  color: #fbbf24;
  font-weight: 600;
}

.orig-link-btn {
  font-size: 12px;
  color: #60a5fa;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.12);
}

.orig-link-btn:hover {
  background: rgba(59, 130, 246, 0.25);
}

.article-link-btn {
  font-size: 12px;
  color: #c084fc;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(168, 85, 247, 0.14);
}

.article-link-btn:hover {
  background: rgba(168, 85, 247, 0.28);
}

/* 明细表格视图 */
.posts-table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.posts-table th,
.posts-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.posts-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: rgba(15, 23, 42, 0.6);
  white-space: nowrap;
}

.posts-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

/* 全局评论挖掘视图 */
.filter-chips-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-filter {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chip-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  flex-wrap: wrap;
}

.c-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.c-badge.pinned {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.c-badge.author {
  background: rgba(254, 44, 85, 0.2);
  color: #fb7185;
}

.c-badge.question {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.c-badge.ip {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-weight: 400;
}

.comment-text {
  font-size: 14px;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-source-post {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* 详情弹窗 Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: min(1180px, 96vw);
  height: min(860px, 92vh);
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 420px 1fr;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

.modal-media-col {
  background: #050811;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow-y: auto;
}

.modal-video {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  background: #000;
}

.online-preview-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.online-preview-card img {
  max-width: 100%;
  max-height: 54vh;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.modal-info-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}

.modal-stats-strip {
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.modal-subtabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--border);
}

.subtab-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}

.subtab-btn.active {
  color: #60a5fa;
  border-bottom-color: var(--accent);
}

.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.replies-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.65);
  border-left: 2px solid var(--border-light);
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #3b82f6;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  display: none;
  font-size: 13px;
}

.toast.show {
  display: block;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .modal-dialog {
    grid-template-columns: 1fr;
    height: 94vh;
    overflow-y: auto;
  }
  .modal-media-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 44vh;
  }
}
