/* ============================================================
   政策资金申报渠道管理平台 - 全局政务UI统一样式
   严格遵循需求文档：主色#005A9C / #0078D7 / #E8F4FF / #C8102E
   全五端强制统一标准
   ============================================================ */

:root {
  /* 全局配色 - 不可随意改动 */
  --gov-blue-1: #005A9C;   /* 政务深蓝 - 标题栏/导航 */
  --gov-blue-2: #0078D7;   /* 标准政务蓝 - 按钮/高亮 */
  --gov-blue-3: #E8F4FF;   /* 浅政务蓝 - 卡片背景 */
  --gov-red:    #C8102E;   /* 中国红 - 点缀警示 */
  --text-title: #111111;  /* 标题 */
  --text-body:  #333333;   /* 正文 */
  --text-aux:   #666666;   /* 辅助说明 */
  --text-white: #FFFFFF;

  /* 字体规范 */
  --fs-xl: 20px;  /* 大标题 */
  --fs-lg: 18px;  /* 模块标题 */
  --fs-md: 16px;  /* 卡片小标题/正文/按钮 */
  --fs-sm: 14px;  /* 辅助说明最小字 */

  /* 布局参数 */
  --page-margin: 24px;
  --module-gap: 24px;
  --card-padding: 20px;
  --card-radius: 8px;
  --btn-height: 48px;
  --btn-radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-md);
  color: var(--text-body);
  background: #F4F6F9;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 标题样式 ===== */
.gov-title-xl { font-size: var(--fs-xl); font-weight: bold; color: var(--gov-blue-1); }
.gov-title-lg { font-size: var(--fs-lg); font-weight: bold; color: var(--text-title); }
.gov-title-md { font-size: var(--fs-md); font-weight: bold; color: var(--gov-blue-1); }
.gov-text     { font-size: var(--fs-md); color: var(--text-body); }
.gov-aux      { font-size: var(--fs-sm); color: var(--text-aux); }

