:root {
  --bg: #f5f7fb;
  --bg-1: #f6f2ed;
  --bg-2: #e7edf2;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --brand: #2f6bff;
  --accent: #ffb703;
  --line: #e5e7eb;
  --ok: #16a34a;
  --warn: #f59e0b;
}

html[data-theme='dark'],
body[data-theme='dark'] {
  --bg: #1b2028;
  --bg-1: #141922;
  --bg-2: #202836;
  --card: #252d38;
  --text: #eef2f7;
  --muted: #bac3cf;
  --brand: #f3f4f6;
  --line: #3e4757;
}

* {
  box-sizing: border-box;
}

/* Mobile tap/focus polish: avoid square flash on touch while keeping keyboard focus visible */
a,
button,
.btn,
.mode-btn,
.search button,
.hot-search-more,
.hot-search-keyword,
.media-detail-deep-link a,
.floating-action-btn {
  -webkit-tap-highlight-color: transparent;
}

a:focus,
button:focus,
.btn:focus,
.mode-btn:focus,
.search button:focus,
.hot-search-more:focus,
.hot-search-keyword:focus,
.media-detail-deep-link a:focus,
.floating-action-btn:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.mode-btn:focus-visible,
.search button:focus-visible,
.hot-search-more:focus-visible,
.hot-search-keyword:focus-visible,
.media-detail-deep-link a:focus-visible,
.floating-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.28);
}

.is-hidden {
  display: none !important;
}

.seo-hot-links {
  position: absolute;
  left: -99999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

html,
body {
  min-height: 100%;
}

body {
  color-scheme: light;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 183, 3, 0.2), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(47, 107, 255, 0.18), transparent 45%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

html[data-theme='dark'],
body[data-theme='dark'] {
  color-scheme: dark;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 183, 3, 0.12), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(47, 107, 255, 0.14), transparent 48%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 72px 16px 16px;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(245, 247, 251, 0.52);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.site-header-brand {
  color: #0f172a;
  text-decoration: none;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.3px;
}

body[data-theme='dark'] .site-header {
  border-bottom-color: rgba(71, 85, 105, 0.7);
  background: rgba(27, 32, 40, 0.48);
}

body[data-theme='dark'] .site-header-brand {
  color: #f1f5f9;
}

.hero {
  padding: 0 2px 0;
  animation: rise-in 0.45s ease both;
}

.hero-brand {
  text-align: center;
  margin: 0 0 8px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  padding-bottom: 8px;
}

.brand-link:hover,
.brand-link:active {
  color: inherit;
}

.brand-main {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #0f172a 0%, #1677ff 52%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-link::after {
  content: '';
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, #60a5fa 50%, transparent 100%);
  position: absolute;
  bottom: 0;
}

body[data-theme='dark'] .brand-main {
  background: linear-gradient(95deg, #f8fafc 0%, #dbeafe 42%, #93c5fd 72%, #bfdbfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.search-history-inline {
  max-width: 700px;
  margin: 8px auto 0;
}

.search-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.search-history-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.search-history-title {
  font-size: 12px;
  color: var(--muted);
}

.search-history-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.search-history-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.search-history-clear.is-active {
  color: var(--brand);
}

.search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 58px;
  overflow: hidden;
}

.search-history-list.is-expanded {
  max-height: none;
}

.search-history-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.15;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-history-item-remove {
  font-size: 12px;
  color: var(--muted);
  line-height: 1;
}

.search-history-item.is-editing {
  border-color: rgba(239, 68, 68, 0.22);
}

body[data-theme='dark'] .search-history-item {
  background: rgba(37, 45, 56, 0.88);
}

.hero-h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
}

.hero-h1.hero-h1-brand {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #0f172a 0%, #1677ff 52%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  padding-bottom: 10px;
}

