:root {
  /* ===== 稻农村集团 UI 设计规范令牌（docs.uowoo.cn/design-tokens.html）===== */
  --nt-primary: #1A5C3A;
  --nt-primary-dark: #0F3D27;
  --nt-primary-light: #E8F4EE;
  --nt-secondary: #3D9970;
  --nt-accent: #D4AF37;
  --nt-orange: #FF6B35;
  --nt-success: #3D9970;
  --nt-warning: #FF6B35;
  --nt-error: #FF6B6B;
  --nt-info: #3D9970;
  --nt-gray-50: #F9FAFB;
  --nt-gray-100: #F8F5F0;
  --nt-gray-200: #F0F0F0;
  --nt-gray-300: #E0E0E0;
  --nt-gray-500: #999999;
  --nt-gray-600: #666666;
  --nt-gray-700: #333333;
  --nt-gray-800: #1F2937;
  --nt-radius-sm: 0.25rem;
  --nt-radius-default: 0.5rem;
  --nt-radius-md: 0.75rem;
  --nt-radius-lg: 1rem;
  --nt-radius-xl: 1.5rem;
  --nt-radius-full: 9999px;
  --nt-shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --nt-shadow-default: 0 2px 8px rgba(0,0,0,0.08);
  --nt-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --nt-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --nt-shadow-xl: 0 12px 32px rgba(0,0,0,0.16);

  /* ===== 兼容旧变量名（映射规范值，便于逐步迁移）===== */
  --green: var(--nt-primary);
  --green-dark: var(--nt-primary-dark);
  --green-soft: var(--nt-primary-light);
  --bg: var(--nt-gray-100);
  --card: #FFFFFF;
  --text: var(--nt-gray-700);
  --muted: var(--nt-gray-600);
  --line: var(--nt-gray-300);
  --red: var(--nt-error);
  --blue: var(--nt-info);
  --orange: var(--nt-orange);
  --gray: var(--nt-gray-500);
  --shadow: var(--nt-shadow-default);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

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

/* 顶栏 */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--green); color: #fff;
  height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; letter-spacing: 1px;
  box-shadow: var(--nt-shadow-sm);
}
.app-header .h-left { position: absolute; left: 12px; font-size: 14px; font-weight: 400; cursor: pointer; }
.app-header .h-right { position: absolute; right: 12px; font-size: 13px; font-weight: 400; cursor: pointer; }

/* 容器 */
.container { max-width: 480px; margin: 0 auto; padding: 12px; }
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .app-shell { display: flex; min-height: 100vh; }
  .side-nav {
    width: 220px; background: #fff; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding-top: 12px; position: sticky; top: 0; height: 100vh;
  }
  .side-nav .brand { color: var(--green); font-weight: 700; font-size: 18px; padding: 14px 18px; }
  .side-nav a {
    display: flex; align-items: center; gap: 10px; padding: 13px 18px; color: var(--text);
    text-decoration: none; font-size: 15px; border-left: 3px solid transparent;
  }
  .side-nav a.active { background: var(--green-soft); color: var(--green-dark); border-left-color: var(--green); font-weight: 600; }
  .side-nav .spacer { flex: 1; }
  .side-nav .logout { color: var(--muted); }
  .main-area { flex: 1; }
  .main-area .app-header { position: static; justify-content: flex-start; padding-left: 20px; }
  .container { max-width: 1000px; padding: 18px 24px; }
  .bottom-nav { display: none !important; }
}

/* 底部导航（手机端） */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; height: 60px; box-shadow: 0 -1px 4px rgba(0,0,0,0.06);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 11px; gap: 2px;
}
.bottom-nav a .ic { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--green); }
.bottom-nav a .badge {
  position: absolute; top: 6px; right: 50%; margin-right: -18px;
  background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* 卡片 */
.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; margin-bottom: 6px; }

