/* ============================================================
   Search Results Page Styles (Demo)
   ============================================================ */

:root {
  --sd-primary: #0033a0;
  --sd-bg-page: #f4f6f9;
  --sd-bg-card: #ffffff;
  --sd-text-title: #1a1a1a;
  --sd-text-main: #333333;
  --sd-text-muted: #666666;
  --sd-border: #e8e8e8;
  --sd-container: 1400px;
  --sd-radius: 12px;
  --sd-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --sd-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
  --sd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body, html {
  overflow: visible !important;
  background-color: var(--sd-bg-page) !important;
  font-family: var(--sd-font);
}

.search-hero, .search-layout {
  box-sizing: border-box;
}
.search-hero *, .search-layout * {
  box-sizing: border-box;
}

/* ============================================================
   1. Search Hero Area
   ============================================================ */
.search-hero {
  width: 100%;
  background-color: #e8f0fe; /* Light blue accent background */
  padding: 60px 20px 40px;
}

.search-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-bar-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 50px;
  padding: 8px 12px 8px 30px;
  box-shadow: 0 8px 25px rgba(0, 51, 160, 0.08);
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  color: var(--sd-text-title);
  background: transparent;
}
.search-input::placeholder {
  color: #999;
}

.search-btn {
  background: var(--sd-primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}
.search-btn:hover {
  background: #002266;
  transform: scale(1.05);
}
.search-btn .iconfont {
  font-size: 24px;
}

.search-hot-words {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.sh-label {
  color: var(--sd-text-muted);
  font-size: 14px;
}
.sh-tag {
  background: #ffffff;
  color: var(--sd-text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s;
}
.sh-tag:hover, .sh-tag.active {
  background: var(--sd-primary);
  color: #ffffff;
}

/* ============================================================
   2. Main Layout (Sidebar + Content)
   ============================================================ */
.search-layout {
  max-width: var(--sd-container);
  margin: 40px auto 60px;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

/* Sidebar */
.search-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
}

.ss-box {
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  padding: 30px;
  box-shadow: var(--sd-shadow);
}

.ss-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--sd-text-title);
  margin-bottom: 20px;
}

.ss-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ss-item {
  margin-bottom: 8px;
}

.ss-item a {
  display: block;
  padding: 12px 16px;
  color: var(--sd-text-main);
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s;
}

.ss-item a:hover {
  background: #f0f5ff;
  color: var(--sd-primary);
}

.ss-item.is-active a {
  background: #e8f0fe;
  color: var(--sd-primary);
  font-weight: bold;
}

/* Main Content */
.search-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.search-summary-text {
  font-size: 15px;
  color: var(--sd-text-muted);
  margin-bottom: 20px;
}
.search-summary-text strong {
  color: var(--sd-primary);
  margin: 0 4px;
}

.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

/* Result Card */
.sr-card {
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  padding: 30px;
  box-shadow: var(--sd-shadow);
  text-decoration: none;
  display: block;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.sr-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sd-shadow-hover);
  border-color: #d6e4ff;
}

.sr-breadcrumb {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}

.sr-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--sd-text-title);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Highlighted keyword */
.sr-title span {
  color: var(--sd-primary);
}

.sr-desc {
  font-size: 14px;
  color: var(--sd-text-muted);
  line-height: 1.6;
  margin: 0;
  /* 2-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   3. Pagination
   ============================================================ */
.search-pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.std-pagination {
  display: inline-flex;
  gap: 8px;
}

.sp-btn, .sp-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 1px solid var(--sd-border);
  border-radius: 6px;
  color: var(--sd-text-main);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.sp-page:hover:not(.is-active), .sp-btn:hover:not(.disabled) {
  border-color: var(--sd-primary);
  color: var(--sd-primary);
}

.sp-page.is-active {
  background: var(--sd-primary);
  border-color: var(--sd-primary);
  color: #ffffff;
  font-weight: bold;
}

.sp-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9f9f9;
}

