/* ============================== */
/* 🌟 全局基础样式（纯净无冲突 修复版） */
/* ============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden !important;
  /* 微信禁止字体放大，杜绝文字撑盒 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 微信X5兜底硬件加速，overflow生效 */
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}
/* 全局所有元素强制自动断行，兼容微信X5/ios safari */
* {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-all;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: #f7f8fa;
  line-height: 1.55;
  color: #2c3e50;
  font-weight: 400;
}

/* 原全局h2删除，改用局部类.global-h2，仅给非文章模块使用 */
.global-h2 {
  text-align: center;
  margin: 0 0 24px 0;
  font-weight: 600;
  color: #2c3e50;
  font-size: 20px;
  letter-spacing: 0.2px;
}

textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e5e9f0;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #2c3e50;
}

textarea#mainInput,
.case-textarea {
  font-size: 17px;
  line-height: 1.8;
  min-height: 200px;
  height: 200px;
  padding: 16px 20px;
  overflow-x: hidden;
  overflow-y: hidden;
  resize: none;
  white-space: pre-wrap;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  box-sizing: border-box;
}
textarea:focus {
  border-color: #c9cdd4;
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 205, 212, 0.25);
}

/* ============================== */
/* 🌟 按钮通用基础样式【全局重置浏览器原生button样式】 */
/* ============================== */
button {
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px; /* 强制最小高度，手机压缩不会变矮 */
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: #26619C;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
button span {
  display: inline-block;
  line-height: 1;
  transform: translateY(-1px); /* 统一文字向上微调，修复手机偏下 */
  white-space: normal;
}

.button-group {
  display: flex;
  gap: 25px;
  margin: 24px 0;
  justify-content: center;
}

button:hover {
  background: #2c3e50;
  box-shadow: 0 2px 8px rgba(52, 73, 94, 0.12);
}

button:active {
  transform: translateY(0.5px);
  box-shadow: none;
}

.secondary-btn {
  background: none;
  border: none;
  color: #7f8c8d;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  border-radius: 4px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.secondary-btn:hover {
  color: #34495e;
  background: #f2f3f5;
}

.func-buttons {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  align-items: center;
}

.func-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 6px;
}

.copy-btn {
  background-color: #7E8EA8;
  color: #fff;
}
.copy-btn:hover {
  background-color: #6D7E96;
}
.copy-btn:disabled {
  background-color: #B0B9C8;
  cursor: not-allowed;
  opacity: 0.8;
}

.download-btn {
  background-color: #6E7F9E;
  color: #fff;
}
.download-btn:hover {
  background-color: #5D6E8C;
}
.download-btn:disabled {
  background-color: #B0B9C8;
  cursor: not-allowed;
  opacity: 0.8;
}

/* ============================== */
/* 🌟 Tabs 标签栏【唯一tab-content，无重复覆盖】 */
/* ============================== */
.tab-btn {
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #000000;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 14px;
  margin-bottom: -1px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.tab-btn.active {
  background: #ffffff;
  color: #34495e;
  border-color: #eef2f7 #eef2f7 #ffffff #eef2f7;
}

.tab-btn:hover:not(.active) {
  background: #fafbfc;
  color: #000000;
}

/* 全局唯一控制边框、内边距、高度、文字居中 */
.tab-content {
  min-height: 200px;
  height: auto;
  overflow: visible;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  font-size: 13px;
  display: none;
  text-align: center;
}

.tab-content.initialized {
  display: block;
  visibility: visible;
}

/* ============================== */
/* 🌟 输入区通用样式 */
/* ============================== */
.case-input-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 24px auto;
  position: relative;
  z-index: 1;
}

.textarea-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  width: 100%;
}

#mainInput {
  width: 100%;
  box-sizing: border-box;
}
.word-count {
  text-align: right;
  font-size: 12px;
  color: #999;
}

/* ============================== */
/* 🌟 页面布局容器（核心修复滚动条 + flex换行） */
/* ============================== */
/* 隐藏原版侧边栏 */
.ai-sidebar { display: none; }
.ai-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100vw;
  background: #f7f8fa;
  overflow-x: hidden !important;
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}

