/* 全站在线咨询：侧边悬浮按钮 + 弹窗（与 request.js 配套使用） */

/* ===== 侧边悬浮按钮 ===== */
.oc-float {
  position: fixed;
  right: 0;
  bottom: 10px;
  z-index: 101;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.oc-float-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.oc-float:hover .oc-float-menu,
.oc-float.is-open .oc-float-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.oc-float-item,
.oc-float-main {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 10px;
  border: none;
  border-radius: 6px 0 0 6px;
  background: #19549b;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  transition: background 0.2s;
}
.oc-float-main {
  height: 48px;
}
.oc-float-item:hover,
.oc-float-item:focus-visible,
.oc-float-main:hover,
.oc-float-main:focus-visible {
  background: #0073c1;
}
.oc-float-item:active,
.oc-float-main:active {
  transform: scale(0.98);
}
.oc-float-icon {
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.oc-float-icon svg {
  display: block;
  width: 30px;
  height: 30px;
}
.oc-float-text {
  margin-left: 5px;
}

/* 触屏设备无 hover，改为点击主按钮展开 */
@media (hover: none) {
  .oc-float:hover .oc-float-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
  }
  .oc-float.is-open .oc-float-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
}

/* ===== 弹窗 ===== */
.oc-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 20, 36, 0.55);
}
.oc-overlay.is-open {
  display: flex;
}
.oc-modal {
  width: 720px;
  max-width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: ocPop 0.25s ease;
}
@keyframes ocPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.oc-header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  background: #19549b;
  color: #fff;
}
.oc-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
}
.oc-close {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.oc-close:hover {
  background: rgba(255, 255, 255, 0.15);
}
.oc-tabs {
  flex: 0 0 auto;
  display: flex;
  border-bottom: 1px solid #e6ebf2;
  background: #f7f9fc;
}
.oc-tab {
  position: relative;
  flex: 1;
  height: 46px;
  border: none;
  background: none;
  color: #55637a;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.oc-tab + .oc-tab {
  border-left: 1px solid #e6ebf2;
}
.oc-tab.is-active {
  background: #fff;
  color: #19549b;
  font-weight: 600;
}
.oc-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 48px;
  height: 2px;
  margin-left: -24px;
  background: #19549b;
}
.oc-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.oc-view {
  display: none;
  flex-direction: column;
  min-height: 0;
}
.oc-view.is-active {
  display: flex;
}
.oc-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 8px;
}
.oc-tip {
  font-size: 13px;
  color: #8894a6;
}
.oc-tip em {
  font-style: normal;
  font-weight: 600;
  color: #19549b;
}
.oc-ask-btn {
  height: 32px;
  padding: 0 16px;
  border: 1px solid #19549b;
  border-radius: 16px;
  background: #19549b;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.oc-ask-btn:hover {
  background: #0d6fb8;
  border-color: #0d6fb8;
}
.oc-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 20px 10px;
}
.oc-state {
  padding: 48px 0;
  text-align: center;
  color: #94a0b2;
  font-size: 14px;
}
.oc-item {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 0.2s;
}
.oc-item:hover {
  box-shadow: 0 4px 16px rgba(25, 84, 155, 0.08);
}
.oc-q,
.oc-a {
  display: flex;
  gap: 10px;
}
.oc-a {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e8edf5;
}
.oc-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.oc-q .oc-mark {
  background: #19549b;
}
.oc-a .oc-mark {
  background: #2aa15f;
}
.oc-q-main,
.oc-a-main {
  flex: 1;
  min-width: 0;
}
.oc-q-main p,
.oc-a-main p {
  margin: 0;
  color: #303b4d;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}
.oc-meta {
  display: inline-block;
  margin-top: 6px;
  color: #97a2b3;
  font-size: 12px;
}
.oc-pending {
  color: #a3acbb;
  font-style: italic;
}
.oc-pager {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px 16px;
  border-top: 1px solid #f0f3f8;
}
.oc-pager:empty {
  display: none;
}
.oc-page-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #dfe5ee;
  border-radius: 4px;
  background: #fff;
  color: #5a6a80;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.oc-page-btn:hover:not(:disabled):not(.is-active) {
  border-color: #19549b;
  color: #19549b;
}
.oc-page-btn.is-active {
  border-color: #19549b;
  background: #19549b;
  color: #fff;
}
.oc-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== 新增问题表单 ===== */
.oc-form {
  overflow-y: auto;
  padding: 16px 20px 20px;
}
.oc-form-head {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.oc-back {
  padding: 0;
  border: none;
  background: none;
  color: #19549b;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.oc-form-head h4 {
  margin: 0 0 0 auto;
  color: #303b4d;
  font-size: 15px;
  font-weight: 600;
}
.oc-field {
  display: block;
  margin-bottom: 16px;
  color: #55637a;
  font-size: 13px;
}
.oc-field input,
.oc-field textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  color: #303b4d;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.oc-field input:focus,
.oc-field textarea:focus {
  border-color: #19549b;
  box-shadow: 0 0 0 3px rgba(25, 84, 155, 0.1);
}
.oc-field textarea {
  height: 130px;
  line-height: 1.6;
  resize: vertical;
}
.oc-form-actions {
  display: flex;
  gap: 10px;
}
.oc-submit {
  height: 38px;
  padding: 0 26px;
  border: none;
  border-radius: 6px;
  background: #19549b;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.oc-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.oc-cancel {
  height: 38px;
  padding: 0 22px;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  background: #fff;
  color: #55637a;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.oc-no-scroll {
  overflow: hidden;
}

/* request.js 的 toast 目前缺少样式，这里补齐，保证提交反馈可见 */
.reqToast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2000;
  max-width: 80%;
  padding: 10px 18px;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: rgba(20, 30, 45, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

/* ===== 适配 ===== */
@media all and (max-width: 1024px) {
  .oc-float {
    right: 8px;
    bottom: 76px;
  }
  .oc-float-item,
  .oc-float-main {
    width: 112px;
    height: 44px;
    border-radius: 6px;
  }
  .oc-float-main {
    height: 46px;
  }
}

@media all and (max-width: 767px) {
  .oc-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .oc-modal {
    width: 100%;
    max-height: 88vh;
    border-radius: 12px 12px 0 0;
  }
  .oc-header {
    height: 50px;
    padding: 0 16px;
  }
  .oc-header h3 {
    font-size: 16px;
  }
  .oc-tab {
    height: 42px;
    font-size: 13px;
  }
  .oc-toolbar {
    padding: 12px 14px 6px;
  }
  .oc-list {
    padding: 4px 14px 8px;
  }
  .oc-item {
    padding: 12px;
  }
  .oc-q-main p,
  .oc-a-main p {
    font-size: 13px;
  }
  .oc-pager {
    padding: 8px 14px 14px;
  }
  .oc-form {
    padding: 14px 14px 16px;
  }
}