@media (max-width: 992px) {
  .search-layout {
    flex-direction: column;
  }
  .search-sidebar {
    width: 100%;
    position: static;
  }
}
/* Checkbox List Styles */
.ss-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ss-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}
.ss-checkbox-label:hover {
  background: #f4f6f9;
}
.ss-checkbox {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--sd-primary);
}
.ss-checkbox-text {
  font-size: 15px;
  color: var(--sd-text-main);
  user-select: none;
}
.ss-count {
  color: #999;
  font-size: 13px;
  margin-left: 4px;
}

/* Empty State Styles */
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  text-align: center;
}
.se-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  opacity: 0.8;
}
.se-title {
  font-size: 20px;
  color: var(--sd-text-title);
  margin-bottom: 12px;
  font-weight: bold;
}
.se-desc {
  font-size: 15px;
  color: var(--sd-text-muted);
  max-width: 480px;
  margin-bottom: 30px;
  line-height: 1.6;
}
.se-btn {
  background: var(--sd-primary);
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 24px;
}
.se-btn:hover {
  background: #002266;
  transform: translateY(-2px);
}
.se-recommend {
  font-size: 14px;
  color: #999;
}
.se-tag {
  color: var(--sd-primary);
  text-decoration: none;
  margin: 0 4px;
}
.se-tag:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Header Navigation Inline Search Bar (Option B - Optimized)
   ========================================================================== */
.head-search-inline {
  display: flex;
  align-items: center;
  margin-left: 54px;
}
.head-search-inline-wrapper {
  position: relative;
  width: 255px;
  height: 38px;
}
.head-search-inline input {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box !important;
  height: 38px !important;
  padding: 0 16px 0 38px !important;
  border: 1px solid rgba(2, 45, 132, 0.08) !important;
  border-radius: 19px !important;
  font-size: 14px !important;
  width: 255px;
  outline: none !important;
  background: rgba(2, 45, 132, 0.03) !important;
  color: #333 !important;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: inset 0 1px 3px rgba(2, 45, 132, 0.03) !important;
  z-index: 2;
}
.head-search-inline input::placeholder {
  color: #999 !important;
  font-size: 13px !important;
  transition: opacity 0.3s ease;
}
.head-search-inline input:hover {
  border-color: rgba(2, 45, 132, 0.2) !important;
  background: rgba(2, 45, 132, 0.05) !important;
}
.head-search-inline input:focus {
  width: 320px !important;
  border-color: #022d84 !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 45, 132, 0.12) !important;
  z-index: 10;
}
.head-search-inline input:focus::placeholder {
  opacity: 0.5;
}
.head-search-inline .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(2, 45, 132, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 3;
  pointer-events: none;
}
.head-search-inline .search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.head-search-inline input:focus + .search-icon {
  color: #022d84;
}

/* 搜索按钮：默认隐藏，仅当输入框获得焦点时显示(:focus-within)。
   点击按钮时 common.js 会阻止输入框失焦，且表单提交时会加 is-searching 类，
   保证按钮在点击、提交和过渡动画期间一直保持显示。 */