/* 左右分栏容器：80%宽度+居中，顶部导航保持全屏 新增flex-wrap:wrap窄屏自动换行 */
.main-row-wrap {
  width: 80%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  padding: 20px 0;
  flex: 1;
  align-items: stretch;
  flex-wrap: wrap; /* 微信窄屏自动上下排列，不会横向撑开 */
}

/* 顶部全局分类导航 弹性布局左右分开（全屏通栏） */
.category-top-nav {
  width: 80%;
  max-width: 1400px;
  margin: 0 auto;
  background: transparent;
  border-bottom: 2px solid #c8cdd2;
  padding: 12px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.nav-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* ========== logo容器样式 ========== */
.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-img {
  width: 40px;
  height: auto;
  display: block;
}
.logo-text {
  color: #000;
  font-size: 22px;
  font-weight: bold;
}
.category-tab {
  padding: 7px 14px;
  background: transparent;
  border: none;
  color: #000;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.category-tab.active {
  background: #f0f0f0;
  color: #000;
}
.category-tab:hover:not(.active) {
  background: #eee;
  color: #000;
}

/* ========== 左侧：咨询区域【flex子元素强制min-width:0 解决微信不肯收缩】 ========== */
.left-article-area {
  flex: 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* 微信flex溢出核心修复 */
  overflow: hidden;
  /* 移除阴影、背景、大内边距等美化属性，交给后加载文章样式 */
  background: transparent;
  box-shadow: none;
}
/* 极简顶部标签，无多余线条图标 */
.list-header-tag {
  font-size: 18px;
  font-weight: 500;
  color: #222;
  align-self: flex-start;
  /* 去掉背景、圆角、边框，纯文字 */
  padding: 0;
  background: transparent;
  border: none;
}
/* 内部列表取消外边框，避免双层边框 */
.article-list-wrap {
  overflow: hidden;
  width: 100%;
}
.article-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #eeeeee;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  min-width: 0;
}
.article-list-item:last-child {
  border-bottom: none;
}
.article-list-item:hover {
  background: #f7f8fa;
}
.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0; /* 文字容器强制可收缩 */
  flex: 1;
}
.item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #666;
}
.item-title {
  font-size: 16px;
  color: #222;
  white-space: normal;
  word-break: break-all;
}
.item-date {
  font-size: 15px;
  color: #999;
}

/* ========== 右侧：工具面板 同样加min-width:0 ========== */
.right-tool-panel {
  flex: 5;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  height: auto;
  position: sticky;
  top: 20px;
  max-height: unset;
  overflow-y: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.tool-panel-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
}
.sticky-top-area { margin-bottom: 12px; width:100%; }
.textarea-box textarea#mainInput {
  width: 100%;
  height: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}
.evidence-upload-area { margin: 10px 0; width:100%; }

/* 上传按钮 完全复刻 #sortBtn 样式，手机文字已修复 + min-height锁定高度 */
.upload-evidence-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
  width: 70%;
  margin: 0 auto;
  padding: 9px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}
.upload-evidence-btn span {
  display: inline-block;
  line-height: 1;
  transform: translateY(-1px); /* 和全局button统一向上微调 */
  white-space: normal;
}
.upload-evidence-btn:hover {
  background: #1d4ed8;
}