.hero-h1.hero-h1-brand::after {
  content: '';
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, #60a5fa 50%, transparent 100%);
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

body[data-theme='dark'] .hero-h1.hero-h1-brand {
  background: linear-gradient(95deg, #f8fafc 0%, #dbeafe 42%, #93c5fd 72%, #bfdbfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body[data-theme='dark'] .search {
  border-color: rgba(100, 116, 139, 0.32);
  background: #2a3340;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

body[data-theme='dark'] .search input {
  color: #eef2f7;
}

body[data-theme='dark'] .search input::placeholder {
  color: #b8c1cd;
}

.search:focus-within {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search input {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 16px;
  outline: none;
  background: transparent;
}

.search input:focus {
  box-shadow: none;
}

.search button {
  border: 0;
  border-radius: 10px;
  padding: 0;
  font-size: 16px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  width: 36px;
  min-width: 36px;
  height: 36px;
  box-shadow: none;
  transition: background 0.16s ease, opacity 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search button:hover {
  background: #1d4ed8;
}

.search button:active {
  background: #1e40af;
}

.search button .bi {
  font-size: 15px;
  line-height: 1;
}

.search button.loading {
  position: relative;
  color: rgba(255, 255, 255, 0.9);
  cursor: not-allowed;
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
}

.search button.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.media-candidate-suggest {
  max-width: 700px;
  margin: 6px auto 0;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.media-candidate-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-candidate-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.media-candidate-suggest-item:hover,
.media-candidate-suggest-item:active,
.media-candidate-suggest-item.is-active {
  background: rgba(47, 107, 255, 0.08);
  transform: translateY(-1px);
}

.media-candidate-suggest-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.media-candidate-suggest-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.media-candidate-suggest-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.media-candidate-suggest-arrow {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 14px;
}

body[data-theme='dark'] .media-candidate-suggest {
  border-color: rgba(100, 116, 139, 0.32);
  background: rgba(37, 45, 56, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}

body[data-theme='dark'] .media-candidate-suggest-item:hover,
body[data-theme='dark'] .media-candidate-suggest-item:active,
body[data-theme='dark'] .media-candidate-suggest-item.is-active {
  background: rgba(96, 165, 250, 0.14);
}

body[data-theme='dark'] .media-candidate-suggest-arrow {
  color: #cbd5e1;
}

.floating-actions {
  position: fixed;
  right: 14px;
  bottom: 84px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-action-btn {
  min-width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.floating-action-btn .bi {
  font-size: 16px;
}

.floating-action-btn:hover,
.floating-action-btn:active {
  color: var(--brand);
  border-color: var(--brand);
}

body[data-theme='dark'] .floating-action-btn {
  background: rgba(37, 45, 56, 0.95);
  border-color: #475569;
  color: #e2e8f0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.search-tip {
  margin-top: 10px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.search-tip-ai-suggest {
  max-width: 700px;
  margin: 12px auto 0;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
  border-radius: 10px;
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #bfdbfe;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-tip-ai-suggest::before {
  content: 'Tips';
  display: inline-block;
  margin-right: 8px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 22px;
  color: #1d4ed8;
  background: #dbeafe;
}

.search-tip-ai-text {
  min-width: 0;
  flex: 1;
}

.search-tip-ai-btn {
  border: 1px solid #60a5fa;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.search-tip-ai-btn:hover {
  background: #1d4ed8;
}

.search-keyword-suggest {
  margin: 12px 0 0;
}

.search-keyword-suggest-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.search-keyword-suggest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-keyword-suggest-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}

.search-keyword-suggest-item:hover,
.search-keyword-suggest-item:active {
  border-color: rgba(47, 107, 255, 0.4);
  color: var(--brand);
}

body[data-theme='dark'] .search-tip-ai-suggest {
  color: #dbeafe;
  background: #1e2d47;
  border-color: #36527f;
}

body[data-theme='dark'] .search-tip-ai-suggest::before {
  color: #bfdbfe;
  background: #2a436c;
}

body[data-theme='dark'] .search-tip-ai-btn {
  border-color: #93c5fd;
  background: #1d4ed8;
  color: #fff;
}

body[data-theme='dark'] .search-tip-ai-btn:hover {
  background: #1e40af;
}

body[data-theme='dark'] .search-keyword-suggest-item {
  background: rgba(37, 45, 56, 0.88);
}

.ai-progress-line {
  margin-top: 6px;
  border-radius: 8px;
  border: 1px dashed #bfdbfe;
  background: #f8fbff;
  padding: 6px 8px;
  font-size: 12px;
  color: #1d4ed8;
}

.ai-progress-viewport {
  height: 18px;
  overflow: hidden;
}

.ai-progress-track {
  display: block;
}

.ai-progress-item {
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.ai-progress-item.fade-out {
  opacity: 0;
}

.ai-progress-item.fade-in {
  opacity: 0;
}

.search-mode {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.mode-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  line-height: 30px;
  padding: 0 10px;
  font-weight: 500;
  cursor: pointer;
}

#modeAiBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 28px;
}

#modeAiBtn .bi {
  font-size: 12px;
  line-height: 1;
}

.mode-btn-theme {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-btn-theme .bi {
  font-size: 17px;
}

body[data-theme='dark'] .mode-btn {
  border-color: #4b5563;
  background: #1d2430;
  color: #e2e8f0;
}

body[data-theme='dark'] .mode-btn-theme {
  border-color: transparent;
  background: transparent;
}

.site-header-theme-btn {
  color: #475569;
  padding: 2px;
}

.site-header-theme-btn:hover {
  color: #0f172a;
}

body[data-theme='dark'] .site-header-theme-btn {
  color: #cbd5e1;
}

body[data-theme='dark'] .site-header-theme-btn:hover {
  color: #f8fafc;
}

.page-theme-toggle-btn {
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
}

.page-theme-toggle-btn:hover {
  color: #0f172a;
}

body[data-theme='dark'] .page-theme-toggle-btn {
  color: #cbd5e1;
}

body[data-theme='dark'] .page-theme-toggle-btn:hover {
  color: #f8fafc;
}

.mode-btn.active {
  border-color: var(--brand);
  color: var(--brand);
  background: #eff6ff;
}

body[data-theme='dark'] .mode-btn.active {
  border-color: #60a5fa;
  background: #1f3552;
  color: #dbeafe;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35) inset;
}

body[data-theme='dark'] #modeAiBtn:hover {
  border-color: #6b7280;
  background: #283242;
}

body[data-theme='dark'] #modeAiBtn.active:hover {
  border-color: #93c5fd;
  background: #284469;
}

/* Strong contrast for AI mode button in dark theme */
html[data-theme='dark'] #modeAiBtn,
body[data-theme='dark'] #modeAiBtn {
  border-color: #64748b;
  background: #111827;
  color: #c7d2fe;
  font-weight: 600;
}

html[data-theme='dark'] #modeAiBtn.active,
body[data-theme='dark'] #modeAiBtn.active {
  border-color: #93c5fd;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.45), 0 6px 14px rgba(29, 78, 216, 0.35);
}

.meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.hot-search-card {
  margin-top: 4px;
  width: 100%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  animation: rise-in 0.55s ease both;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.hot-search-header {
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 10px;
}

.hot-search-title {
  font-size: 16px;
  font-weight: 700;
}

.hot-title-icon {
  margin-right: 6px;
}

.hot-search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hot-search-tabs {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: hidden;
  padding-bottom: 0;
}

.hot-search-tabs::-webkit-scrollbar {
  height: 0;
}

.hot-search-tab {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 11px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hot-search-tab.active {
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
  background: #f8fbff;
}

.hot-search-panels {
  margin-top: 12px;
}

.hot-search-subtabs-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.hot-search-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}

.hot-search-subtab {
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  word-break: keep-all;
  flex: 0 0 auto;
}

.hot-search-subtab.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.hot-search-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  display: none;
  opacity: 0;
  transform: translateY(6px);
}

.hot-search-panel.active {
  display: block;
  animation: hot-tab-panel-in 0.24s ease both;
}

.hot-search-subpanel {
  display: none;
}

.hot-search-subpanel.active {
  display: block;
  animation: hot-tab-panel-in 0.2s ease both;
}

.hot-search-panel .hot-search-list {
  margin-top: 0;
}

.hot-search-panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}

.hot-search-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.hot-search-more {
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 4px 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: none;
}

.hot-search-more:hover,
.hot-search-more:active {
  transform: none;
  box-shadow: none;
  opacity: 0.85;
}

.hot-search-more .bi {
  font-size: 14px;
  line-height: 1;
}

.hot-search-more-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.hot-search-loading {
  padding: 12px 4px 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 640px) {
  .hot-search-subtabs {
    width: 100%;
  }
}

.hot-search-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.hot-search-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body[data-theme='dark'] .hot-search-panel {
  background: transparent;
}

body[data-theme='dark'] .hot-search-tab {
  border-color: rgba(100, 116, 139, 0.22);
  background: rgba(22, 29, 40, 0.5);
  color: #cbd5e1;
}

body[data-theme='dark'] .hot-search-tab.active {
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
}

body[data-theme='dark'] .hot-search-subtab {
  color: #cbd5e1;
}

body[data-theme='dark'] .hot-search-subtab.active {
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
}

body[data-theme='dark'] .hot-search-panel-title {
  color: #e2e8f0;
}

body[data-theme='dark'] .hot-search-more {
  color: #93c5fd;
}

@keyframes hot-tab-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hot-search-rank {
  min-width: 20px;
  margin-top: 0;
  text-align: left;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: #64748b;
}

.hot-search-item:nth-child(1) .hot-search-rank {
  color: #ef4444;
}

.hot-search-item:nth-child(2) .hot-search-rank {
  color: #f97316;
}

.hot-search-item:nth-child(3) .hot-search-rank {
  color: #eab308;
}

.hot-search-keyword {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.hot-search-keyword:hover,
.hot-search-keyword:active {
  color: var(--brand);
}

@media (max-width: 420px) {
  .hot-search-tab {
    font-size: 11px;
    padding: 7px 9px;
  }

  .hot-search-item {
    gap: 8px;
    padding: 8px;
  }

  #modeAiBtn {
    padding: 0 8px;
  }
}

.list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.card-hidden {
  display: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  animation: card-in 0.35s ease both;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

body[data-theme='dark'] .badge {
  background: #252d3a;
  color: #cfd8e3;
}

body[data-theme='dark'] .tag {
  background: #252d3a;
  color: #d1d5db;
}

body[data-theme='dark'] .btn {
  background: #151a22;
  border-color: #394455;
  color: #e5e7eb;
}

body[data-theme='dark'] .actions .btn:not(.primary) {
  color: #f8fafc;
}

.list .card:nth-child(1) {
  animation-delay: 0.03s;
}

.list .card:nth-child(2) {
  animation-delay: 0.07s;
}

.list .card:nth-child(3) {
  animation-delay: 0.11s;
}

.list .card:nth-child(4) {
  animation-delay: 0.15s;
}

.list .card:nth-child(5) {
  animation-delay: 0.19s;
}

.list .card:nth-child(n + 6) {
  animation-delay: 0.22s;
}

.skeleton-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.skeleton-line.long {
  width: 86%;
}

.skeleton-line.mid {
  width: 62%;
}

.skeleton-line.short {
  width: 38%;
  margin-bottom: 0;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title {
  font-size: 16px;
  font-weight: 600;
  word-break: break-word;
}

.record-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.record-extra {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  line-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eff6ff;
  color: #2563eb;
}

.badge.warn {
  background: #fff7ed;
  color: var(--warn);
}

.tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags-inline {
  margin-top: 0;
}

.tag {
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  padding: 3px 8px;
}

.tag:nth-child(6n + 1) {
  background: #eff6ff;
  color: #1d4ed8;
}

.tag:nth-child(6n + 2) {
  background: #ecfeff;
  color: #0e7490;
}

.tag:nth-child(6n + 3) {
  background: #f0fdf4;
  color: #166534;
}

.tag:nth-child(6n + 4) {
  background: #fff7ed;
  color: #9a3412;
}

.tag:nth-child(6n + 5) {
  background: #faf5ff;
  color: #7e22ce;
}

.tag:nth-child(6n + 6) {
  background: #fef2f2;
  color: #b91c1c;
}

.media-cover-wrap {
  width: 33%;
  min-width: 108px;
  max-width: 138px;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  border: 1px solid #dbe5f4;
}

.media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.media-main {
  min-width: 0;
  flex: 1;
}

.media-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.media-pills {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-pill {
  font-size: 12px;
  line-height: 18px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2ff;
  color: #1e40af;
}

.media-intro {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.media-intro.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-intro.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.media-intro-toggle {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.media-meta {
  margin-top: 8px;
}

.media-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.55;
  font-size: 12px;
}

.media-meta-row + .media-meta-row {
  margin-top: 4px;
}

.media-meta-label {
  color: #64748b;
  min-width: 30px;
  flex: 0 0 30px;
}

.media-meta-value {
  color: #1f2937;
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.media-meta-value-actors {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-summary {
  margin-top: 14px;
}

.media-summary-card {
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.actions {
  margin-top: 7px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 9px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon {
  margin-right: 4px;
}

.btn-icon-check-ok {
  color: #16a34a;
}

.btn-icon-check-fail {
  color: #dc2626;
}

.btn.primary {
  border-color: var(--brand);
  color: var(--brand);
}

.actions .btn {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  gap: 5px;
}

.actions .btn .btn-icon {
  margin-right: 2px;
}

.media-detail-resources .actions {
  gap: 8px;
}

.media-detail-resources .actions .btn {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  gap: 6px;
}

.media-detail-resources .actions .btn .btn-icon {
  margin-right: 4px;
}

.title-row .title {
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0;
}

.record-meta-icon {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn-spinner {
  width: 12px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: btn-spin 0.7s linear infinite;
  flex: 0 0 12px;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.structure {
  margin-top: 10px;
  overflow: hidden;
  touch-action: pan-y;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

.structure-tree-area {
  max-height: 280px;
  touch-action: pan-y;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

body[data-theme='dark'] .structure,
body[data-theme='dark'] .structure-tree-area {
  color: #f8fafc;
}

body[data-theme='dark'] .tree li {
  color: #e5e7eb;
}

body[data-theme='dark'] .node-toggle {
  color: #9ca3af;
}

body[data-theme='dark'] .media-cover-wrap {
  border-color: #3a4250;
  background: #1a2230;
}

body[data-theme='dark'] .media-pill {
  background: #233146;
  color: #dbeafe;
}

body[data-theme='dark'] .media-intro {
  color: #c9d2df;
}

body[data-theme='dark'] .media-intro-toggle {
  color: #93c5fd;
}

body[data-theme='dark'] .media-meta-label {
  color: #94a3b8;
}

body[data-theme='dark'] .media-meta-value {
  color: #e2e8f0;
}

.tree,
.tree ul {
  list-style: none;
  padding-left: 16px;
  margin: 6px 0;
}

.tree li {
  margin: 4px 0;
  color: #334155;
}

.node-label {
  display: inline-flex;
  touch-action: pan-y;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.tree li.has-children > .node-label {
  cursor: pointer;
}

.node-toggle {
  border: 0;
  background: transparent;
  color: #94a3b8;
  width: 14px;
  height: 14px;
  padding: 0;
  flex: 0 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.node-toggle .bi {
  font-size: 11px;
  transition: transform 0.16s ease;
}

.node-toggle.is-collapsed .bi {
  transform: rotate(-90deg);
}

.node-toggle-spacer {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.node-label > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.node-icon {
  display: inline-flex;
  width: 16px;
  justify-content: center;
  align-items: center;
}

.node-icon i {
  font-size: 14px;
}

.node-icon-folder {
  color: #faad14;
}

.node-icon-media {
  color: #1677ff;
}

.node-icon-file {
  color: #6b7280;
}

.empty,
.error {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: var(--muted);
}

.error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.empty,
.error {
  animation: fade-in 0.28s ease both;
}

.loading {
  color: var(--brand);
  font-size: 13px;
  text-align: left;
}

.structure .loading {
  padding-left: 36px;
}

.more-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.site-disclaimer {
  margin: auto 2px 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

body[data-theme='dark'] .site-disclaimer {
  border-top-color: #2f3645;
}

.site-disclaimer p {
  margin: 4px 0;
}

.topic-header {
  margin-top: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:active {
  text-decoration: underline;
}

.topic-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.topic-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.topic-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.topic-filter {
  margin-top: 10px;
  padding: 10px;
}

.topic-filter-hot {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-bottom: 18px;
}

.topic-search-hot-form {
  max-width: 700px;
  margin: 0 auto;
}

.topic-search-form {
  max-width: 700px;
  margin: 0 auto;
}

.topic-search-form input {
  min-width: 0;
}

.topic-sort-form {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.topic-sort-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.topic-sort-btn.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.topic-card {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.topic-card-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topic-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.topic-card-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-meta-tag {
  font-size: 12px;
  line-height: 18px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2ff;
  color: #1e40af;
}

.topic-card-intro {
  margin-top: 8px;
  font-size: 12px;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-updated {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.topic-card-actions {
  margin-top: 10px;
}

.topic-cover-wrap {
  position: relative;
  width: 98px;
  min-width: 98px;
  max-width: 98px;
  height: 147px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e5e7eb;
}

.topic-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  background: linear-gradient(120deg, #f1f5f9 25%, #e2e8f0 38%, #f1f5f9 55%);
  background-size: 180% 100%;
  animation: topic-cover-skeleton 1.6s ease-in-out infinite;
}

.topic-cover-wrap.is-placeholder {
  border-style: dashed;
}

@keyframes topic-cover-skeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

.topic-pager {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-pager-text {
  font-size: 12px;
  color: var(--muted);
}

.topic-page-btn {
  min-width: 34px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  text-decoration: none;
  background: var(--card);
  font-size: 12px;
  line-height: 1.2;
}

.topic-page-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 700;
}

body[data-theme='dark'] .topic-card-intro {
  color: #c9d2df;
}

body[data-theme='dark'] .topic-meta-tag {
  background: #233146;
  color: #dbeafe;
}

body[data-theme='dark'] .topic-cover-wrap {
  border-color: #3a4250;
  background: #1a2230;
}

body[data-theme='dark'] .topic-cover-placeholder {
  color: #cbd5e1;
  background: linear-gradient(120deg, #1f2937 25%, #334155 38%, #1f2937 55%);
  background-size: 180% 100%;
}

body[data-theme='dark'] .topic-search-form input,
body[data-theme='dark'] .topic-sort-btn {
  background: #151a22;
  border-color: #394455;
  color: #e5e7eb;
}

body[data-theme='dark'] .topic-sort-btn.active {
  background: #223047;
  border-color: #5b7fb4;
  color: #dbeafe;
}

body[data-theme='dark'] .topic-page-btn {
  background: #151a22;
  border-color: #394455;
  color: #e5e7eb;
}

body[data-theme='dark'] .topic-page-btn.active {
  background: #223047;
  border-color: #5b7fb4;
  color: #dbeafe;
}

@media (min-width: 768px) and (max-width: 1180px) {
  .topic-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }

  .topic-cover-wrap {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    height: 168px;
  }
}

.media-detail-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.media-detail-breadcrumb {
  margin-top: 10px;
}

.media-detail-deep-link {
  margin-top: 12px;
  margin-bottom: 6px;
}

.media-detail-deep-link a {
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
}

.media-detail-deep-link a:hover,
.media-detail-deep-link a:active {
  border-color: #93c5fd;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.media-detail-deep-link a .bi {
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 768px) and (max-width: 1180px) {
  .media-detail-deep-link a {
    font-size: 18px;
    min-height: 54px;
    padding: 14px 16px;
    gap: 10px;
  }

  .media-detail-deep-link a .bi {
    font-size: 20px;
  }
}

.media-detail-deep-link a.is-disabled {
  opacity: 0.68;
  pointer-events: none;
}

body[data-theme='dark'] .media-detail-deep-link a {
  color: #dbeafe;
  background: linear-gradient(135deg, #1e3a5f 0%, #1d2f46 100%);
  border-color: #335372;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

body[data-theme='dark'] .media-detail-deep-link a:hover,
body[data-theme='dark'] .media-detail-deep-link a:active {
  border-color: #44678d;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.34);
}

.media-ai-chain-panel {
  margin: 10px 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
  padding: 10px 12px;
}

.media-ai-chain-header {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.media-ai-chain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-ai-chain-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #1e293b;
  animation: media-ai-step-in 0.2s ease both;
}

.media-ai-chain-status {
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.media-ai-chain-status.status-running::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  animation: spin 0.8s linear infinite;
}

.media-ai-chain-status.status-done {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
}

.media-ai-chain-status.status-done::before {
  content: '✓';
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.media-ai-chain-status.status-failed {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}

.media-ai-chain-status.status-failed::before {
  content: '!';
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.media-ai-chain-item.status-running .media-ai-chain-text {
  color: #1d4ed8;
}

.media-ai-chain-item.status-failed .media-ai-chain-text {
  color: #b91c1c;
}

.media-ai-chain-summary {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #bfdbfe;
  font-size: 12px;
  color: #1e3a8a;
}

.media-ai-chain-summary.status-done {
  color: #166534;
}

.media-ai-chain-summary.status-failed {
  color: #b91c1c;
}

body[data-theme='dark'] .media-ai-chain-panel {
  border-color: #335372;
  background: linear-gradient(135deg, #1e3a5f 0%, #1d2f46 100%);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

body[data-theme='dark'] .media-ai-chain-header {
  color: #bfdbfe;
}

body[data-theme='dark'] .media-ai-chain-item {
  color: #e2e8f0;
}

body[data-theme='dark'] .media-ai-chain-status {
  border-color: #475569;
  background: #0f172a;
}

body[data-theme='dark'] .media-ai-chain-status.status-running::before {
  border-color: #44678d;
  border-top-color: #93c5fd;
}

body[data-theme='dark'] .media-ai-chain-status.status-done {
  border-color: #22c55e;
  background: #14532d;
  color: #86efac;
}

body[data-theme='dark'] .media-ai-chain-status.status-failed {
  border-color: #ef4444;
  background: #7f1d1d;
  color: #fecaca;
}

body[data-theme='dark'] .media-ai-chain-item.status-running .media-ai-chain-text {
  color: #bfdbfe;
}

body[data-theme='dark'] .media-ai-chain-item.status-failed .media-ai-chain-text {
  color: #fecaca;
}

body[data-theme='dark'] .media-ai-chain-summary {
  border-top-color: #44678d;
  color: #bfdbfe;
}

body[data-theme='dark'] .media-ai-chain-summary.status-done {
  color: #86efac;
}

body[data-theme='dark'] .media-ai-chain-summary.status-failed {
  color: #fecaca;
}

.media-detail-resources {
  margin-top: 14px;
}

.media-recommend-section {
  margin-top: 18px;
}

.media-recommend-panel {
  padding: 10px;
}

.media-recommend-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.media-recommend-card {
  flex: 0 0 128px;
  min-width: 128px;
  border-radius: 10px;
  background: transparent;
  scroll-snap-align: start;
}

.media-recommend-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 162px;
  padding: 2px;
  color: inherit;
  text-decoration: none;
  align-items: center;
  text-align: center;
}

.media-recommend-cover-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-recommend-cover-wrap.is-placeholder {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(31, 111, 235, 0.08));
}

.media-recommend-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-recommend-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: var(--muted);
}

.media-recommend-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
}

.media-recommend-rating {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  line-height: 1;
  color: var(--primary);
  background: rgba(31, 111, 235, 0.08);
  border-radius: 999px;
  padding: 4px 7px;
}

body[data-theme='dark'] .media-recommend-card {
  background: transparent;
}

.media-recommend-rating.is-empty {
  color: var(--muted);
  background: rgba(107, 114, 128, 0.08);
}

.resource-mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.resource-mini-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--card);
}

.resource-mini-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.resource-mini-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.resource-mini-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes media-ai-step-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}


@media (max-width: 640px) {
  .container {
    padding: 68px 12px 12px;
  }

  .site-header-inner {
    padding: 10px 12px;
    min-height: 52px;
  }

  .site-header-brand {
    font-size: 19px;
  }

  .hero {
    padding: 0 0 0;
    border-radius: 12px;
  }

  .brand-main {
    font-size: 30px;
  }

  .hero-h1 {
    font-size: 24px;
  }

  .search input {
    font-size: 15px;
  }

  .search button {
    padding: 0 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
