/* ==========================================================================
   比优特“公司答疑” —— 搜索条（新增模块）
   文件：assets/css/search2.css
   说明：
     1. 结构：[查询条件选择器] + [输入区] + [搜索按钮]，日期面板下拉于搜索条下方；
     2. PC 端（>=1200px）置于顶部欢迎语条右侧，宽度 380px，与面包屑、滚动欢迎语同行；
     3. 移动端（<1200px）置于“留言规定”标题上方，通栏宽度，左右间距与 .com-main 内边距一致；
     4. 主色沿用站点 #ea5532，边框 #dcdcdc，圆角 4px，与全站表单控件保持一致；
     5. 全局 global2.css 中 input placeholder 默认为白色，此处显式覆盖为灰色 #999。
   ========================================================================== */

/* ------------------------------ 公共结构 ------------------------------ */
.search {
  --search-btn-w: 64px;
  --search-primary: #ea5532;
  --search-primary-dark: #d54726;
  --search-border: #dcdcdc;

  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 40px;
  background: #fff;
  border: 1px solid var(--search-border);
  border-radius: 4px;
  /* 下拉菜单 / 日期面板需溢出显示，故不裁剪；圆角交由内部按钮处理 */
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search:focus-within {
  border-color: var(--search-primary);
  box-shadow: 0 0 0 3px rgba(234, 85, 50, 0.12);
}

/* 面板展开时抬高层级，避免被下方内容覆盖 */
.search.is-open {
  z-index: 30;
}

/* ------------------------------ 查询条件选择器 ------------------------------ */
.search-picker {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}

.search-picker-btn {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 9px 0 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  color: #555;
  white-space: nowrap;
  background: #fafafa;
  border: 0;
  border-right: 1px solid #ececec;
  border-radius: 3px 0 0 3px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.search-picker-btn:hover {
  color: var(--search-primary);
  background: #f4f4f4;
}

.search-picker-arrow {
  width: 9px;
  height: 6px;
  margin-left: 5px;
  fill: none;
  stroke: #9a9a9a;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.search-picker.open .search-picker-btn {
  color: var(--search-primary);
}

.search-picker.open .search-picker-arrow {
  stroke: var(--search-primary);
  transform: rotate(180deg);
}

.search-picker-menu {
  display: none;
  position: absolute;
  z-index: 40;
  left: 0;
  top: calc(100% + 6px);
  min-width: 112px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.search-picker.open .search-picker-menu {
  display: block;
}

.search-picker-item {
  padding: 8px 18px;
  font-size: 13px;
  line-height: 20px;
  color: #555;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.search-picker-item:hover {
  color: var(--search-primary);
  background: #f7f7f7;
}

.search-picker-item.is-active,
.search-picker-item.is-active:hover {
  color: #fff;
  background: var(--search-primary);
}

/* ------------------------------ 输入区 ------------------------------ */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

/* 放大镜 / 日历图标（内联 SVG，不依赖图片资源） */
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  pointer-events: none;
  fill: none;
  stroke: #9a9a9a;
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke 0.25s ease;
}

.search-icon.icon-cal {
  display: none;
  stroke-width: 1.7;
}

.search:focus-within .search-icon {
  stroke: var(--search-primary);
}

.search.is-date .icon-search {
  display: none;
}

.search.is-date .icon-cal {
  display: block;
}

/* 输入框 / 日期框 */
.search-input,
.search-date {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 32px;
  font-family: inherit;
  font-size: 14px;
  line-height: normal;
  color: #333;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.search-date {
  display: none;
  font-size: 13px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.search.is-date .search-input {
  display: none;
}

.search.is-date .search-date {
  display: block;
}

.search-input::placeholder,
.search-date::placeholder {
  color: #999999;
}

/* 兼容 WebKit / Edge 旧内核，覆盖 global2.css 的白色默认值 */
.search-input::-webkit-input-placeholder,
.search-date::-webkit-input-placeholder {
  color: #999999;
}

.search-input::-ms-input-placeholder,
.search-date::-ms-input-placeholder {
  color: #999999;
}

.search-input::-moz-placeholder,
.search-date::-moz-placeholder {
  color: #999999;
  opacity: 1;
}

/* 清除按钮 */
.search-clear {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  font-size: 0;
  line-height: 0;
  border-radius: 50%;
  background: #c9c9c9;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-clear::before,
.search-clear::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 1.5px;
  background: #fff;
}

.search-clear::before {
  transform: rotate(45deg);
}

.search-clear::after {
  transform: rotate(-45deg);
}

.search-clear:hover {
  background: var(--search-primary);
}

.search.has-value .search-clear {
  display: block;
}

.search.has-value .search-input,
.search.has-value .search-date {
  padding-right: 26px;
}

/* 提交按钮 */
.search-btn {
  flex: 0 0 var(--search-btn-w);
  width: var(--search-btn-w);
  height: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  letter-spacing: 1px;
  background: var(--search-primary);
  border: 0;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-btn:hover {
  background: var(--search-primary-dark);
}

.search-btn:active {
  background: #bd3d20;
}

/* ------------------------------ 日期选择器面板 ------------------------------ */
.search-cal {
  position: absolute;
  z-index: 50;
  left: 0;
  top: calc(100% + 8px);
  width: 302px;
  padding: 8px 10px 0;
  font-size: 13px;
  color: #333;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.search-cal[hidden] {
  display: none;
}

/* 面板头部：年月切换 */
.cal-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  border-bottom: 1px solid #f0f0f0;
}

.cal-nav {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  color: #999;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.cal-nav:hover {
  color: var(--search-primary);
  background: #f5f5f5;
}

.cal-title {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

/* 星期行 */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 6px 0 2px;
  font-size: 12px;
  line-height: 26px;
  color: #999;
  text-align: center;
}

.cal-week i {
  font-style: normal;
}

/* 日期网格 */
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  color: #333;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.cal-day:hover {
  color: var(--search-primary);
  background: #f2f2f2;
}

.cal-day.is-out {
  color: #c8c8c8;
}

.cal-day.is-today {
  color: var(--search-primary);
  font-weight: bold;
}

.cal-day.is-inrange,
.cal-day.is-inrange:hover {
  color: var(--search-primary);
  background: rgba(234, 85, 50, 0.1);
  border-radius: 0;
}

.cal-day.is-start,
.cal-day.is-end,
.cal-day.is-start:hover,
.cal-day.is-end:hover {
  color: #fff;
  background: var(--search-primary);
  border-radius: 3px;
}

/* 面板底部：区间说明 + 操作按钮 */
.cal-foot {
  padding: 8px 0 10px;
  margin-top: 6px;
  border-top: 1px solid #f0f0f0;
}

.cal-range {
  padding: 0 2px 8px;
  font-size: 12px;
  line-height: 18px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cal-btn {
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  color: #666;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cal-btn:hover {
  color: var(--search-primary);
  border-color: var(--search-primary);
}

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

.cal-btn-primary:hover {
  color: #fff;
  background: var(--search-primary-dark);
  border-color: var(--search-primary-dark);
}

/* ------------------------------ PC 端 ------------------------------ */
.search-pc {
  display: none;
}

@media (min-width: 1200px) {
  .search-pc {
    display: flex;
    flex: 0 0 400px;
    width: 400px;
    height: 40px;
    margin-left: 30px;
  }
}

/* ------------------------------ 移动端 ------------------------------ */
.search-mb {
  display: flex;
  height: 38px;
  margin: 0 0 10px;
}

.search-mb .search-picker-btn {
  padding: 0 7px 0 10px;
  font-size: 13px;
}

.search-mb .search-picker-arrow {
  margin-left: 4px;
}

.search-mb .search-icon {
  left: 10px;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
}

.search-mb .search-input,
.search-mb .search-date {
  padding-left: 30px;
  font-size: 13px;
}

.search-mb.search {
  --search-btn-w: 58px;
}

.search-mb .search-btn {
  font-size: 13px;
  letter-spacing: 0;
}

.search-mb .search-cal {
  width: 340px;
  max-width: 100%;
}

/* 小屏（<=360px）：压缩面板尺寸，保证日历网格不换行 */
@media (max-width: 360px) {
  .search-picker-btn {
    padding: 0 6px 0 8px;
    font-size: 12px;
  }

  .search-picker-arrow {
    margin-left: 3px;
  }

  .search-mb .search-input,
  .search-mb .search-date {
    padding-left: 27px;
    font-size: 12px;
  }

  /* 极窄屏改用短标签（模糊 / 日期 / 楼号），把宽度让给输入内容 */
  .search-picker-text {
    font-size: 0;
  }

  .search-picker-text::after {
    content: attr(data-short);
    font-size: 12px;
  }

  .search-cal {
    padding: 6px 6px 0;
  }

  .cal-day {
    height: 30px;
    font-size: 12px;
  }
}

/* ------------------------------ 结果提示 / 空状态 ------------------------------ */
.search-tip {
  display: none;
  margin: 0 0 15px;
  padding: 9px 15px;
  font-size: 13px;
  line-height: 20px;
  color: #666;
  background: #fff;
  border-left: 3px solid #ea5532;
}

.search-tip.show {
  display: block;
}

.search-tip b {
  padding: 0 2px;
  font-weight: bold;
  color: #ea5532;
}

.search-tip .tip-reset {
  margin-left: 10px;
  color: #ea5532;
  text-decoration: underline;
  cursor: pointer;
}

.message-line {
  scroll-margin-top: 20px;
}

.search-empty {
  display: none;
  padding: 40px 15px;
  font-size: 14px;
  line-height: 24px;
  color: #888;
  text-align: center;
  background: #fff;
}

.search-empty.show {
  display: block;
}

.search-empty .empty-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  fill: none;
  stroke: #d0d0d0;
  stroke-width: 1.6;
}

/* 关键词高亮 */
.message-list mark.kw {
  padding: 0 1px;
  color: #ea5532;
  background: rgba(234, 85, 50, 0.14);
  border-radius: 2px;
}

@media (min-width: 1200px) {
  .search-tip {
    padding: 10px 15px;
    font-size: 14px;
  }

  .search-empty {
    padding: 60px 15px;
  }
}

/* ------------------------------ 兜底：页脚吸底 ------------------------------
   检索后列表条数减少，页面高度可能不足一屏，
   原样式下会在页脚下方露出 body 深色底，故让主体撑满并让页脚贴底。
   -------------------------------------------------------------------------- */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrapper > article {
  flex: 1 0 auto;
}

.cal-day.is-disabled{
    color:#cccccc;
    background:#f7f7f7;
    cursor:not-allowed;
}
.cal-day.is-disabled:hover{
    background:#f7f7f7;
}