.evidence-empty-tip { font-size: 12px; color: #777; margin: 6px 0; }
/* 事件梳理按钮 标准模板 */
.button-group #sortBtn {
  -webkit-appearance: none;
  appearance: none;
  width: 70%;
  margin: 0 auto;
  padding: 9px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  display: grid;
  place-items: center;
}
.button-group #sortBtn span {
  display: inline-block;
  line-height: 1;
  transform: translateY(-1px);
  white-space: normal;
}
.tab-empty-tip { color: #888; font-size: 12px; line-height: 1.5; }

/* ========== 桌面端免责条款（无calc，padding-inline兼容所有浏览器） ========== */
.legal-disclaimer {
  font-size: 11px;
  color: #666;
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
  width: 100%;
  padding-inline: 16px;
}

/* 已删除右侧面板内原来的.page-footer样式 */
/* 隐藏底部原来两个按钮容器 */
.right-tool-panel > div[style*="gap:8px; margin-top:10px;"] {
  display: none !important;
}

/* ============================== */
/* 🌟 全局页面底部备案栏（放在最外层，整页底部） */
/* ============================== */
.page-footer {
  width: 80%;
  max-width: 1400px;
  margin: 30px auto 20px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}
.page-footer a {
  color: #26619C;
  text-decoration: none;
}
.page-footer a:hover {
  text-decoration: underline;
}

/* ============================== */
/* 🌟 弹窗核心修复【垂直水平绝对页面正中，不贴底、不左上角】 */
/* ============================== */
#qrModal,
#miniQrModal,
#downloadModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.38);
  z-index: 9999;
  backdrop-filter: blur(3px);
}
#qrModal.show,
#miniQrModal.show,
#downloadModal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 弹窗盒子：自适应内容方块，无拉伸，内部全部居中 */
#qrModal .modal-box,
#miniQrModal .modal-box-inner,
#downloadModal > div {
  background: #fff;
  border-radius: 18px;
  max-width: 95vw;
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.16);
  width: fit-content;
  height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* 小程序弹窗 固定宽度紧凑方块 */
#miniQrModal .modal-box-inner {
  padding: 36px 30px;
  text-align: center;
  width: 360px;
  transform: scale(0.94);
  transition: transform 0.24s ease;
}
#miniQrModal.show .modal-box-inner {
  transform: scale(1);
}
#miniQrModal .modal-box-inner h4 {
  margin: 0 0 18px;
  color: #1d2b3a;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
#miniQrModal .modal-box-inner img {
  width: 210px;
  height: 210px;
  border-radius: 12px;
  border: 1px solid #e8ebf0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  max-width: 100%;
}
#miniQrModal .modal-box-inner p {
  margin: 20px 0 28px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.75;
}
#closeMiniQr {
  padding: 11px 36px;
  background: #26619C;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.22s ease;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
#closeMiniQr:hover {
  background: #1c4f7f;
  box-shadow: 0 4px 12px rgba(38, 97, 156, 0.25);
}
#closeMiniQr:active {
  transform: translateY(1px);
}

/* 下载弹窗 */
#downloadModal > div {
  background: #fff;
  border-radius: 18px;
  width: 420px;
  max-width: 92vw;
  padding: 28px 24px;
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.16);
  box-sizing: border-box;
}
#downloadModal h3 {
  text-align: center;
  font-size: 17px;
  color: #1d2b3a;
  margin: 0 0 16px;
  font-weight: 600;
}
#downloadModal .download-desc {
  font-size: 14px;
  color: #64748b;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.65;
}
#downloadModal .flex-btn-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}
#downloadModal #closeDownloadModal {
  background: #f2f3f5;
  color: #333;
}
#downloadModal #confirmDownload {
  background: #26619C;
  color: #fff;
}
#downloadModal .download-checkbox-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 20px 0 32px;
  padding: 16px 8px;
}
#downloadModal .download-checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 12px;
}
#downloadModal .download-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 登录二维码弹窗 贴合内容，不长条 */
#qrModal .modal-box {
  padding: 20px 30px;
  position: relative;
  width: fit-content;
  height: fit-content;
}
#qrModal #qrClose {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  cursor: pointer;
}
#wechat_qr_code {
  width: 300px;
  height: 380px;
  margin-bottom: 12px;
}
#qrModal .qr-text {
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* ============================== */
/* 🌟 附件上传 & 缩略图 */
/* ============================== */
.evidence-upload-area {
  margin: 10px 0;
  text-align: center;
  padding: 8px 0;
  width:100%;
}
.evidence-thumb-list {
  display: flex;
  gap: 12px;
  padding: 8px 0 4px 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd #f5f5f5;
  align-items: center;
}
.evidence-thumb-list::-webkit-scrollbar {
  height: 6px;
}
.evidence-thumb-list::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background-color: #ddd;
}
.evidence-thumb-list::-webkit-scrollbar-track {
  background-color: #f5f5f5;
}
.evidence-thumb-item {
  width: 100px;
  height: 100px;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.evidence-thumb-item:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.evidence-thumb-img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  border-radius: 4px;
  background: #f9fafb;
}
.evidence-thumb-name {
  font-size: 12px;
  color: #666666;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 90px;
}
.evidence-thumb-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}
.evidence-thumb-item:hover .evidence-thumb-delete {
  opacity: 1;
}
.pdf-placeholder {
  width: 60px;
  height: 60px;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.evidence-empty-tip {
  color: #999999;
  font-size: 14px;
  text-align: center;
  padding: 0;
  margin: 0;
}

/* 左侧历史案件选中高亮 */
.history-item {
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  transition: background 0.2s;
}
.history-item:hover {
  background: #f5f5f5;
}
.history-item.active {
  background: #1677ff;
  color: white;
}
.history-heading {
    font-size: 15px;
    font-weight: 600;
    margin: 18px 0 12px 0;
    padding-top: 12px;
    color: #222;
    border-top: 1px solid #dddddd;
}
.empty-history {
    font-size: 13px;
    color: #999;
    text-align: center;
    padding: 16px 0;
}
.cube-icon {
    width: 29px;
    height: 29px;
    object-fit: contain;
}
.answer-count-tip {
  font-size: 12px;
  color: #666;
  margin-left: 8px;
}

/* 问答输入框 */
#questionsContainer .answer-input {
  font-size: 15px;
  line-height: 1.55;
  min-height: 42px;
  max-height: 180px;
  padding: 8px 12px;
  height: auto;
  overflow: hidden;
  resize: none;
  border-radius: 6px;
  border: 1px solid #e5e9f0;
  width: 100%;
}
.loading-area {
  padding: 10px 0;
  text-align: center;
  min-height: 20px;
}
.answer-input {
  min-height: 42px;
  height: 42px;
  line-height: 1.2;
  padding: 4px 6px;
  resize: none;
}