.head-search-inline-wrapper button[type="submit"] {
  display: none;
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  padding: 4px 12px;
  background: #005bac;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.head-search-inline-wrapper:focus-within button[type="submit"],
.head-search-inline-wrapper.is-searching button[type="submit"] {
  display: block;
}

/* 导航栏左移优化：缩短股票代码与导航项之间的间隙，并为搜索框右侧扩展腾出空间 */
.yhpc-lebox {
  justify-content: flex-start !important;
}
.yhpc-ribox {
  margin-left: 250px !important;
}

/* 参照 search_demo.html 恢复并对齐 logo 和股票代码样式，防止折行 */
.yhpc-le {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
}
.yhpc-le-ricode {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
.yhpc-le-ricode-tet {
  white-space: nowrap !important;
}


/* ============================================================
   Premium Empty State (Zero-State Anti-Churn)
   ============================================================ */
.search-empty-state {
  background: #ffffff;
  border-radius: var(--sd-radius, 12px);
  box-shadow: 0 4px 24px rgba(0, 20, 50, 0.04);
  padding: 45px 50px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeIn 0.5s ease;
  font-family: var(--sd-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

.ses-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 30px;
}

.ses-icon-wrapper {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe4e4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), 0 4px 10px rgba(209, 35, 42, 0.1);
}

.ses-title-wrap {
  text-align: center;
}

.ses-title-wrap .ses-title-h3 {
  font-size: 22px;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  font-weight: 600;
  line-height: 1.4;
}

.ses-title-wrap .ses-title-h3 strong {
  color: var(--sd-primary, #0033a0);
}

.ses-title-wrap p {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.ses-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0;
  justify-content: center;
}

.ses-trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 51, 160, 0.04);
  border: 1px solid rgba(0, 51, 160, 0.08);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13.5px;
  color: #1e293b;
  font-weight: 500;
  transition: all 0.3s;
}

.ses-trust-badge:hover {
  background: rgba(0, 51, 160, 0.08);
  transform: translateY(-1px);
}

.ses-trust-badge svg {
  color: var(--sd-primary, #0033a0);
  opacity: 0.8;
}

.ses-action-prompt {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  color: #334155;
  background: #f8fafc;
  padding: 18px 24px;
  border-radius: 12px;
  border-left: 4px solid var(--sd-primary, #0033a0);
  text-align: left;
}

.ses-action-icon {
  flex-shrink: 0;
}

.ses-action-text {
  flex: 1;
  line-height: 1.6;
}

.ses-action-text strong {
  color: var(--sd-primary, #0033a0);
  font-size: 17px;
}

.ses-inline-link {
  color: var(--sd-primary, #0033a0);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin: 0 4px;
  transition: color 0.3s;
}

.ses-inline-link:hover {
  color: #d1232a;
}

/* Premium Form Styling */
.pef-container {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  background: #ffffff;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.pef-header {
  margin-bottom: 24px;
}

.pef-header .pef-header-h4 {
  font-size: 18px;
  color: #0f172a;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pef-header .pef-header-h4::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: var(--sd-primary, #0033a0);
  border-radius: 2px;
}

.pef-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pef-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pef-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.pef-label {
  font-size: 13.5px;
  color: #475569;
  font-weight: 500;
}

.pef-req {
  color: #ef4444;
}

.pef-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14.5px;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
}

.pef-input::placeholder {
  color: #94a3b8;
}

.pef-input:focus {
  background: #ffffff;
  border-color: var(--sd-primary, #0033a0);
  box-shadow: 0 0 0 4px rgba(0, 51, 160, 0.1);
}

.pef-textarea {
  resize: vertical;
  min-height: 80px;
}

.pef-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.pef-submit-btn {
  background: linear-gradient(135deg, #0044cc 0%, #002266 100%);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 51, 160, 0.2);
}

.pef-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 51, 160, 0.3);
}

@media (max-width: 992px) {
  .ses-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .ses-title-wrap {
    text-align: center;
  }
  .pef-row {
    grid-template-columns: 1fr;
  }
  .ses-trust-bar {
    justify-content: center;
  }
}

.ses-highlight-text { color: var(--sd-primary, #0033a0); font-weight: 600; }

.pef-2col {
  grid-template-columns: repeat(2, 1fr) !important;
}

.pef-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 20px;
}

.pef-code-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pef-code-img {
  height: 44px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.pef-submit-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.pef-agree-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pef-checkbox {
  width: 14px !important;
  height: 14px !important;
  cursor: pointer;
  accent-color: var(--sd-primary, #0033a0);
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  position: static !important;
  margin: 0 !important;
}

.pef-agree-label {
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
}

.pef-agree-label a {
  color: var(--sd-primary, #0033a0);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pef-agree-label a:hover {
  color: #d1232a;
}

/* SEO H1 Inline Override */
.seo-h1-inline {
  display: inline !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: inherit !important;
  border: none !important;
  color: inherit !important;
}

@media screen and (max-width: 991px) {
  /* 移动端彻底隐藏“按类型搜索”分类侧边栏 */
  .search-sidebar {
    display: none !important;
  }
}

@media screen and (max-width: 991px) {
  /* 为搜索提示语、面包屑、结果描述等添加适宜移动端阅读的 line-height */
  .search-summary-text {
    line-height: 1.6 !important;
  }

  .search-result-list .sr-card .sr-breadcrumb {
    line-height: 1.5 !important;
  }

  .search-result-list .sr-card .sr-title {
    line-height: 1.4 !important;
  }

  .search-result-list .sr-card .sr-desc {
    line-height: 1.6 !important;
  }
}