* {
  box-sizing: border-box;
}

:root {
  --bg-dark-1: #0a1929;
  --bg-dark-2: #0f2a43;
  --bg-dark-3: #123a5c;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --gold: #f5b942;
  --danger: #ff6b6b;
  --card-bg: #ffffff;
  --text-dark: #1c2a3a;
  --text-muted: #64748b;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 45%, var(--bg-dark-3) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  position: relative;
  overflow-x: hidden;
}

/* 背景装饰光斑 */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.18), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(99, 102, 241, 0.18), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(245, 185, 66, 0.10), transparent 45%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  color: #fff;
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-block;
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--accent);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 30px;
  line-height: 1.5;
  margin: 0 0 16px;
  font-weight: 700;
}

.hero-title .highlight {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  max-width: 620px;
  margin: 0 auto 24px;
}

.hero-subtitle strong {
  color: var(--gold);
  font-weight: 600;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.feature-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 18px;
  backdrop-filter: blur(6px);
}

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 10px 10px 10px 20px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.search-icon {
  font-size: 18px;
  opacity: 0.6;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 12px 6px;
  background: transparent;
  color: var(--text-dark);
}

.search-box input::placeholder {
  color: #a3adb8;
}

.search-box button {
  border: none;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.search-box button:disabled {
  background: #b5bcc7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status {
  color: #fff;
  text-align: center;
  margin: 20px 0;
  min-height: 20px;
  font-size: 14px;
}

.status.error {
  color: #ffb3b3;
}

/* ---------- 结果列表 ---------- */
.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-item {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--accent);
  transition: background 0.15s, transform 0.15s;
}

.result-item:hover {
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  word-break: break-all;
  color: #fff;
  line-height: 1.45;
}

.result-highlight {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.download-btn {
  flex-shrink: 0;
  border: none;
  background: linear-gradient(90deg, #ff9a56, #ff6b6b);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

/* ---------- 页脚 ---------- */
.page-footer {
  text-align: center;
  margin-top: 32px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.page-footer strong {
  color: var(--gold);
}

/* ---------- 登录页面 ---------- */
.login-body {
  display: flex;
}

.login-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  padding: 44px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.login-logo {
  font-size: 40px;
  margin-bottom: 6px;
}

.login-box h1 {
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text-dark);
}

.brand-dot {
  margin-left: 2px;
}

.login-box .subtitle {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
}

.login-box .subtitle a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
}

.login-box .subtitle a:hover {
  text-decoration: underline;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.login-features span {
  background: #f0f4f8;
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
}

.login-box input {
  width: 100%;
  border: 1px solid #e4e8ee;
  outline: none;
  font-size: 15px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #f8f9fb;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}

.login-box input:focus {
  border-color: var(--accent-2);
  background: #fff;
}

.login-box button {
  width: 100%;
  border: none;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.login-box button:disabled {
  background: #b5bcc7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-box .status {
  color: var(--danger);
  min-height: 18px;
  margin-top: 12px;
  font-size: 13px;
}

/* ---------- 管理员用户数据表格 ---------- */
.link-btn {
  background: none !important;
  border: none;
  color: var(--accent-2);
  font-size: 12px;
  cursor: pointer;
  padding: 0 !important;
  margin-left: 8px;
  width: auto !important;
  text-decoration: underline;
}

.link-btn:hover {
  box-shadow: none !important;
  transform: none !important;
}

.users-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  margin-top: 6px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.users-table th,
.users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eef1f5;
  color: var(--text-dark);
  white-space: nowrap;
}

.users-table thead th {
  position: sticky;
  top: 0;
  background: #f8f9fb;
  color: var(--text-muted);
  font-weight: 600;
  z-index: 1;
}

.users-table tbody tr:hover {
  background: #f5f8fc;
}

.users-table .credits-cell {
  font-weight: 700;
  color: var(--accent-2);
}

.users-table .time-cell {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- 顶部导航栏 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(10, 25, 41, 0.55);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mini {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.credits-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 7px 10px 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.credits-icon {
  color: var(--gold);
}

#creditsLabel {
  color: var(--gold);
  font-weight: 700;
}

.recharge-btn {
  border: none;
  background: linear-gradient(90deg, var(--gold), #ff9a56);
  color: #1c2a3a;
  padding: 6px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s;
}

.recharge-btn:hover {
  transform: translateY(-1px);
}

.user-menu {
  position: relative;
}

.user-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.caret {
  font-size: 10px;
  opacity: 0.7;
}

.user-dropdown {
  position: absolute;
  top: 46px;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-width: 150px;
}

.user-dropdown button {
  display: block;
  width: 100%;
  border: none;
  background: #fff;
  color: var(--text-dark);
  padding: 13px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.user-dropdown button:hover {
  background: #f0f4f8;
}

.hidden {
  display: none !important;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 25, 41, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 30px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.modal-box h3 {
  margin: 0 0 20px;
  text-align: center;
  color: var(--text-dark);
  font-size: 18px;
}

.modal-box input {
  width: 100%;
  border: 1px solid #e4e8ee;
  outline: none;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8f9fb;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.modal-box input:focus {
  border-color: var(--accent-2);
  background: #fff;
}

.modal-box .status {
  min-height: 18px;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--accent-2);
  text-align: center;
}

.modal-box .status.error {
  color: var(--danger);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  border: none;
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff;
  transition: transform 0.15s;
}

.modal-actions button:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #eef1f5 !important;
  color: var(--text-muted) !important;
}

.btn-secondary:hover {
  background: #dfe4ea !important;
}

.recharge-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0 0;
}

.recharge-hint strong {
  color: var(--accent-2);
}

/* ---------- 热门搜索词 ---------- */
.hot-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hot-tags-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.hot-tag {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.hot-tag:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateY(-1px);
}

/* ---------- 内容面板（搜索结果 / 热门研报）---------- */
.panel {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px 20px 8px;
  backdrop-filter: blur(6px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.panel-title {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.panel-action {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.panel-action:hover {
  background: rgba(255, 107, 107, 0.25);
}
.hot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: hot;
}

/* 折叠状态：限制高度，仅露出约 5 条，可滚动查看，视觉上更紧凑 */
.hot-list.collapsed {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.hot-toggle {
  display: block;
  width: 100%;
  margin: 14px 0 8px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.hot-toggle:hover {
  background: rgba(34, 211, 238, 0.15);
}

/* 热门研报：紧凑的半透明深色“列表行”风格，与搜索结果的白色大卡片明显区分 */
.hot-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}

.hot-item:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
}

.hot-rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.1);
}

.hot-rank.top {
  color: #1c2a3a;
  background: linear-gradient(90deg, var(--gold), #ff9a56);
}

.hot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hot-item-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-date {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* 热门研报下载按钮：改为轻量文字链接风格，与搜索结果的实色大按钮区分 */
.hot-item .download-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--accent);
  padding: 5px 12px;
  font-size: 12px;
  box-shadow: none;
}

.hot-item .download-btn:hover {
  background: rgba(34, 211, 238, 0.15);
  transform: none;
  box-shadow: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand-mini {
    font-size: 14px;
  }

  .credits-badge {
    font-size: 12px;
    padding: 6px 8px 6px 12px;
  }

  .user-btn span:not(.caret) {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .container {
    padding: 130px 14px 40px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .search-box {
    flex-wrap: wrap;
  }

  .result-item {
    flex-direction: column;
    align-items: stretch;
  }
  .download-btn {
    width: 100%;
  }

  .hot-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