/* ============================== */
/* 顶部操作栏、历史下拉输入框 核心修复：输入框跟随面板同步伸缩 */
/* ============================== */
.textarea-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.textarea-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
  width: 100%;
  /* PC禁止自动换行，强制同行 */
  flex-wrap: nowrap;
}
/* 修复：历史输入框取消固定400px，100%自适应父容器同步伸缩 */
.history-combo-wrap {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  position: relative !important;
}
/* 无箭头，左右统一14px内边距，文字完整显示 */
.history-combo-input {
  flex: 1;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  outline: none;
}
.history-combo-input:focus {
  border-color: #2563eb;
}
/* 按钮组禁止压缩，固定右侧不被挤走 */
.action-btn-group {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}
.text-action-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  height: 42px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}
.text-action-btn:hover {
  color: #184bb8;
  background: transparent;
}
.textarea-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================== */
/* 移动端强制修复（放在CSS最底部，优先级最高，覆盖手机样式） */
/* ============================== */
@media only screen and (max-width: 768px) {
  /* 全局主容器宽度铺满手机 */
  .category-top-nav,
  .main-row-wrap,
  .page-footer {
    width: 94%;
  }

  /* 导航上下堆叠，标签自动居中换行 */
  .category-top-nav {
    flex-direction: column;
    gap: 12px;
  }
  .nav-left-group, .nav-right-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .category-tab {
    font-size: 13px;
    padding: 6px 10px;
  }

  /* 左右分栏改为上下堆叠，彻底取消左侧620px固定宽度 */
  .main-row-wrap {
    flex-direction: column;
    padding: 20px 0;
    gap: 16px;
  }
  .left-article-area {
    flex: unset !important;
    width: 100% !important;
  }
  .right-tool-panel {
    position: static;
    width: 100%;
  }

  /* 顶部操作栏换行：历史输入框独占一行，按钮下一行均分 */
  .textarea-top-actions {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .history-combo-wrap {
    flex: 1 1 auto;
    width: 100%;
  }
  .action-btn-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .text-action-btn {
    flex: 1;
    justify-content: center;
  }

  /* 输入框强制16px，防止iOS双击放大，高度加大 */
  textarea#mainInput {
    font-size: 16px;
    min-height: 160px;
  }

  /* 手机端上传、梳理按钮宽度100%，加大触摸区域，文字偏移已统一修复 */
  .upload-evidence-btn,
  .button-group #sortBtn {
    width: 100%;
    min-height: 44px !important; /* 手机端更高一点，触摸友好，锁定高度 */
    padding: 12px 0 !important;
    font-size: 16px !important;
  }

  /* 列表条目内边距缩小适配手机 */
  .article-list-item {
    padding: 14px 16px;
  }

  /* 弹窗宽度手机占94%，不贴边 */
  #downloadModal > div,
  #miniQrModal .modal-box-inner {
    width: 94vw;
    max-width: unset;
  }

  /* 历史下拉浮层100%宽度 */
  .history-dropdown {
    width: 100%;
  }

  /* ========== 手机端免责条款强制锁定缩进，和上方tab对齐 ========== */
  .legal-disclaimer {
    font-size: 11px !important;
    color: #666 !important;
    margin-top: 10px !important;
    line-height: 1.5 !important;
    text-align: center !important;
    width: 100% !important;
    padding-inline: 16px !important;
    max-width: unset !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* 纠纷处理指南板块样式 */
.guide-divider {
  width: 100%;
  height: 1px;
  background: #eee;
  margin: 24px 0 16px;
}
.guide-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.guide-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-group-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  padding-bottom: 4px;
}
.guide-item {
  font-size: 15px;
  color: #333;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.guide-item:hover {
  background: #f0f2f7;
}
.guide-tip {
  font-size: 13px;
  color: #2563eb;
  padding: 6px 10px;
  line-height: 1.6;
}