/* ===== 政务顶栏 ===== */
.gov-topbar {
  background: linear-gradient(135deg, #004a82 0%, #005A9C 50%, #0078D7 100%);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,90,156,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.gov-topbar .brand { display: flex; align-items: center; gap: 12px; }
.gov-topbar .brand .logo {
  width: 40px; height: 40px; border-radius: 6px;
  background: #fff; color: var(--gov-blue-1);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 18px;
}
.gov-topbar .brand .name { font-size: 18px; font-weight: bold; }
.gov-topbar .brand .badge { font-size: 12px; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; }
.gov-topbar .user-area { display: flex; align-items: center; gap: 16px; font-size: 14px; }

/* ===== 卡片 ===== */
.gov-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: var(--module-gap);
  border: 1px solid #EEF2F7;
}
.gov-card.gov-card-blue { background: var(--gov-blue-3); border-color: #cfe6ff; }
.gov-card-title {
  font-size: var(--fs-lg); font-weight: bold; color: var(--text-title);
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 2px solid var(--gov-blue-1);
  display: flex; align-items: center; justify-content: space-between;
}
.gov-card-title .bar {
  display: inline-block; width: 4px; height: 18px;
  background: var(--gov-blue-2); margin-right: 8px;
  vertical-align: middle; border-radius: 2px;
}

/* ===== 按钮 ===== */
.gov-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-height); padding: 0 24px;
  border: none; border-radius: var(--btn-radius);
  background: var(--gov-blue-2); color: #fff;
  font-size: var(--fs-md); font-weight: bold;
  cursor: pointer; transition: all 0.15s;
  gap: 6px;
}
.gov-btn:hover { background: #0068bd; }
.gov-btn:active { transform: scale(0.98); }
.gov-btn.gov-btn-red { background: var(--gov-red); }
.gov-btn.gov-btn-red:hover { background: #a50d26; }
.gov-btn.gov-btn-ghost {
  background: #fff; color: var(--gov-blue-1);
  border: 1px solid var(--gov-blue-1);
}
.gov-btn.gov-btn-ghost:hover { background: var(--gov-blue-3); }
.gov-btn.gov-btn-gray { background: #e0e0e0; color: #666; }
.gov-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ===== 权限配置切换按钮 ===== */
.perm-switch-btn {
  padding: 8px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid var(--gov-blue-2);
}
.perm-switch-btn.active {
  background: var(--gov-blue-2);
  color: #fff;
}
.perm-switch-btn.inactive {
  background: #fff;
  color: var(--gov-blue-1);
  border-color: var(--gov-blue-2);
}
.perm-switch-btn.inactive:hover {
  background: var(--gov-blue-3);
}

/* ===== 角色标签 ===== */
.cfg-role-tab {
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  text-align: left;
  background: #fff;
  color: #666;
  border: 1px solid #e2e8f0;
}
.cfg-role-tab:hover {
  background: var(--gov-blue-3);
  border-color: var(--gov-blue-2);
}
.cfg-role-tab.active {
  background: var(--gov-blue-2);
  color: #fff;
  border-color: var(--gov-blue-2);
  font-weight: bold;
}

/* ===== 表单 ===== */
.gov-form-group { margin-bottom: 16px; }
.gov-form-group label {
  display: block; font-size: 14px; color: var(--text-aux);
  margin-bottom: 6px;
}
.gov-form-group label .req { color: var(--gov-red); margin-left: 2px; }
.gov-input, .gov-select, .gov-textarea {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1px solid #d0d7e2; border-radius: 6px;
  font-size: 15px; color: var(--text-body);
  background: #fff; transition: border 0.15s;
  font-family: inherit;
}
.gov-textarea { height: auto; padding: 10px 14px; min-height: 80px; resize: vertical; }
.gov-input:focus, .gov-select:focus, .gov-textarea:focus {
  outline: none; border-color: var(--gov-blue-2);
  box-shadow: 0 0 0 3px rgba(0,120,215,0.12);
}
.gov-input.error { border-color: var(--gov-red); }

/* ===== 表格 ===== */
.gov-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: var(--card-radius); overflow: hidden;
  font-size: 14px;
}
.gov-table th {
  background: var(--gov-blue-1); color: #fff;
  padding: 12px 14px; text-align: left; font-weight: bold;
}
.gov-table td {
  padding: 11px 14px; border-bottom: 1px solid #EEF2F7;
}
.gov-table tr:hover td { background: var(--gov-blue-3); }
.gov-table tr:last-child td { border-bottom: none; }

/* ===== 标签 ===== */
.gov-tag {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 12px; font-weight: bold;
}
.gov-tag.gov-tag-blue { background: var(--gov-blue-3); color: var(--gov-blue-1); }
.gov-tag.gov-tag-green { background: #e6f9ee; color: #1a8a4a; }
.gov-tag.gov-tag-red { background: #fde8ec; color: var(--gov-red); }
.gov-tag.gov-tag-gold { background: #fff6e0; color: #b8860b; }
.gov-tag.gov-tag-gray { background: #eef0f3; color: #666; }

/* ===== 弹窗 ===== */
.gov-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.gov-modal-mask.show { display: flex; }
.gov-modal {
  background: #fff; border-radius: 10px; width: 90%; max-width: 440px;
  padding: 28px 24px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: pop 0.2s ease;
}
.gov-modal-mask.show:has(.html-content) .gov-modal { max-width: 560px; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gov-modal .icon { font-size: 52px; margin-bottom: 12px; }
.gov-modal .icon.success { color: #1a8a4a; }
.gov-modal .icon.error { color: var(--gov-red); }
.gov-modal .icon.warn { color: #f0a020; }
.gov-modal .icon.info { color: var(--gov-blue-2); }
.gov-modal .title { font-size: 18px; font-weight: bold; color: var(--text-title); margin-bottom: 8px; }
.gov-modal .desc { font-size: 14px; color: var(--text-aux); margin-bottom: 20px; line-height: 1.6; }
.gov-modal .desc.html-content { text-align: left; max-height: 60vh; overflow-y: auto; overflow-x: auto; white-space: normal; word-break: break-word; }
.gov-modal .desc.html-content table { width: 100%; border-collapse: collapse; }
.gov-modal .desc.html-content td { padding: 4px 8px; }
.gov-modal { max-height: 90vh; overflow-y: auto; }
.gov-modal .actions { display: flex; gap: 12px; justify-content: center; }
.gov-modal .actions .gov-btn { min-width: 110px; }

/* ===== 文件列表 ===== */
.file-list { margin-top: 4px; }
.file-list > div:last-child { margin-bottom: 0; }

/* ===== 部委图标网格 ===== */
.ministry-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.ministry-item {
  background: #fff; border-radius: 12px; padding: 16px 8px;
  text-align: center; cursor: pointer; transition: all 0.3s;
  border: 1px solid #eef2f7; position: relative;
}
.ministry-item:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,90,156,0.18); border-color: var(--gov-blue-2); }
.ministry-item img { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.ministry-item .name { font-size: 13px; color: var(--text-title); font-weight: 600; line-height: 1.4; }

/* ===== 功能卡片网格 ===== */
.func-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.func-item {
  background: var(--gov-blue-3); border-radius: 10px; padding: 18px 8px;
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.func-item:hover { background: #d6ebff; transform: translateY(-2px); }
.func-item .ico { font-size: 32px; margin-bottom: 6px; }
.func-item .label { font-size: 14px; color: var(--text-title); font-weight: bold; }

/* ===== 移动端底部导航 ===== */
.gov-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #e6ebf2;
  display: flex; height: 56px; z-index: 99;
}
.gov-tabbar .tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-aux); cursor: pointer; gap: 2px;
}
.gov-tabbar .tab.active { color: var(--gov-blue-1); }
.gov-tabbar .tab .ico { font-size: 20px; }

/* ===== 统计数字块 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-block {
  background: linear-gradient(135deg, #0078D7 0%, #005A9C 100%);
  color: #fff; border-radius: 10px; padding: 16px;
}
.stat-block .num { font-size: 24px; font-weight: bold; }
.stat-block .lbl { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.stat-block.gold { background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%); }
.stat-block.green { background: linear-gradient(135deg, #2ea36b 0%, #1a8a4a 100%); }
.stat-block.red { background: linear-gradient(135deg, #d63552 0%, #C8102E 100%); }

/* ===== PC后台布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #003a66; color: #cfe2f5;
  flex-shrink: 0; padding: 0; min-height: 100vh;
}
.admin-sidebar .logo-box {
  padding: 18px 16px; background: #002d4f; color: #fff;
  font-size: 15px; font-weight: bold; border-bottom: 1px solid #004a82;
}
.admin-sidebar .menu-group-title {
  padding: 14px 16px 6px; font-size: 12px; color: #6f9bbf;
  letter-spacing: 1px;
}
.admin-sidebar .menu-item {
  padding: 11px 24px; font-size: 14px; cursor: pointer;
  border-left: 3px solid transparent; transition: all 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.admin-sidebar .menu-item:hover { background: #004a82; color: #fff; }
.admin-sidebar .menu-item.active {
  background: #0078D7; color: #fff; border-left-color: #fff;
}
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-header {
  height: 56px; background: #fff; border-bottom: 1px solid #e6ebf2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.admin-content { flex: 1; padding: 24px; overflow-y: auto; background: #f4f6f9; }

/* ===== 通用工具 ===== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-red { color: var(--gov-red); }
.text-blue { color: var(--gov-blue-1); }
.text-green { color: #1a8a4a; }
.text-bold { font-weight: bold; }
.hide { display: none !important; }

/* 提示条 */
.alert {
  padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.alert.alert-info { background: #e8f4ff; color: #005a9c; border: 1px solid #b8d9ff; }
.alert.alert-warn { background: #fff8e6; color: #b8860b; border: 1px solid #ffe3a0; }
.alert.alert-danger { background: #fde8ec; color: #C8102E; border: 1px solid #f5b8c3; }
.alert.alert-success { background: #e6f9ee; color: #1a8a4a; border: 1px solid #a8e6c4; }

/* 移动端适配 */
@media (max-width: 768px) {
  /* 全局基础 */
  html, body { font-size: 14px; }
  h1 { font-size: 20px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }
  h4 { font-size: 15px !important; }
  
  .ministry-grid { grid-template-columns: repeat(3, 1fr); }
  .func-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .partner-grid { grid-template-columns: 1fr; gap: 12px; }
  
  /* Admin布局 */
  .admin-layout { flex-direction: column; }
  /* 🔧 修复手机端Admin后台菜单问题：侧边栏默认折叠，点击汉堡按钮展开 */
  .admin-sidebar { 
    width: 100%; 
    min-height: auto; 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s ease-out;
    position: relative;
    z-index: 50;
  }
  .admin-sidebar .menu-group-title {
    font-size: 12px; padding: 10px 14px 6px;
  }
  .admin-sidebar .menu-item {
    padding: 12px 14px; font-size: 14px; border-radius: 0;
  }
  .admin-sidebar.open {
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }
  /* 手机端汉堡菜单按钮 */
  .admin-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    background: var(--gov-blue-1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
  }
  .admin-header { padding: 10px 12px; gap: 8px; }
  .admin-header .logo-area .logo-text { font-size: 15px; }
  .admin-header .breadcrumb { font-size: 12px; flex-wrap: wrap; }
  .admin-header .user-area { font-size: 12px; gap: 8px; }
  .admin-header .user-area .user-name { display: none; }
  .admin-content { padding: 12px; }
  
  /* 页面标题区 */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0 0 12px 0;
  }
  .page-header h2 { width: 100%; }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  .page-actions .gov-btn {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 36px;
  }
  
  /* 表格：横向滚动，避免挤压 */
  .table-wrap, .data-table-wrap, table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 600px; }
  table th, table td {
    padding: 10px 8px;
    font-size: 13px;
    white-space: nowrap;
  }
  table .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 180px;
  }
  table .row-actions .gov-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  /* 表单：输入框宽度100%，label换行 */
  .form-row, .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .form-item, .gov-form-item {
    width: 100%;
  }
  .form-item label, .gov-form-item label {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    font-size: 13px;
  }
  .form-item input,
  .form-item select,
  .form-item textarea,
  .gov-form-item input,
  .gov-form-item select,
  .gov-form-item textarea,
  .gov-input, .gov-select {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 10px 12px;
    min-height: 40px;
  }
  
  /* 弹窗/模态框：手机端宽度92%，不要超出屏幕 */
  .modal, .gov-modal, .modal-box, [role=dialog] {
    width: 92% !important;
    max-width: 92% !important;
    margin: 5vh auto 0 !important;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-header, .gov-modal-header {
    padding: 14px 16px;
    font-size: 16px;
  }
  .modal-body, .gov-modal-body {
    padding: 14px 16px;
  }
  .modal-footer, .gov-modal-footer {
    padding: 12px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .modal-footer .gov-btn,
  .gov-modal-footer .gov-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 14px;
  }
  
  /* 合伙人端Tabbar：高度适配，图标文字不挤压 */
  .gov-tabbar {
    height: 60px;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom)) 0;
    gap: 0;
  }
  .gov-tabbar .tab {
    gap: 3px;
    font-size: 11px;
    padding: 4px 2px;
  }
  .gov-tabbar .tab .tab-icon {
    font-size: 20px;
  }
  
  /* 合伙人端页面间距 */
  .gov-page { padding-bottom: 70px; }
  .gov-page-header {
    padding: 12px 14px;
    gap: 8px;
  }
  .gov-page-header h1 { font-size: 18px; }
  
  /* 说明框/权限说明：字号间距适配 */
  .alert, .note-box, .info-tip, .permission-note {
    padding: 12px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    gap: 6px !important;
    flex-direction: column;
    align-items: flex-start;
  }
  .alert .alert-title, .note-box .note-title, .info-tip .tip-title {
    font-size: 14px;
    margin-bottom: 2px;
  }
  
  /* 按钮组：自动换行，不要挤成一团 */
  .btn-group, .action-group, .button-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .btn-group .gov-btn,
  .action-group .gov-btn,
  .button-bar .gov-btn {
    font-size: 13px;
    padding: 8px 14px;
    min-height: 38px;
  }
  
  /* 卡片：padding减小 */
  .gov-card, .card, .stat-card {
    padding: 12px !important;
    border-radius: 10px !important;
  }
  .stat-card .stat-num { font-size: 20px; }
  .stat-card .stat-label { font-size: 12px; }
  
  /* 筛选区/搜索框：换行显示 */
  .filter-bar, .search-bar, .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 0;
  }
  .filter-bar .gov-input,
  .search-bar .gov-input,
  .toolbar .gov-input,
  .filter-bar .gov-select,
  .search-bar .gov-select,
  .toolbar .gov-select {
    width: 100% !important;
  }
  .filter-bar .gov-btn,
  .search-bar .gov-btn,
  .toolbar .gov-btn {
    width: 100%;
  }
}
/* 强制移动端：加.is-mobile类可强制应用手机端样式（用于测试或内嵌） */
.is-mobile { font-size: 14px; }
.is-mobile h1 { font-size: 20px !important; }
.is-mobile h2 { font-size: 18px !important; }
.is-mobile h3 { font-size: 16px !important; }
.is-mobile h4 { font-size: 15px !important; }
.is-mobile .ministry-grid { grid-template-columns: repeat(3, 1fr); }
.is-mobile .func-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.is-mobile .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.is-mobile .partner-grid { grid-template-columns: 1fr; gap: 12px; }
.is-mobile .admin-layout { flex-direction: column; }
.is-mobile .admin-sidebar { 
  width: 100%; 
  min-height: auto; 
  max-height: 0; 
  overflow: hidden; 
  transition: max-height 0.3s ease-out;
  position: relative;
  z-index: 50;
}
.is-mobile .admin-sidebar .menu-group-title { font-size: 12px; padding: 10px 14px 6px; }
.is-mobile .admin-sidebar .menu-item { padding: 12px 14px; font-size: 14px; border-radius: 0; }
.is-mobile .admin-sidebar.open { max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.is-mobile .admin-menu-toggle {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: 40px; height: 36px;
  background: var(--gov-blue-1); color: #fff;
  border: none; border-radius: 8px;
  font-size: 18px; font-weight: bold;
  cursor: pointer; margin-right: 8px;
}
.is-mobile .admin-header { padding: 10px 12px; gap: 8px; }
.is-mobile .admin-header .logo-area .logo-text { font-size: 15px; }
.is-mobile .admin-header .breadcrumb { font-size: 12px; flex-wrap: wrap; }
.is-mobile .admin-header .user-area { font-size: 12px; gap: 8px; }
.is-mobile .admin-header .user-area .user-name { display: none; }
.is-mobile .admin-content { padding: 12px; }
.is-mobile .page-header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 0 12px 0; }
.is-mobile .page-header h2 { width: 100%; }
.is-mobile .page-actions { width: 100%; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.is-mobile .page-actions .gov-btn { font-size: 13px; padding: 8px 12px; min-height: 36px; }
.is-mobile .table-wrap, .is-mobile .data-table-wrap, .is-mobile table {
  display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.is-mobile table { min-width: 600px; }
.is-mobile table th, .is-mobile table td { padding: 10px 8px; font-size: 13px; white-space: nowrap; }
.is-mobile table .row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 180px; }
.is-mobile table .row-actions .gov-btn { padding: 5px 10px; font-size: 12px; }
.is-mobile .form-row, .is-mobile .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
.is-mobile .form-item, .is-mobile .gov-form-item { width: 100%; }
.is-mobile .form-item label, .is-mobile .gov-form-item label {
  display: block; width: 100%; margin-bottom: 6px; font-size: 13px;
}
.is-mobile .form-item input,
.is-mobile .form-item select,
.is-mobile .form-item textarea,
.is-mobile .gov-form-item input,
.is-mobile .gov-form-item select,
.is-mobile .gov-form-item textarea,
.is-mobile .gov-input, .is-mobile .gov-select {
  width: 100% !important; max-width: 100%; box-sizing: border-box;
  font-size: 14px; padding: 10px 12px; min-height: 40px;
}
.is-mobile .modal, .is-mobile .gov-modal, .is-mobile .modal-box, .is-mobile [role=dialog] {
  width: 92% !important; max-width: 92% !important;
  margin: 5vh auto 0 !important; max-height: 85vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.is-mobile .modal-header, .is-mobile .gov-modal-header { padding: 14px 16px; font-size: 16px; }
.is-mobile .modal-body, .is-mobile .gov-modal-body { padding: 14px 16px; }
.is-mobile .modal-footer, .is-mobile .gov-modal-footer { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
.is-mobile .modal-footer .gov-btn,
.is-mobile .gov-modal-footer .gov-btn {
  flex: 1; min-width: 100px; padding: 10px 12px; font-size: 14px;
}
.is-mobile .gov-tabbar {
  height: 60px; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)) 0; gap: 0;
}
.is-mobile .gov-tabbar .tab { gap: 3px; font-size: 11px; padding: 4px 2px; }
.is-mobile .gov-tabbar .tab .tab-icon { font-size: 20px; }
.is-mobile .gov-page { padding-bottom: 70px; }
.is-mobile .gov-page-header { padding: 12px 14px; gap: 8px; }
.is-mobile .gov-page-header h1 { font-size: 18px; }
.is-mobile .alert, .is-mobile .note-box, .is-mobile .info-tip, .is-mobile .permission-note {
  padding: 12px !important; font-size: 13px !important; line-height: 1.6 !important;
  gap: 6px !important; flex-direction: column; align-items: flex-start;
}
.is-mobile .alert .alert-title, .is-mobile .note-box .note-title, .is-mobile .info-tip .tip-title {
  font-size: 14px; margin-bottom: 2px;
}
.is-mobile .btn-group, .is-mobile .action-group, .is-mobile .button-bar { flex-wrap: wrap; gap: 8px; }
.is-mobile .btn-group .gov-btn,
.is-mobile .action-group .gov-btn,
.is-mobile .button-bar .gov-btn { font-size: 13px; padding: 8px 14px; min-height: 38px; }
.is-mobile .gov-card, .is-mobile .card, .is-mobile .stat-card {
  padding: 12px !important; border-radius: 10px !important;
}
.is-mobile .stat-card .stat-num { font-size: 20px; }
.is-mobile .stat-card .stat-label { font-size: 12px; }
.is-mobile .filter-bar, .is-mobile .search-bar, .is-mobile .toolbar {
  flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 0;
}
.is-mobile .filter-bar .gov-input,
.is-mobile .search-bar .gov-input,
.is-mobile .toolbar .gov-input,
.is-mobile .filter-bar .gov-select,
.is-mobile .search-bar .gov-select,
.is-mobile .toolbar .gov-select { width: 100% !important; }
.is-mobile .filter-bar .gov-btn,
.is-mobile .search-bar .gov-btn,
.is-mobile .toolbar .gov-btn { width: 100%; }

/* ===== 🔧 手机端：横向滚动容器（说明框/内容用，和表格体验一致） ===== */
.admin-mobile-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.admin-mobile-scroll-wrap::-webkit-scrollbar {
  height: 4px;
}
.admin-mobile-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}
.admin-mobile-scroll-wrap::-webkit-scrollbar-track {
  background: transparent;
}
/* 手机端隐藏滚动条但保持可滑动 */
@media (max-width: 768px) {
  .admin-mobile-scroll-wrap::-webkit-scrollbar { display: none; }
  .admin-mobile-scroll-wrap { -ms-overflow-style: none; scrollbar-width: none; }
}
.is-mobile .admin-mobile-scroll-wrap::-webkit-scrollbar { display: none; }
.is-mobile .admin-mobile-scroll-wrap { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== 🔧 手机端：右下角悬浮按钮（快速回菜单） ===== */
.admin-fab-menu {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gov-blue-1, #0078D7);
  color: #ffffff;
  font-size: 24px;
  font-weight: bold;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 120, 215, 0.45);
  cursor: pointer;
  z-index: 999;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.admin-fab-menu:active {
  transform: scale(0.92);
  box-shadow: 0 3px 10px rgba(0, 120, 215, 0.4);
}
@media (max-width: 768px) {
  .admin-fab-menu { display: inline-flex !important; }
}
.is-mobile .admin-fab-menu { display: inline-flex !important; }

/* PC端汉堡按钮隐藏 */
.admin-menu-toggle { display: none !important; }

/* ============================================================
   🔧 V8.3 全站布局优化补丁（老板反馈：文字拥挤、返回按钮不明显、
      保存/复制成功提示缺弹窗）
   策略：只追加新规则，不覆盖旧样式；手机端优先优化；
        所有拥挤问题用 「增大gap + 增大padding + 加大字号 + 自动换行」
        的最小改动模板解决。
   ============================================================ */

/* ---------- ① 返回导航条样式全面升级（更明显、更好点、不拥挤） ---------- */
.back-nav {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px !important;
  margin: 0 0 12px 0 !important;
  background: #f8fbff;
  border-bottom: 1px solid #e6f0ff;
  border-radius: 0 0 8px 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.back-nav:hover { background: #eaf2ff; }
.back-nav:active { opacity: 0.85; transform: scale(0.995); }
.back-nav-label {
  font-size: 15px !important;
  font-weight: 600;
  color: var(--gov-blue-1, #005A9C);
  letter-spacing: 0.5px;
}
.back-nav-arrow {
  font-size: 22px !important;
  font-weight: bold;
  color: var(--gov-blue-2, #0078D7);
  margin-left: 8px;
  line-height: 1;
}
.back-nav-dark { background: #f0f7ff; border-color: #cfe2ff; }
.back-nav-dark .back-nav-label { color: #003a6d; }
.back-nav-dark .back-nav-arrow { color: #005A9C; }
.back-nav-light { background: #ffffff; border-color: #eef2f7; }
.back-nav-muted { background: #f7f8fa; border-color: #eaecf0; }

/* ---------- ② 全局页面基础间距：手机端页面不顶边、有呼吸感 ---------- */
.page, [id^="page-"], .gov-page {
  padding: 0 0 80px 0;
}
.gov-page-header,
.page > h1:first-child,
.page > h2:first-child,
.page > .back-nav + div,
.page > .back-nav + section {
  padding-left: 12px;
  padding-right: 12px;
}

/* ---------- ③ 卡片/列表文字区：手机端统一增大内边距、行高、字号 ---------- */
.card, .gov-card, .stat-card,
.commission-row,
[id^="page-"] > div > div {
  line-height: 1.75 !important;
}
.commission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 4px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px dashed #f0f0f0;
}
.commission-row:last-child { border-bottom: none; }
.commission-row > span:first-child { color: #666; font-size: 13px; }
.commission-row > span:last-child  { color: #1a1a1a; font-weight: 500; }

/* ---------- ④ 表格/操作列：手机端换行、字号加大、不再挤压 ---------- */
.gov-table th, .gov-table td {
  padding: 12px 10px !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  vertical-align: middle;
}
.gov-table thead th {
  font-size: 13px !important;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.gov-table td.row-actions,
.gov-table td > .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.gov-table td .row-actions .gov-btn {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
  height: auto;
  flex: 1 1 auto;
  white-space: nowrap;
}

/* ---------- ⑤ 标题/正文排版：更清晰的层级、更松的行高 ---------- */
.gov-title-xl { line-height: 1.4; margin-bottom: 8px; }
.gov-title-lg { line-height: 1.45; margin-bottom: 10px; }
.gov-title-md { line-height: 1.5;  margin-bottom: 8px; }
.gov-text      { line-height: 1.75; }
.gov-aux       { line-height: 1.7; }

/* ---------- ⑥ 手机端专用：字号/间距再放大一档（用户反馈的核心） ---------- */
@media (max-width: 768px) {
  /* 全局基础字号放大到15px基准（手机端更易读） */
  html, body, .page, .gov-page, [id^="page-"] {
    font-size: 15px;
    line-height: 1.8;
  }
  /* 卡片：padding再加大，避免文字贴边 */
  .gov-card, .card, .stat-card,
  .partner-grid > div, .func-item, .ministry-item {
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }
  .gov-card-title {
    font-size: 17px !important;
    padding-bottom: 14px;
    margin-bottom: 16px;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .gov-card-title > span:first-child {
    width: 100%;
    flex-shrink: 0;
  }
  .gov-card-title > .flex,
  .gov-card-title > div[class*="flex"],
  .gov-card-title > div[style*="float:right"] {
    width: 100% !important;
    float: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: flex-start !important;
  }
  .gov-card-title > .flex .gov-btn,
  .gov-card-title > div[class*="flex"] .gov-btn,
  .gov-card-title > div[style*="float:right"] .gov-btn {
    flex: 1 1 calc(50% - 5px) !important;
    min-width: calc(50% - 5px) !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 9px 16px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
  }
  /* 所有按钮默认文字不换行，避免内联 height:36px 导致文字拥挤 */
  .gov-btn, .gov-btn-primary, .gov-btn-ghost, .gov-btn-danger,
  button[class*="gov-btn"] {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    min-width: fit-content !important;
    box-sizing: border-box !important;
  }
  /* 列表项/卡片内操作按钮组统一增加间距 */
  .partner-item .action-btns,
  .gov-card .action-btns,
  .partner-grid .action-btns,
  [class*="action"] > .gov-btn,
  [class*="action"] > button {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 8px !important;
  }
  /* 表格：最小宽度增大，防止文字折行难看 */
  table, .gov-table { min-width: 720px !important; }
  .gov-table th, .gov-table td {
    padding: 14px 12px !important;
    font-size: 14px !important;
    white-space: normal !important;
    word-break: break-all;
  }
  /* 表单：label + input 间距加大 */
  .gov-form-group { margin-bottom: 18px; }
  .gov-form-group label {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.6;
  }
  .gov-input, .gov-select, .gov-textarea {
    font-size: 15px !important;
    padding: 12px 14px !important;
    min-height: 44px !important;
    border-radius: 8px !important;
  }
  .gov-textarea { min-height: 96px !important; line-height: 1.7; }
  /* 按钮：统一圆角/高度/字号，更好点 */
  .gov-btn {
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    line-height: 1.4;
  }
  .gov-btn.gov-btn-ghost {
    padding: 8px 14px !important;
    min-height: 38px !important;
  }
  /* 说明/警示框：不拥挤 */
  .alert, .info-tip, .note-box, .permission-note {
    padding: 14px 16px !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    border-radius: 10px !important;
    gap: 8px !important;
  }
  /* 统计卡片：更宽松 */
  .stat-block {
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }
  .stat-block .num { font-size: 22px !important; letter-spacing: -0.5px; }
  .stat-block .lbl { font-size: 13px !important; margin-top: 4px; }
  /* 合伙人/员工管理卡片：不贴边、信息行更松 */
  .employee-card-wrap > div,
  [id*="Mgmt"] > div > div {
    padding: 16px !important;
    margin-bottom: 12px !important;
    border-radius: 12px !important;
  }
  .emp-info-line,
  [class*="info-row"],
  [id*="Mgmt"] .info-line {
    font-size: 14px !important;
    line-height: 2 !important;
  }
  /* 弹窗：更好的手机体验 */
  .gov-modal, .modal-box, [role=dialog] {
    padding: 22px 18px !important;
    border-radius: 14px !important;
  }
  .gov-modal .title { font-size: 17px !important; margin-bottom: 10px; }
  .gov-modal .desc  { font-size: 14px !important; line-height: 1.7 !important; margin-bottom: 22px; }
  .gov-modal .actions { gap: 10px; flex-wrap: wrap; }
  .gov-modal .actions .gov-btn { flex: 1; min-width: 100px; }
  /* 返回导航：手机端更好按 */
  .back-nav {
    padding: 14px 16px !important;
    margin-bottom: 14px !important;
  }
  .back-nav-label { font-size: 16px !important; }
  .back-nav-arrow { font-size: 24px !important; }
  /* 顶部栏：用户信息不挤 */
  .gov-topbar { padding: 12px 14px; }
  .gov-topbar .name { font-size: 16px; }
  .gov-topbar .user-area { font-size: 13px; gap: 10px; }
}

/* ---------- ⑦ Toast/模态成功提示：更醒目（老板说保存/复制没弹窗） ---------- */
.gov-toast {
  font-size: 15px !important;
  padding: 12px 18px !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
}

/* ---------- ⑧ 工具按钮组合：自动换行不拥挤 ---------- */
.btn-group, .action-group, .button-bar, .toolbar, .filter-bar, .search-bar, .page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.page-actions { justify-content: flex-end; }

/* ---------- ⑨ admin后台：面包屑/内容区不挤（PC+手机） ---------- */
.admin-header .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}
.admin-content { font-size: 15px; line-height: 1.75; }
.admin-sidebar .menu-item {
  font-size: 14px;
  padding: 12px 20px;
  gap: 10px;
}

/* ---------- ⑩ 协议工具栏（复制/保存按钮）：更醒目 + 不拥挤 ---------- */
#agreementToolbar, .agreement-toolbar, [id*="Toolbar"] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 8px;
}
#agreementToolbar .gov-btn,
.agreement-toolbar .gov-btn,
.toolbar .gov-btn {
  font-size: 13px;
  padding: 8px 14px;
  min-height: 36px;
  height: auto;
}

/* ---------- ⑪ 防止超窄屏下按钮文字被挤压 ---------- */
.gov-btn {
  white-space: normal !important;
  word-break: keep-all;
  overflow-wrap: break-word;
}
@media (max-width: 420px) {
  .gov-btn { font-size: 14px !important; }
}

