/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --primary-light: #e8f8f0;
  --bg: #f7f7f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #888888;
  --text-tertiary: #b2b2b2;
  --border: #e8e8e8;
  --divider: #f0f0f0;
  --success: #07c160;
  --danger: #fa5151;
  --warning: #ffa940;
  --info: #10aeff;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --tabbar-height: 56px;
  --navbar-height: 48px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ========== 顶部导航栏（小程序标题栏） ========== */
.navbar {
  background: var(--card-bg);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.navbar-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  display: none;
}

.navbar-back.visible {
  display: block;
}

.navbar-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 8px;
}

/* ========== 内容区域 ========== */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.page {
  display: none;
  padding: 12px;
  padding-bottom: calc(var(--tabbar-height) + 20px);
}

.page.active {
  display: block;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== 底部 TabBar ========== */
.tabbar {
  display: flex;
  height: var(--tabbar-height);
  background: var(--card-bg);
  border-top: 0.5px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  max-width: 600px;
  margin: 0 auto;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.tabbar-item:active {
  opacity: 0.6;
}

.tabbar-icon {
  font-size: 22px;
  line-height: 1;
}

.tabbar-label {
  font-size: 10px;
  color: var(--text-tertiary);
}

.tabbar-item.active .tabbar-label {
  color: var(--primary);
  font-weight: 600;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.card-body {
  padding: 16px;
}

.card-header {
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 0.5px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .icon {
  margin-right: 6px;
}

/* ========== 仪表盘统计卡片 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card .stat-icon {
  font-size: 24px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 微信列表样式 ========== */
.weui-cell {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-bg);
  border-bottom: 0.5px solid var(--divider);
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.weui-cell:active {
  background: var(--divider);
}

.weui-cell:last-child {
  border-bottom: none;
}

.weui-cell__hd {
  flex-shrink: 0;
}

.weui-cell__bd {
  flex: 1;
  min-width: 0;
}

.weui-cell__ft {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.weui-cell__ft .arrow {
  color: var(--text-tertiary);
  font-size: 16px;
}

.weui-label {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.weui-label-secondary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========== 企业卡片 ========== */
.enterprise-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}

.enterprise-card:active {
  transform: scale(0.98);
}

.enterprise-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.enterprise-info {
  flex: 1;
  min-width: 0;
}

.enterprise-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.enterprise-meta {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-arrow {
  color: var(--text-tertiary);
  font-size: 18px;
  flex-shrink: 0;
}

/* ========== 按钮（微信风格） ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
  white-space: nowrap;
  border: none;
}

.btn:active {
  opacity: 0.7;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-outline {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* 底部固定按钮区 */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 0.5px solid var(--border);
  z-index: 150;
  max-width: 600px;
  margin: 0 auto;
}

.bottom-bar .btn {
  width: 100%;
}

/* ========== 文书导出操作区 ==========
   内联在页面流中（不使用 position:fixed），避免被底部 TabBar 遮挡。
   按钮高度 ≥48px，方便民警现场戴手套/强光下操作。 */
.doc-actions {
  padding: 14px;
  margin-bottom: 12px;
}

.doc-actions-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.btn-export {
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.doc-actions-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--divider);
}

.doc-actions-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.doc-actions-row {
  display: flex;
  gap: 10px;
}

.doc-actions-row .btn-export {
  flex: 1;
  font-size: 15px;
}

.doc-actions-tip {
  margin-top: 14px;
  padding: 9px 11px;
  background: #f7f8fa;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-tertiary);
}

.doc-nav-row {
  display: flex;
  gap: 8px;
  padding: 0 0 12px;
}

.doc-nav-row .btn {
  flex: 1;
  min-height: 44px;
}

/* 文书容器卡片 */
.doc-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.tag-success { background: var(--primary-light); color: var(--primary-dark); }
.tag-danger { background: #fff0f0; color: var(--danger); }
.tag-warning { background: #fff8ed; color: #d48806; }
.tag-info { background: #e8f5ff; color: #1890ff; }
.tag-default { background: #f5f5f5; color: #999; }

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card-bg);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ========== 模态框（底部弹出） ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  justify-content: center;
  align-items: flex-end;
  max-width: 600px;
  margin: 0 auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 16px;
  border-bottom: 0.5px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:active {
  background: var(--divider);
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 10px));
  border-top: 0.5px solid var(--divider);
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
}

.modal-footer .btn {
  flex: 1;
}

/* ========== 检查流程 ========== */
.check-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.check-header .enterprise-icon {
  width: 48px;
  height: 48px;
  font-size: 24px;
}

.check-header-info {
  flex: 1;
}

.check-header-title {
  font-size: 17px;
  font-weight: 600;
}

.check-header-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 进度条 */
.progress-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.progress-bar-wrap {
  height: 8px;
  background: #ebebeb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.progress-text-row .label {
  font-weight: 500;
}

.progress-text-row .value {
  font-weight: 700;
  color: var(--primary);
}

/* ========== 检查项 ========== */
.category-header {
  background: transparent;
  padding: 12px 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-header .count {
  background: #f0f0f0;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.check-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.check-item-content {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 4px;
}

.check-item-standard {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2px;
}

.check-item-law {
  font-size: 12px;
  color: var(--info);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
  user-select: none;
}

.check-item-law:hover {
  color: #0891d1;
}

.check-item-law:active {
  opacity: 0.7;
}

.check-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.result-btn {
  flex: 1;
  padding: 8px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
  font-family: inherit;
}

.result-btn:active {
  opacity: 0.7;
}

.result-btn.selected.pass {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.result-btn.selected.fail {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.result-btn.selected.na {
  background: #b2b2b2;
  border-color: #b2b2b2;
  color: white;
}

.check-item-desc {
  margin-top: 10px;
}

.check-item-desc textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
}

/* 其他需要说明的事项 */
.check-item-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.check-item-note textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  background: var(--bg-tertiary);
}

.check-item-note textarea:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

/* ========== 搜索栏 ========== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: none;
}

/* ========== 筛选标签 ========== */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--card-bg);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state .icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state .text {
  font-size: 15px;
  margin-bottom: 6px;
}

.empty-state .subtext {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 3000;
  animation: toastFade 0.3s ease;
  max-width: 80%;
  text-align: center;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ========== 图表 ========== */
.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding: 0 4px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s;
  min-height: 4px;
}

.bar-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.bar-value {
  font-size: 13px;
  font-weight: 700;
}

/* ========== 进度环 ========== */
.progress-ring-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.progress-ring-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-ring-row:last-child {
  margin-bottom: 0;
}

.progress-ring-label {
  font-size: 14px;
  font-weight: 500;
}

.progress-ring-value {
  font-size: 18px;
  font-weight: 700;
}

.progress-ring-bar {
  width: 100%;
  height: 6px;
  background: #ebebeb;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-ring-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

/* ========== 文书打印 ========== */
.document {
  background: white;
  padding: 32px 24px;
  max-width: 100%;
  font-family: 'FangSong', 'STFangsong', '仿宋', '宋体', serif;
  line-height: 1.8;
  font-size: 15px;
}

.document-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'SimHei', 'STHeiti', '黑体', sans-serif;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.document-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.document-table th,
.document-table td {
  border: 1px solid #333;
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'FangSong', '仿宋', serif;
}

.document-table th {
  background: #f5f5f5;
  font-weight: 700;
}

.document-section {
  margin: 12px 0;
}

.document-section-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.document-signature {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.document-signature-block {
  text-align: center;
}

.document-signature-block .label {
  font-size: 13px;
}

.document-signature-block .line {
  margin-top: 32px;
  border-top: 1px solid #333;
  padding-top: 4px;
  font-size: 12px;
  min-width: 100px;
}

/* ========== 整改通知书（党政机关公文格式 GB/T 9704-2012 观感） ==========
   正文：仿宋_GB2312 三号（约21px），固定行距 32px，首行缩进 2 字符
   标题：方正小标宋 / 黑体 二号（约29px），居中
   落款：机关名称与日期右对齐 */
.rectify-doc {
  font-family: 'FangSong_GB2312', '仿宋_GB2312', 'FangSong', 'STFangsong', '仿宋', '宋体', serif;
  font-size: 21px;
  line-height: 32px;
  color: #000;
  padding: 30px 24px 26px;
  text-align: justify;
}

.rectify-doc .rd-title {
  font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'STZhongsong', 'SimHei', '黑体', serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 3px;
  text-align: center;
  margin: 10px 0 30px;
}

/* 公文两行式标题：机关名称（黑体居中）+ 文书名称（小标宋居中） */
.rectify-doc .rd-org {
  font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'STZhongsong', 'SimHei', '黑体', serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 2px;
  text-align: center;
  margin: 4px 0 2px;
}

.rectify-doc .rd-title2 {
  font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'STZhongsong', 'SimHei', '黑体', serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 4px;
  text-align: center;
  margin: 0 0 6px;
}

/* 文号：居中，仿宋 */
.rectify-doc .rd-docno {
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  margin: 0 0 14px;
}

/* 违法行为列表：首行缩进两字符 */
.rectify-doc .rd-problem-list {
  text-indent: 2em;
  margin: 0 0 2px;
}

.rectify-doc .rd-problem-item {
  font-size: 21px;
  line-height: 32px;
  text-indent: 0;
}

.rectify-doc .rd-problem-empty {
  color: #000;
}

/* 三种责令方式（□ 勾选项）：首行缩进两字符 */
.rectify-doc .rd-check-list {
  margin: 2px 0 2px;
}

.rectify-doc .rd-check {
  font-size: 21px;
  line-height: 32px;
  text-indent: 2em;
}

.rectify-doc .rd-check-box {
  display: inline-block;
  margin-right: 2px;
  font-family: 'SimSun', '宋体', serif;
}

/* 主送单位：顶格，不缩进 */
.rectify-doc .rd-recv {
  font-size: 21px;
  line-height: 32px;
  text-indent: 0;
  margin: 0 0 2px;
  word-break: break-all;
}

.rectify-doc .rd-para {
  font-size: 21px;
  line-height: 32px;
  text-indent: 2em;
  margin: 0 0 2px;
  text-align: justify;
}

/* 空白横线：违法行为区域下方供现场书写 */
.rectify-doc .rd-blank-line {
  height: 30px;
  border-bottom: 1px solid #000;
  margin: 2px 0;
  text-indent: 0;
}

/* 落款区：左右两列，底部（日期行）对齐 */
.rectify-doc .rd-sign-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  font-size: 21px;
  line-height: 32px;
}

.rectify-doc .rd-sign-left {
  text-align: left;
}

.rectify-doc .rd-sign-right {
  text-align: right;
}

.rectify-doc .rd-sign-line {
  margin-bottom: 4px;
  white-space: nowrap;
}

.rectify-doc .rd-sign-left .rd-sign-date {
  padding-right: 0;
}

.rectify-doc .rd-sign-org {
  padding-right: 1em;
}

.rectify-doc .rd-sign-right .rd-sign-date {
  padding-right: 3em;
}

/* 签字栏 */
.rectify-doc .rd-foot {
  margin-top: 44px;
  font-size: 18px;
  line-height: 30px;
  text-align: left;
}

.rectify-doc .rd-foot-line {
  margin-bottom: 6px;
}

.rectify-doc .rd-fill {
  display: inline-block;
  min-width: 110px;
  border-bottom: 1px solid #000;
  text-align: center;
  line-height: 1.6;
}

.rectify-doc .rd-copies {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.8;
}

/* ========== 表格 ========== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data-table th {
  background: var(--card-bg);
  color: var(--text-secondary);
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

table.data-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--divider);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

/* ========== 设置列表 ========== */
.settings-section {
  margin-bottom: 12px;
}

.settings-section-title {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 16px 6px;
}

.settings-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ========== 响应式 ========== */
@media (min-width: 601px) {
  body {
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: 100vh;
  }
  
  .navbar {
    max-width: 600px;
  }
  
  .tabbar {
    max-width: 600px;
  }
}

/* ========== 打印 ========== */
@media print {
  /* 隐藏所有不需要打印的元素 */
  .navbar, .tabbar, .bottom-bar, .no-print,
  .card .card-header, .toast, .modal { display: none !important; }

  /* 只显示当前活动页面 */
  .page { display: none !important; }
  .page.active { display: block !important; }

  /* 重置根布局上下文：脱离 flex 流、放开高度与溢出，page-break 才能生效且不被裁切 */
  html, body {
    height: auto !important;
    overflow: visible !important;
  }
  body {
    display: block !important;
    max-width: none !important;
    background: white !important;
    box-shadow: none !important;
  }
  .content {
    overflow: visible !important;
    height: auto !important;
    padding: 0 !important;
  }
  .page.active {
    padding: 0 !important;
  }

  /* A4纸张设置 */
  @page {
    size: A4;
    margin: 25mm 20mm 25mm 20mm;
  }

  /* 文书卡片去掉外框 */
  .card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* 两份文书之间分页 */
  .document {
    box-shadow: none !important;
    padding: 0 !important;
    font-family: 'FangSong', 'STFangsong', '仿宋', '宋体', serif !important;
    font-size: 16pt !important;
    line-height: 1.9 !important;
  }
  .document + .card { page-break-before: always; }

  /* 标题：黑体二号 */
  .document-title {
    font-family: 'SimHei', 'STHeiti', '黑体', sans-serif !important;
    font-size: 22pt !important;
    letter-spacing: 4px !important;
    margin-bottom: 16pt !important;
  }
  .document-subtitle {
    font-size: 14pt !important;
    margin-bottom: 16pt !important;
  }

  /* 表格：实线边框 */
  .document-table {
    border-collapse: collapse !important;
    margin: 8pt 0 !important;
  }
  .document-table th,
  .document-table td {
    border: 1px solid #000 !important;
    padding: 4pt 6pt !important;
    font-size: 12pt !important;
    font-family: 'FangSong', '仿宋', serif !important;
  }
  .document-table th {
    background: #eee !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 检查结果颜色保持 */
  .document-table td span {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 签名区域 */
  .document-signature {
    margin-top: 40pt !important;
  }
  .document-signature-block .line {
    border-top: 1px solid #000 !important;
  }

  /* 段落 */
  .document p {
    font-family: 'FangSong', '仿宋', serif !important;
    font-size: 16pt !important;
    line-height: 1.9 !important;
  }
  .document-section-title {
    font-family: 'SimHei', '黑体', sans-serif !important;
    font-size: 16pt !important;
  }

  /* ---------- 以下规则须置于最后，用于覆盖上方通用文书样式 ---------- */

  /* 导出操作区、导航按钮一律不打印 */
  .doc-actions, .doc-nav-row, .btn, button,
  #doc-export-loading, #doc-export-dialog,
  #doc-export-imgview, #doc-export-tip { display: none !important; }

  /* 两份文书之间强制分页 */
  .doc-page-break { page-break-before: always !important; }
  .doc-card { margin: 0 !important; }

  /* 检查记录表：小四正文 + 五号表格，保证 A4 排得下、边框清晰 */
  .check-doc {
    font-size: 12pt !important;
    line-height: 1.5 !important;
    padding: 0 !important;
  }
  .check-doc p,
  .check-doc .document-section-title {
    font-size: 12pt !important;
    line-height: 1.5 !important;
  }
  .check-doc .document-title { font-size: 18pt !important; }
  .check-doc .document-subtitle { font-size: 12pt !important; margin-bottom: 10pt !important; }
  .check-doc .document-table th,
  .check-doc .document-table td {
    font-size: 10.5pt !important;
    padding: 3pt 5pt !important;
    border: 1px solid #000 !important;
    line-height: 1.45 !important;
  }
  .check-doc .document-table { page-break-inside: auto !important; }
  .check-doc .document-table tr { page-break-inside: avoid !important; }
  .check-doc .document-signature { margin-top: 24pt !important; }
  .check-doc .document-signature-block .label { font-size: 11pt !important; }

  /* 整改通知书：仿宋三号，行距固定，标题二号 */
  .rectify-doc {
    font-family: 'FangSong_GB2312', '仿宋_GB2312', 'FangSong', '仿宋', serif !important;
    font-size: 16pt !important;
    line-height: 1.6 !important;
    padding: 0 !important;
    color: #000 !important;
  }
  .rectify-doc .rd-title {
    font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'SimHei', '黑体', serif !important;
    font-size: 22pt !important;
    letter-spacing: 4px !important;
    margin: 0 0 24pt !important;
  }
  .rectify-doc .rd-org {
    font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'SimHei', '黑体', serif !important;
    font-size: 18pt !important;
    letter-spacing: 2px !important;
    margin: 0 0 2pt !important;
  }
  .rectify-doc .rd-title2 {
    font-family: 'FZXiaoBiaoSong-B05S', '方正小标宋简体', 'SimHei', '黑体', serif !important;
    font-size: 22pt !important;
    letter-spacing: 4px !important;
    margin: 0 0 4pt !important;
  }
  .rectify-doc .rd-docno {
    font-size: 14pt !important;
    line-height: 1.6 !important;
    margin: 0 0 12pt !important;
  }
  .rectify-doc .rd-recv,
  .rectify-doc .rd-para,
  .rectify-doc .rd-problem-item,
  .rectify-doc .rd-check {
    font-family: 'FangSong_GB2312', '仿宋_GB2312', 'FangSong', '仿宋', serif !important;
    font-size: 16pt !important;
    line-height: 1.6 !important;
    margin: 0 0 2pt !important;
  }
  .rectify-doc .rd-problem-list,
  .rectify-doc .rd-check-list {
    margin: 0 0 2pt !important;
  }
  .rectify-doc .rd-blank-line {
    border-bottom: 1px solid #000 !important;
    height: 26pt !important;
    margin: 0 0 2pt !important;
  }
  .rectify-doc .rd-sign-area {
    font-size: 16pt !important;
    line-height: 1.6 !important;
    margin-top: 28pt !important;
  }
  .rectify-doc .rd-sign-left,
  .rectify-doc .rd-sign-right {
    font-size: 16pt !important;
    line-height: 1.6 !important;
  }
  .rectify-doc .rd-sign-line { margin-bottom: 4pt !important; }
  .rectify-doc .rd-foot {
    font-size: 14pt !important;
    line-height: 1.8 !important;
    margin-top: 34pt !important;
  }
  .rectify-doc .rd-fill {
    border-bottom: 1px solid #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .rectify-doc .rd-copies { font-size: 12pt !important; }
}


/* ========== 现场水印拍照门禁 ========== */
.photo-gate-card .photo-gate-box {
  border: 2px dashed var(--border-color, #d0d7de);
  border-radius: 14px;
  padding: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f8f9fb;
  transition: border-color .2s;
}
.photo-gate-card .photo-gate-box:active { border-color: #07c160; }
.photo-gate-card .photo-gate-placeholder {
  color: var(--text-secondary, #666);
  text-align: center;
  padding: 32px 12px;
}
/* 检查结果页/记录详情中的照片缩略图 */
.record-photo-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  cursor: zoom-in;
  display: block;
}
.record-photo-full {
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  border: 1px solid #e5e5e5;
}
.photo-meta-line {
  font-size: 12px;
  color: var(--text-secondary, #888);
  margin-top: 6px;
  text-align: center;
}
