:root {
  --border: #94a3b8;
  --input-border: #334155;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.todo-status-pending_trigger { color: #64748b; }
.todo-status-pending_remind { color: #2563eb; }
.todo-status-completed { color: var(--text); }
.todo-status-overdue { color: #dc2626; font-weight: 600; }
.todo-status-invalid { color: #94a3b8; text-decoration: line-through; }
.urgent-heading { color: #dc2626; }
.todo-urgent-list { list-style: none; padding: 0; margin: 0; }
.todo-card { border: 1px solid var(--border); border-left: 4px solid; border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; background: #fff; }
.urgent-overdue { border-left-color: #dc2626; background: #fef2f2; }
.urgent-remind { border-left-color: #2563eb; background: #eff6ff; }
.todo-card-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.todo-badge { border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.8em; color: #fff; white-space: nowrap; }
.badge-overdue { background: #dc2626; color: #fff; }
.badge-remind { background: #2563eb; color: #fff; }

.muted { color: var(--muted); font-size: 0.9em; }
.wechat-bind-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  background: #eff6ff;
  border: 1px solid var(--primary);
  border-radius: 8px;
}
.wechat-bind-banner a { font-weight: 600; white-space: nowrap; }
.wechat-bound { display: flex; align-items: center; gap: 0.6rem; }
.wechat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e2e8f0; }
/* 裁切第三方二维码组件，去掉其自带的标题与底部提示文字 */
.qr-crop { position: relative; overflow: hidden; margin: 0; }
.qr-crop-wx { width: 300px; height: 282px; }
.qr-crop-wx iframe { position: absolute; top: -47px; left: 0; }
.qr-crop-wecom { width: 280px; height: 280px; }
.qr-crop-wecom iframe { position: absolute; top: -44px; left: -49px; width: 378px; height: 440px; border: 0; }

nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f172a;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
nav a { color: #cbd5e1; }
nav a:hover { color: #ffffff; text-decoration: none; }
nav form { display: inline; margin-left: auto; }
nav button {
  background: transparent;
  color: #f87171;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
nav button:hover { text-decoration: underline; }

.nav-dropdown {
  position: relative;
}
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: #cbd5e1;
}
.nav-dropdown summary::-webkit-details-marker {
  display: none;
}
.nav-dropdown summary:hover,
.nav-dropdown[open] summary {
  color: #ffffff;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  min-width: 160px;
  padding: 0.35rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.3);
  z-index: 120;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  color: #cbd5e1;
}
.nav-dropdown-menu a:hover {
  background: #1e293b;
  color: #ffffff;
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.6rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

ul.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.messages li {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid;
}
ul.messages .success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
ul.messages .warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
ul.messages .error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
ul.messages .info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

form p, form > div { margin: 0 0 0.9rem; }
label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.helptext { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.85em; }
input, select, textarea {
  width: 100%;
  max-width: 560px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
input[type="checkbox"] { width: auto; }
.check-inline { display: flex; align-items: center; gap: 0.5rem; }
.check-inline label { display: inline; margin: 0; font-weight: 500; }
.check-inline input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.errorlist { color: #dc2626; list-style: none; padding: 0; margin: 0.25rem 0 0; font-size: 0.85em; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
input:hover, select:hover, textarea:hover { border-color: #1e293b; }
textarea { font-family: inherit; }

button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
button:hover, .btn:hover { background: var(--primary-hover); }
button:disabled, .btn:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.75;
}
button:disabled:hover, .btn:disabled:hover { background: #cbd5e1; }

.btn-secondary { background: #e2e8f0; color: #0f172a; border: 1px solid #94a3b8; }
.btn-secondary:hover { background: #cbd5e1; border-color: #64748b; }
.btn-danger { background: #dc2626; color: #ffffff; border: none; }
.btn-danger:hover { background: #b91c1c; }
.file-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: nowrap; margin: 0.5rem 0; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.badge { display: inline-block; background: #eef2ff; color: #4338ca; border-radius: 999px; padding: 0.15rem 0.65rem; font-size: 0.85em; }
.stat-cards { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { flex: 1 1 120px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; text-align: center; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85em; }
.stat-danger .stat-value { color: #dc2626; }
.stat-value-multi { font-size: 1.15rem; }
.stat-overdue { color: #dc2626; font-weight: 700; }
.stat-status { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; align-items: center; }
.actions { margin-top: 0.8rem; display: flex; gap: 0.5rem; align-items: center; }
.help-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 0.8rem; font-size: 0.85rem; }
.action-groups { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
.action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.action-group-label { font-weight: 600; color: var(--muted); min-width: 5.5rem; }
.trigger-form { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; flex-wrap: wrap; }
.trigger-form label { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; font-weight: 600; }
.trigger-form input { width: auto; max-width: none; }
input[type="file"] { border: none; padding: 0.4rem 0; width: auto; max-width: none; pointer-events: none; }
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  pointer-events: auto;
  cursor: pointer;
}

.key-chip {
  display: inline-block;
  margin: 0 0.4rem 0.4rem 0;
  padding: 0.35rem 0.7rem;
  background: #f1f5f9;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.key-chip:hover { background: #e2e8f0; }
.key-chip.selected { background: var(--primary); color: #ffffff; border-color: var(--primary-hover); }
mark.hl { background: #fde047; color: #0f172a; padding: 0 0.1em; border-radius: 2px; }
.hl-yellow { background: #fde047; color: #0f172a; padding: 0 0.1em; border-radius: 2px; }
.hl-red { background: #fecaca; color: #b91c1c; padding: 0 0.1em; border-radius: 2px; }
.hl-source { background: #fbbf24; color: #451a03; padding: 0 0.1em; border-radius: 2px; }

.status-active { color: #16a34a; font-weight: 600; }
.status-inactive { color: #dc2626; font-weight: 600; }
.event-occurred { background: #dcfce7; color: #15803d; }
.event-pending { background: #f1f5f9; color: #64748b; }
.event-title { margin: 0 0 0.5rem; font-size: 1.1rem; }

/* 站内信 */
.notification-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.notification-actions { margin-bottom: 1rem; }
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  background: #ffffff;
}
.notification.unread { border-left: 4px solid var(--primary); background: #eff6ff; }
.notification-title { font-weight: 600; }
.notification-content { margin-top: 0.3rem; }

.preview-split {
  display: flex;
  gap: 1rem;
  height: 70vh;
  min-height: 360px;
}
.preview-keys {
  flex: 0 0 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
}
.preview-keys .key-chip { display: block; width: 100%; text-align: left; }
.form-pane {
  flex: 0 0 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
}
.var-row { padding: 0.4rem 0.5rem; border-radius: 6px; margin-bottom: 0.3rem; cursor: pointer; }
.var-row:hover { background: #f8fafc; }
.var-row.selected,
.var-row:focus-within { background: #dbeafe; box-shadow: inset 0 0 0 2px var(--primary); }
.var-row label { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.preview-body-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
}
.preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-family: inherit;
}
.preview-body p { margin: 0 0 0.6rem; }
.preview-body table { border-collapse: collapse; margin: 0.6rem 0; }
.preview-body td, .preview-body th { border: 1px solid #cbd5e1; padding: 0.35rem 0.6rem; }

ul { padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }

pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 1rem;
  margin-bottom: 1rem;
}
.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9em;
}

.assistant-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.assistant-form input[type="text"] {
  flex: 1;
}
.assistant-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.assistant-results {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.assistant-results li {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  background: #fff;
}

#member-filter {
  width: 100%;
  max-width: 320px;
  margin-bottom: 0.4rem;
}
.member-select {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  background: #fff;
  margin-bottom: 1rem;
}
.step4-items.member-select {
  max-height: none;
  overflow-y: visible;
}
.step5-items.member-select {
  max-height: none;
  overflow-y: visible;
}
.member-select label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0.2rem 0;
  text-align: left;
}
.member-select input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  width: auto;
}
.member-select input[type="radio"] {
  margin: 0;
  flex: 0 0 auto;
  width: auto;
}

#template-item-list,
#image-item-list,
#step1-template-items {
  max-height: none;
  overflow: visible;
}
.image-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0;
}
.image-item label {
  margin: 0;
}
.template-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0;
}
.template-item label {
  margin: 0;
}
.image-thumb {
  display: block;
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.6rem;
}
.chip {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.9em;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.modal[hidden] {
  display: none;
}
.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  width: min(560px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-foot {
  margin-top: 0.8rem;
  text-align: right;
}

.assistant-examples {
  margin-top: 1rem;
}
.assistant-examples h2 {
  margin: 0 0 0.6rem;
}
.assistant-example-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
}
.assistant-example-group h3 {
  margin: 0 0 0.4rem;
}
.assistant-example-group ul {
  margin: 0;
  padding-left: 1.2rem;
}
.assistant-example-group li {
  margin: 0.25rem 0;
  color: var(--muted);
}

.login-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.login-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
}
.login-tab.active {
  background: #fff;
  border-color: var(--border);
  color: #0f172a;
  font-weight: 600;
}
.login-pane[hidden] {
  display: none;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
}
.tab.active {
  background: #fff;
  border-color: var(--border);
  color: #0f172a;
  font-weight: 600;
}
a.tab {
  display: inline-block;
  text-decoration: none;
}
a.tab:hover {
  text-decoration: none;
}
.tab-pane[hidden] {
  display: none;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: #ffffff;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
th { background: #f8fafc; }

/* 耗时操作遮罩 */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#loading-overlay.show { display: flex; }
.loading-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.9rem;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: #334155; font-weight: 600; }

/* AI 待办确认卡片 */
.draft-confirm { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.8rem; font-weight: 600; }
.draft-header { display: flex; align-items: center; gap: 0.5rem; }
.draft-header input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }
.draft-header input[type="text"] { flex: 1 1 auto; max-width: none; }
.draft-header .draft-toggle { flex: 0 0 auto; margin-left: auto; }
.draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
}
.draft-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-weight: 600; }
.draft-grid .member-select label { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.4rem; font-weight: 400; text-align: left; }
.draft-grid input, .draft-grid select, .draft-grid textarea { width: 100%; max-width: none; }
.draft-grid .draft-full { grid-column: 1 / -1; }
.draft-full .draft-label { font-weight: 600; margin-bottom: 0.2rem; }
.draft-source { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.6rem; }

/* 待办详情 */
.todo-detail {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.4rem 0.9rem;
  margin: 0 0 1rem;
}
.todo-detail dt { font-weight: 600; color: var(--muted); }
.todo-detail dd { margin: 0; }

/* 合同校核结果 */
.issue-list { list-style: none; padding: 0; margin: 0; }
.issue {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  background: #ffffff;
}
.issue-error { border-left-color: #dc2626; }
.issue-warning { border-left-color: #f59e0b; }
.issue-info { border-left-color: #2563eb; }
.issue-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-size: 0.8em;
  color: #ffffff;
  margin-right: 0.5rem;
}
.badge-error { background: #dc2626; }
.badge-warning { background: #f59e0b; }
.badge-info { background: #2563eb; }
.issue-category { color: var(--muted); margin-right: 0.5rem; }
.issue-detail, .issue-suggestion, .issue-source { margin-top: 0.3rem; }
.issue-suggestion { color: #b45309; }
.issue-source { color: var(--muted); white-space: pre-wrap; }

/* ===== 移动端响应式（≤768px）===== */
.nav-toggle { display: none; }

@media (max-width: 768px) {
  .container {
    margin: 0.75rem auto;
    padding: 0 0.75rem;
  }
  h1 { font-size: 1.3rem; }

  /* 顶部导航折叠成汉堡菜单 */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
    font: inherit;
    line-height: 1;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
  }
  nav {
    gap: 0.35rem 0.7rem;
    padding: 0.6rem 0.75rem;
    align-items: flex-start;
    max-height: 100vh;
    overflow-y: auto;
  }
  nav > a,
  nav > .toolkit-toggle,
  nav > form { display: none; }
  .nav-dropdown { display: none; }
  nav.nav-open { flex-direction: column; align-items: stretch; }
  nav.nav-open .nav-dropdown { display: block; width: 100%; }
  nav.nav-open .nav-dropdown summary { display: block; padding: 0.4rem 0; }
  nav.nav-open .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin: 0.2rem 0 0.4rem 1rem;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  nav.nav-open > a,
  nav.nav-open > .toolkit-toggle,
  nav.nav-open > form { display: block; width: 100%; padding: 0.4rem 0; text-align: left; }
  nav.nav-open form { margin-left: 0; }
  nav.nav-open form button { padding: 0.4rem 0; width: 100%; text-align: left; }

  /* 输入触控友好：16px 避免 iOS 聚焦自动放大 */
  input, select, textarea { max-width: 100%; font-size: 16px; }
  button, .btn { padding: 0.6rem 1.1rem; }
  button, .btn, .tab, .login-tab { min-height: 2.6rem; }

  /* 表格：默认横向滚动兜底 */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* 待办表格转卡片 */
  table.todo-table { overflow: visible; }
  table.todo-table thead { display: none; }
  table.todo-table,
  table.todo-table tbody,
  table.todo-table tr,
  table.todo-table td {
    display: block;
    width: 100%;
    white-space: normal;
  }
  table.todo-table tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.6rem;
    background: #fff;
  }
  table.todo-table td {
    border: none;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
  }
  table.todo-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 auto;
  }
  table.todo-table td.todo-cell-main { flex-direction: column; gap: 0.15rem; }
  table.todo-table td.todo-cell-actions { justify-content: flex-end; }
  table.todo-table td.todo-cell-actions::before { content: none; }

  /* 双列布局收成单列 */
  .draft-grid { grid-template-columns: 1fr; }
  .todo-detail { grid-template-columns: 1fr; gap: 0.2rem 0; }
  .todo-detail dt { margin-top: 0.5rem; }
  .todo-detail dt:first-child { margin-top: 0; }

  /* 表单/搜索区堆叠 */
  .filter-form { flex-direction: column; align-items: stretch; }
  .filter-form label { width: 100%; }
  .assistant-form { flex-direction: column; }

  /* 统计卡片两列 */
  .stat-card { flex: 1 1 46%; min-width: 0; }

  /* 三栏预览改为纵向堆叠 */
  .preview-split { flex-direction: column; height: auto; min-height: 0; }
  .preview-keys, .form-pane, .preview-body-wrap { flex: none; width: 100%; max-height: 50vh; }

  /* 二维码容器不超出屏幕（iframe 保持固定尺寸与裁剪偏移，避免二维码被裁切） */
  .qr-crop-wx, .qr-crop-wecom { max-width: 100%; }

  /* 登录/待办标签允许换行 */
  .login-tabs, .tabs { flex-wrap: wrap; }

  /* 工具箱小屏铺满 */
  .toolkit { right: 0.5rem; left: 0.5rem; width: auto; max-height: 85vh; }
}
