/* ========== 表哦 - 全局样式（行政风格） ========== */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6eb;
  --border-strong: #c9cdd4;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --primary: #1f3a5f;
  --primary-hover: #2a4d7a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warning: #d97706;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ========== 布局容器 ========== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.container-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

.form-control[readonly], .form-control:disabled {
  background: #f3f4f6;
  color: var(--text-secondary);
  cursor: not-allowed;
}

textarea.form-control {
  resize: none;
  min-height: 38px;
  line-height: 1.6;
  overflow: hidden;
}

.char-count {
  float: right;
  color: #999;
  font-size: 12px;
  font-weight: normal;
}

.detail-field {
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.detail-field:last-child { border-bottom: none; }
.detail-field-name {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-bottom: 4px;
}
.detail-field-value {
  font-size: 14px;
  color: var(--text, #333);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: #f9fafb; }

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 4px 8px;
  font-size: 13px;
}
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }

.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ========== 复选框组 ========== */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ========== 列表项 ========== */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s;
  min-height: 44px;
}

.list-item:hover { background: #f9fafb; }

.list-item.pending { border-left: 3px solid var(--text-muted); }
.list-item.submitted { border-left: 3px solid var(--success); background: var(--success-bg); }

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 10px;
}

/* ========== 分区标题 ========== */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title .count {
  font-size: 12px;
  font-weight: normal;
  color: var(--text-secondary);
  background: #f3f4f6;
  padding: 1px 8px;
  border-radius: 10px;
}

/* ========== 页面标题 ========== */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.page-notice {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.8;
  margin-bottom: 16px;
}

/* ========== 进度条 ========== */
.progress-wrap {
  margin-bottom: 16px;
}

.progress {
  height: 10px;
  background: #eef0f3;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: right;
}

.progress-text b {
  color: var(--success);
  font-weight: 600;
}

/* ========== 顶部栏 ========== */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .btn-ghost { color: rgba(255,255,255,0.85); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ========== 管理菜单 ========== */
.admin-entry {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
}

.admin-entry-btn {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.admin-entry-btn:hover { color: var(--accent); border-color: var(--accent); }

.admin-menu {
  position: absolute;
  right: 0;
  bottom: 36px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 140px;
  overflow: hidden;
}

.admin-menu-item {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.admin-menu-item:hover { background: #f3f4f6; }
.admin-menu-item.danger { color: var(--danger); }

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== 提示信息 ========== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

/* ========== 空状态 ========== */
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========== 链接展示 ========== */
.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-box input {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  color: var(--text);
  font-family: monospace;
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 10px;
  font-weight: 500;
}

.tag-pending { background: #f3f4f6; color: var(--text-secondary); }
.tag-submitted { background: var(--success-bg); color: var(--success); }
.tag-mine { background: var(--accent); color: #fff; }

/* ========== 预览表格 ========== */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-table .preview-idx {
  background: #f9fafb;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  min-width: 56px;
}

.preview-row:hover td { background: #f3f7ff; }

.preview-row-sel td {
  background: #eaf2ff !important;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ========== 填写情况预览表格 ========== */
.data-preview-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.data-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card);
}

.data-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--success);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  white-space: nowrap;
  border: 1px solid var(--success);
}

.data-preview-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--card);
}

.data-preview-table tbody tr.row-pending td {
  background: #f7f8f5;
  color: var(--text-muted);
}

.data-preview-table tbody tr:hover td {
  background: var(--success-bg);
}

/* 填写情况预览：操作列常驻右侧（横向滚动时固定，角落表头层级最高） */
.data-preview-table th:last-child,
.data-preview-table td:last-child {
  position: sticky;
  right: 0;
  width: 70px;
  text-align: center;
  white-space: nowrap;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
}
.data-preview-table th:last-child {
  z-index: 3;
  background: var(--success);
}
.data-preview-table td:last-child {
  z-index: 2;
  background: var(--card);
}
.data-preview-table tbody tr.row-pending td:last-child {
  background: #f7f8f5;
}
.data-preview-table tbody tr:hover td:last-child {
  background: var(--success-bg);
}

/* ========== 名单分组折叠 ========== */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--card);
}
.collapsible:last-child { margin-bottom: 0; }

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #fafafa;
}
.collapsible-header:hover { background: #f3f4f6; }

.collapsible-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}
.collapsible.open .collapsible-arrow { transform: rotate(90deg); }

.collapsible-header .count {
  font-size: 12px;
  font-weight: normal;
  color: var(--text-secondary);
  background: #f3f4f6;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.collapsible-content { display: none; padding: 10px; }
.collapsible.open .collapsible-content { display: block; }

/* ========== 公开页名单表格 ========== */
.collect-table-wrap {
  width: 100%;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.collect-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 14px;
}
.collect-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
}
.collect-table td {
  border-top: 1px solid var(--border);
  padding: 9px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--card);
}
.collect-table tbody tr.row-pending { background: #fafbfc; }
.collect-table tbody tr:hover td { background: var(--success-bg); }
/* 状态/操作列固定在右侧：列多屏窄时横向滚动也始终可见，保证能点填写/查看 */
.collect-table th.col-status,
.collect-table td.col-status {
  width: 78px; white-space: nowrap;
  position: sticky; right: 68px;
  background: var(--card); z-index: 1;
}
.collect-table th.col-action,
.collect-table td.col-action {
  width: 68px; white-space: nowrap; text-align: center;
  position: sticky; right: 0;
  background: var(--card); z-index: 1;
}
.collect-table thead th.col-status,
.collect-table thead th.col-action { background: var(--accent); z-index: 3; }
.status-pending { color: var(--text-muted); }
.status-submitted { color: var(--success); }

/* ========== 已填写折叠卡片 ========== */
.submitted-fold {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.submitted-fold-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  background: var(--bg);
  font-weight: 600;
}
.submitted-fold-head .fold-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.submitted-fold.open .fold-arrow { transform: rotate(90deg); }
.submitted-fold-body { display: none; }
.submitted-fold.open .submitted-fold-body { display: block; }
.submitted-card {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.submitted-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.submitted-main { font-weight: 600; }
.submitted-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.submitted-card-head .btn { margin-left: auto; }
.submitted-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.submitted-field {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.submitted-field b { color: var(--text); font-weight: 600; }

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .container, .container-wide { padding: 10px; }
  .card { padding: 12px; margin-bottom: 10px; }
  .page-title { font-size: 19px; }

  /* 手机端表单全屏弹窗 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  /* 输入框 ≥16px 防 iOS 缩放 */
  .form-control { font-size: 16px; padding: 10px 12px; }

  .list-item { padding: 10px 12px; }


  /* 手机端：表格不限制高度，完整铺开整页滚动，避免下方内容被"裁掉"看似被遮 */
  .collect-table-wrap { max-height: none; }
  .collect-table { font-size: 13px; }
  .collect-table th, .collect-table td { padding: 8px 10px; }
}
