/*
  ChangoPaperQuery 标题栏样式
  版本: 20260121_v2
*/

/* 隐藏主站导航与天气横幅，释放空间 */
.navbar {
  display: none !important;
}

.weather-banner,
#weatherBanner {
  display: none !important;
}

footer,
#mainFooter,
.site-footer {
  display: none !important;
}

body {
  padding-top: 0 !important;
}

main.container.my-4 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.container.mt-3 {
  margin-top: 0 !important;
}

.paper-query-page {
  padding-top: 0 !important;
}

/* 标题栏布局 */
.cpq-header {
  width: 100%;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1000;
  overflow: visible;
}

.cpq-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.7;
  pointer-events: none;
}

.cpq-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  opacity: 0.9;
  pointer-events: none;
}

.cpq-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.cpq-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.cpq-header-title h2 {
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cpq-header-subtitle {
  font-size: 0.7rem;
  opacity: 0.85;
  white-space: nowrap;
}

.cpq-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cpq-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.2rem 0.35rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 主页按钮 */
.cpq-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.cpq-home-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}

/* 主题切换按钮 */
.cpq-mode-toggle {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  flex-shrink: 0;
}

.cpq-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 1);
}

html.mode-dark #cpqCartFloatingBtn .small,
body.dark-mode #cpqCartFloatingBtn .small,
html.mode-scifi #cpqCartFloatingBtn .small,
body.scifi-mode #cpqCartFloatingBtn .small,
body.mode-scifi #cpqCartFloatingBtn .small {
  color: #0f172a;
}

html.mode-scifi #cpqCartFloatingCount,
body.scifi-mode #cpqCartFloatingCount,
body.mode-scifi #cpqCartFloatingCount {
  color: #0f172a !important;
}

/* 用户区 */
.cpq-user-area {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.25rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.cpq-user-info {
  position: relative;
  display: flex;
  align-items: center;
}

.cpq-user-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cpq-user-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.cpq-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.cpq-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 0.5rem;
  display: none;
  z-index: 12000;
}

.cpq-user-dropdown-inner {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cpq-user-info:hover .cpq-user-dropdown {
  display: block;
}

.cpq-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  color: #cbd5f5;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.cpq-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
}

.cpq-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0.3rem 0;
}

.cpq-auth-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cpq-auth-link {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cpq-auth-link.login {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  background: transparent;
}

.cpq-auth-link.login:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cpq-auth-link.register {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.cpq-auth-link.register:hover {
  background: #ffffff;
}

/* 三主题适配 */
html.mode-light .cpq-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.92));
  color: #0f172a;
  border-bottom-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

html.mode-light .cpq-header::before {
  background: linear-gradient(120deg, rgba(214, 232, 255, 0.45), rgba(255, 235, 214, 0.35));
}

html.mode-light .cpq-header::after {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(14, 165, 233, 0.35), rgba(251, 191, 36, 0.25));
}

html.mode-light .cpq-header-title h2,
html.mode-light .cpq-header-title h2 i {
  color: #1f2937 !important;
  text-shadow: none;
}

html.mode-light .cpq-header-title,
html.mode-light .cpq-header-actions,
html.mode-light .cpq-user-area {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

html.mode-light .cpq-home-btn,
html.mode-light .cpq-mode-toggle {
  background: rgba(0, 0, 0, 0.06);
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.12);
}

html.mode-light .cpq-home-btn:hover,
html.mode-light .cpq-mode-toggle:hover {
  background: rgba(0, 0, 0, 0.12);
}

html.mode-light .cpq-user-btn {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
  color: #334155;
}

html.mode-light .cpq-auth-link.login {
  border-color: rgba(0, 0, 0, 0.2);
  color: #334155;
}

html.mode-light .cpq-auth-link.register {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(0, 0, 0, 0.85);
  color: #ffffff;
}

html.mode-dark .cpq-header {
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.98), rgba(10, 14, 22, 0.92));
  color: #e2e8f0;
  border-bottom-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 6px 18px rgba(5, 8, 16, 0.6);
}

html.mode-scifi .cpq-header {
  background: linear-gradient(180deg, rgba(7, 22, 34, 0.98), rgba(5, 12, 20, 0.92));
  color: #00f3ff;
  border-bottom-color: rgba(0, 243, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 243, 255, 0.25);
}

html.mode-dark .cpq-header::before {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.18), rgba(148, 163, 184, 0.1));
}

html.mode-dark .cpq-header::after {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.45), rgba(14, 116, 144, 0.25));
}

html.mode-dark .cpq-header-title,
html.mode-dark .cpq-header-actions,
html.mode-dark .cpq-user-area {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.2);
}

html.mode-scifi .cpq-header::before {
  background: radial-gradient(circle at 20% 10%, rgba(0, 243, 255, 0.2), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(0, 160, 200, 0.2), transparent 55%);
}

html.mode-scifi .cpq-header::after {
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.2), rgba(0, 243, 255, 0.6), rgba(0, 160, 200, 0.25));
}

html.mode-scifi .cpq-header-title,
html.mode-scifi .cpq-header-actions,
html.mode-scifi .cpq-user-area {
  background: rgba(0, 243, 255, 0.08);
  border-color: rgba(0, 243, 255, 0.25);
}

/* 响应式 */
@media (max-width: 768px) {
  .cpq-header {
    padding: 0.6rem 0.75rem;
  }

  .cpq-header-title h2 {
    font-size: 1rem;
  }

  .cpq-header-subtitle {
    font-size: 0.65rem;
  }

  .cpq-home-btn,
  .cpq-mode-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}