/* 统计卡 */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--card); border-radius: 12px; padding: 14px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--green-dark); }
.stat .num.red { color: var(--red); }
.stat .label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat .dot { position: absolute; top: 10px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* 工单卡片 */
.wo { background: var(--card); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid var(--line); }
.wo.overdue { border-left-color: var(--red); }
.wo .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wo .title { font-size: 15px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo .no { font-size: 12px; color: var(--muted); margin: 3px 0; }
.wo .meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* 徽标 */
.badge-s { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-pending { background: #eef1f4; color: var(--gray); }
.b-doing { background: var(--nt-primary-light); color: var(--blue); }
.b-wait { background: #FFEDE5; color: var(--orange); }
.b-done { background: var(--green-soft); color: var(--green-dark); }
.b-reject { background: #fdecea; color: var(--red); }
.b-overdue { background: #fdecea; color: var(--red); }
.pri { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.pri-普通 { background: #eef1f4; color: var(--gray); }
.pri-重要 { background: #FFEDE5; color: var(--orange); }
.pri-紧急 { background: #fdecea; color: var(--red); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; border: none; border-radius: var(--nt-radius-lg);
  padding: 11px 16px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn:active { opacity: .9; }
.btn.ghost { background: #fff; color: var(--green-dark); border: 1px solid var(--green); }
.btn.gray { background: #eef1f4; color: var(--text); }
.btn.red { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; width: auto; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 悬浮加号 */
.fab {
  position: fixed; right: 18px; bottom: 76px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%; background: var(--green);
  color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(26,92,58,.45); text-decoration: none;
}
@media (min-width: 768px) { .fab { bottom: 24px; right: 24px; } }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input[type=text], .field input[type=date], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--nt-radius-default); padding: 11px 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.field textarea { min-height: 96px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; font-size: 14px;
  background: #fff; cursor: pointer; user-select: none;
}
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.seg { display: flex; gap: 8px; }
.seg .chip { flex: 1; text-align: center; }

/* 下拉多选（协同部门） */
.dropdown { position: relative; }
.dropdown-trigger {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--nt-radius-default);
  padding: 11px 12px; font-size: 15px; font-family: inherit; background: #fff; color: var(--text); cursor: pointer;
}
.dropdown-panel {
  display: none; position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--nt-radius-default);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow: auto;
}
.dropdown-search { padding: 8px; border-bottom: 1px solid var(--line); }
.dropdown-search input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--nt-radius-sm); padding: 8px 10px; font-size: 14px; font-family: inherit;
}
.dropdown-list { padding: 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--nt-radius-sm); cursor: pointer; font-size: 14.5px; }
.dd-item:hover { background: var(--nt-gray-100); }
.dd-item input { width: 18px; height: 18px; accent-color: var(--nt-primary); }
.selected-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { background: var(--nt-primary-light); color: var(--nt-primary-dark); border-radius: 20px; padding: 5px 12px; font-size: 13px; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: -16px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.tl-item.sys::before { background: var(--gray); }
.tl-item.msg::before { background: var(--blue); }
.tl-item .t { font-size: 13px; color: var(--muted); }
.tl-item .c { font-size: 14px; margin-top: 2px; }

/* 部门任务 */
.dt {
  border: 1px solid var(--line); border-radius: var(--nt-radius-md); padding: 12px; margin-bottom: 10px; background: var(--nt-primary-light);
}
.dt .dh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dt .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dt .actions .btn { width: auto; }

/* 提示 */
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 200;
  background: rgba(31,42,36,.92); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.section-title { font-size: 14px; color: var(--muted); font-weight: 600; margin: 4px 2px 10px; }
.sub { font-size: 13px; color: var(--muted); }
.kv { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.kv .k { color: var(--muted); min-width: 84px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 18px; max-height: 84vh; overflow: auto; }
@media (min-width: 768px) { .modal-mask { align-items: center; } .modal { border-radius: 16px; } }
.modal h3 { margin-bottom: 12px; }
.modal .close { float: right; color: var(--muted); cursor: pointer; font-size: 20px; }