/* 隐藏指南板块 */
.guide-hide {
  display: none !important;
}

/* 指南跳转链接 */
.article-list-item .item-title-link {
  color: inherit;
  text-decoration: none;
}
.article-list-item .item-title-link:hover {
  color: #4080ff;
}

/* 热门文章无a标签的标题，同步一样hover变色 */
.article-list-item .item-title:hover {
  color: #4080ff;
  cursor: pointer;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  /* 增加点击区域，避免图片遮挡 */
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.brand-logo-wrap:hover {
  background: #eee;
}

/* 固定列表容器高度，页面不塌陷留白 */
#articleListWrap,
#guideListWrap {
  min-height: 320px;
}

/* 初始隐藏所有文章条目，渲染完成再显示，消除闪白 */
#articleListWrap .article-list-item,
#guideListWrap .article-list-item {
  display: none;
}
#articleListWrap.loaded .article-list-item,
#guideListWrap.loaded .article-list-item {
  display: block;
}

/* 左右两栏PC端固定均分宽度，宽度不再自适应拉伸，高度正常自适应 */
.main-row-wrap {
  align-items: flex-start;
}
/* PC左侧固定宽度，不会随文字拉伸 */
.left-article-area {
  flex: none !important;
  width: 620px;
}
/* PC右侧自动填充剩余空间 */
.right-tool-panel {
  flex: 1;
  min-width: 0;
}

/* 修复flex内部长文字撑宽容器（关键） */
.article-list-item {
  width: 100%;
}
.item-left {
  flex: 1;
  min-width: 0;
}
.item-title-link,
.item-title {
  white-space: normal;
  word-break: break-all;
}

#logoWrap {
  cursor: pointer;
}
#logoWrap .logo-img,
#logoWrap .logo-text {
  pointer-events: none;
}

/* 历史下拉条目行、删除按钮样式（唯一标准，清除重复冲突定义） */
.case-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}
.case-item-row:hover {
  background: #f7f8fa;
}
.case-item-row:last-child {
  border-bottom: none;
}
.case-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #333;
}
.case-item-del {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eeeeee;
  border: none;
  color: #666666;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.case-item-del:hover {
  background: #ef4444;
  color: #ffffff;
}

/* 自定义下拉浮层 */
.history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 999;
  display: none;
}
.history-dropdown.show {
  display: block;
}
.empty-history-dropdown {
  padding: 14px;
  text-align: center;
  color: #999;
  font-size: 13px;
}