  :root {
    --brand: #2f70e0;
    --brand-deep: #1d4fb8;
    --brand-light: #e9f1ff;
    --teal: #17845f;
    --teal-light: #e3f6ec;
    --amber: #b06a12;
    --amber-light: #fbf0da;
    --red: #d93a35;
    --red-light: #fdecea;
    --gray: #5f5e5a;
    --gray-light: #eef1f8;
    --blue: #4b7c9e;
    --blue-light: #e9f1f6;
    --orange: #b26a00;
    --orange-light: #fdf3e2;
    --bg: #f5f8ff;
    --card: #ffffff;
    --text: #1b1c24;
    --muted: #5c5f70;
    --hint: #6e7183;
    --line: #e6eaf4;
    /* v1.4：语义色 token（危险/警告/中性），深色模式有对应覆盖，避免写死浅色底 */
    --danger-bg: #fdecea; --danger-fg: #b3261e; --danger-line: #d93a35;
    --warn-bg: #fdf3e2; --warn-fg: #8a5a00; --warn-line: #b26a00;
    --neutral-bg: #f1f2f7; --neutral-fg: #5c5f70;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; padding: 0; }
  body {
    background: #e6edfb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
  }
  #app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.12);
  }
  .hidden { display: none !important; }

  /* 顶栏 */
  .topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
  }
  .team-switch {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 6px;
    font-size: 16px; font-weight: 600; cursor: pointer;
  }
  .team-switch .caret { font-size: 11px; color: var(--hint); }
  .icon-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--card); border: 1px solid var(--line);
    cursor: pointer; font-size: 15px; color: var(--muted);
    position: relative; flex: none;
  }
  .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 600; flex: none;
  }
  .badge-dot {
    position: absolute; top: 4px; right: 5px; width: 8px; height: 8px;
    background: var(--red); border-radius: 50%; border: 2px solid #fff;
  }
  .badge-num {
    position: absolute; top: -3px; right: -5px;
    background: var(--red); color: #fff;
    font-size: 10px; font-weight: 600; line-height: 1;
    min-width: 16px; height: 16px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 1.5px solid #fff;
  }
  .tab .tab-ico { position: relative; }
  .tab-badge {
    position: absolute; top: -7px; left: 50%; margin-left: 4px;
    background: var(--red); color: #fff;
    font-size: 9px; font-weight: 600; font-style: normal; line-height: 1;
    min-width: 14px; height: 14px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 1px solid #fff;
  }
  .chat-unread {
    background: var(--red); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 1;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px; flex: none;
  }
  .att-del {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1; cursor: pointer;
    border: 1.5px solid #fff; z-index: 2;
  }

  /* 内容区 */
  .content { padding: 12px 14px 80px; }
  .search-box { margin-bottom: 12px; }
  .search-box input {
    width: 100%; border: 1px solid var(--line); border-radius: 20px;
    padding: 9px 16px; font-size: 14px; background: var(--card);
  }
  .search-filters { display: flex; gap: 8px; margin-top: 8px; }
  .search-filters select {
    flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px;
    padding: 7px 10px; font-size: 13px; background: var(--card); color: var(--text);
  }
  mark { background: #fff3b0; color: var(--text); padding: 0 1px; border-radius: 2px; }
  .tabbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 430px; z-index: 50;
    display: flex; background: var(--card); border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1; padding: 8px 0 10px; text-align: center; cursor: pointer;
    color: var(--hint); font-size: 11px;
  }
  .tab .tab-ico { font-size: 20px; display: block; margin-bottom: 1px; }
  .tab.active { color: var(--brand); }

  /* 象限 */
  .quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .quad {
    background: var(--card); border-radius: 14px; padding: 10px;
    border: 1px solid var(--line); min-height: 140px;
    max-height: 48vh;
    display: flex; flex-direction: column;
  }
  .quad-head { margin-bottom: 8px; flex: none; }
  .quad-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
  .quad-title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .quad-strategy { font-size: 11px; color: var(--muted); margin-top: 1px; }
  .quad-tasks { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -2px; padding: 0 2px; }
  .quad-count {
    font-size: 11px; font-weight: 600; color: var(--muted);
    background: var(--gray-light); border-radius: 9px;
    padding: 1px 7px; margin-left: auto;
  }
  .quad.q1 { border-top: 3px solid var(--red); }
  .quad.q1 .quad-title::before { background: var(--red); }
  .quad.q2 { border-top: 3px solid var(--orange); }
  .quad.q2 .quad-title::before { background: var(--orange); }
  .quad.q3 { border-top: 3px solid var(--blue); }
  .quad.q3 .quad-title::before { background: var(--blue); }
  .quad.q4 { border-top: 3px solid var(--teal); }
  .quad.q4 .quad-title::before { background: var(--teal); }
  .quad.drag-over { background: var(--brand-light); border: 1px dashed var(--brand); }

  /* 任务卡片 */
  .task-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
  }
  .task-card:active { background: #f4f5fa; }
  .task-title { font-size: 13px; font-weight: 500; }
  .task-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
  .task-meta .chip { font-size: 10px; padding: 1px 7px; border-radius: 10px; }
  .chip.due { background: var(--neutral-bg); color: var(--neutral-fg); }
  .chip.overdue { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }
  .chip.today { background: var(--danger-bg); color: var(--danger-fg); }
  .task-card.overdue { border-left: 3px solid var(--red); }
  .overdue-bar { background: var(--danger-bg); color: var(--danger-fg); box-shadow: inset 3px 0 0 var(--danger-line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
  .due-soon-bar { background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 3px 0 0 var(--warn-line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
  .overdue-banner { background: var(--danger-bg); color: var(--danger-fg); box-shadow: inset 3px 0 0 var(--danger-line); border-radius: 10px; padding: 9px 13px; font-size: 13px; margin: 10px 0; font-weight: 500; }
  .ai-tip { background: var(--brand-light); border: 1px solid #d8e6ff; color: var(--brand-deep); border-radius: 10px; padding: 10px 12px; margin: 0 0 13px; font-size: 13px; line-height: 1.5; }
  .chip.done { background: var(--teal-light); color: var(--teal); }
  .chip.doing { background: var(--blue-light); color: var(--blue); }
  .task-meta .who { font-size: 11px; color: var(--muted); }
  .task-card.done .task-title { text-decoration: line-through; color: var(--hint); }
  .sub-badge { font-size: 10px; color: var(--brand); background: var(--brand-light); padding: 1px 6px; border-radius: 8px; }

  .add-btn {
    background: var(--card); border: 1px dashed var(--line); border-radius: 10px;
    padding: 9px; text-align: center; color: var(--hint); font-size: 12px; cursor: pointer;
  }
  .add-btn:hover { color: var(--brand); border-color: var(--brand); }

  /* 列表（消息/我的） */
  .list-item {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 11px;
    cursor: pointer;
  }
  .list-item .info { flex: 1; min-width: 0; }
  .list-item .name { font-size: 14px; font-weight: 500; }
  .list-item .sub { font-size: 12px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 2px 8px; }

  /* 按钮 */
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; border: none; border-radius: 10px;
    padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer; width: 100%;
  }
  .btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
  .btn.small { width: auto; padding: 7px 14px; font-size: 13px; }
  .btn:active { opacity: 0.85; }
  /* AI 星芒图标：currentColor 跟随按钮文字色；flex 容器里靠 margin/gap 控制间距 */
  .ai-ico { flex: none; vertical-align: -0.15em; }
  .btn .ai-ico { margin-right: 6px; }

  /* 视图切换行 */
  .view-switch { display: flex; gap: 8px; margin: 2px 2px 10px; align-items: center; }
  .seg {
    flex: 1; min-width: 0; display: flex;
    background: #e9ebf6; border: 1px solid var(--line);
    border-radius: 12px; padding: 3px;
  }
  .seg-item {
    flex: 1; border: none; background: transparent;
    color: var(--muted); font-size: 13px; font-weight: 500;
    padding: 7px 0; border-radius: 9px; cursor: pointer; white-space: nowrap;
  }
  .seg-item.on {
    background: var(--card); color: var(--brand); font-weight: 600;
    box-shadow: 0 1px 5px rgba(47,112,224,0.14);
  }
  .rollover-btn { white-space: nowrap; flex: none; }
  .create-btn {
    width: 100%; margin: 0 0 12px; padding: 11px 16px;
    background: linear-gradient(135deg, #2f70e0, #4a87ef);
    box-shadow: 0 4px 14px rgba(47,112,224,.28);
    border-radius: 12px; font-weight: 600; font-size: 14px;
  }
  .quick-entry {
    display: flex; gap: 8px; align-items: center; margin: 2px 2px 12px;
  }
  .quick-entry input {
    flex: 1; min-width: 0; border: 1px solid var(--brand);
    border-radius: 22px; padding: 10px 16px; font-size: 14px;
    background: var(--card);
  }
  .quick-entry .qe-btn {
    width: 44px; height: 44px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2f70e0, #4a87ef);
    color: #fff; border: none; font-size: 18px; cursor: pointer;
  }

  /* 弹窗 */
  .modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 100;
    display: flex; align-items: flex-end; justify-content: center;
  }
  .modal {
    width: 100%; max-width: 430px; background: var(--card);
    border-radius: 18px 18px 0 0; padding: 18px 18px 24px;
    max-height: 88vh; overflow-y: auto;
  }
  .modal h3 { margin: 0 0 14px; font-size: 17px; }
  .field { margin-bottom: 13px; }
  .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
  .field input, .field textarea, .field select {
    width: 100%; border: 1px solid var(--line); border-radius: 9px;
    padding: 10px 11px; font-size: 14px; font-family: inherit; background: #fbfaf7;
  }
  .field textarea { resize: none; }
  .seg { display: flex; gap: 8px; }
  .seg .opt {
    flex: 1; text-align: center; padding: 9px; border-radius: 9px;
    border: 1px solid var(--line); cursor: pointer; font-size: 13px; color: var(--muted);
  }
  .seg .opt.on { border-color: var(--brand); color: var(--brand); background: var(--brand-light); font-weight: 500; }
  .row-actions { display: flex; gap: 10px; margin-top: 16px; }
  .row-actions.qa-actions { gap: 8px; flex-wrap: wrap; }
  .row-actions.qa-actions .btn { font-size: 13px; padding: 9px 12px; flex: 1 1 auto; }
  .qa-note-link { font-size: 12px; color: var(--brand); cursor: pointer; padding: 2px 0 4px; }
  .qa-smart {
    background: var(--brand-light); border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
  }
  .qa-smart-label {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; color: var(--brand-deep); margin-bottom: 6px;
  }
  .qa-smart textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; resize: vertical; box-sizing: border-box; background: var(--card); color: var(--text); }

  /* 象限内已完成折叠（象限回答"接下来做什么"，已完成的默认不占位） */
  .quad-done-toggle {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--hint); cursor: pointer;
    padding: 6px 2px 4px; margin-top: 4px; border-top: 1px dashed var(--line);
  }
  .quad-done-toggle .qdt-act { color: var(--brand); font-weight: 500; }
  .quad-done-list { opacity: .62; }
  .quad-done-list .task-card { background: transparent; border: 1px dashed var(--line); }
  .quad-done-hint { font-size: 11px; color: var(--hint); text-align: center; padding: 10px 0 2px; }

  /* 任务详情 */
  .detail { background: var(--card); border-radius: 14px; padding: 16px; border: 1px solid var(--line); }
  .detail h2 { margin: 0 0 6px; font-size: 18px; }
  .detail .desc { color: var(--muted); font-size: 13px; margin: 8px 0 14px; white-space: pre-wrap; }
  .kv { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 12px; color: var(--muted); }
  .kv b { color: var(--text); font-weight: 500; }

  /* 聊天 */
  .chat-view { display: flex; flex-direction: column; height: calc(100vh - 120px); }
  .chat-head {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    background: var(--card); border-bottom: 1px solid var(--line);
  }
  .chat-head .back { cursor: pointer; color: var(--brand); font-size: 15px; padding: 0 4px; }
  .chat-head .title { font-weight: 600; font-size: 15px; }
  .msgs { flex: 1; overflow-y: auto; padding: 14px; }
  .msg { margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
  .msg.mine { justify-content: flex-end; }
  .msg > div { max-width: 68%; display: inline-flex; flex-direction: column; }
  .msg .avatar { margin-top: 2px; flex: none; }
  .bubble { display: inline-block; max-width: 100%; padding: 9px 12px; border-radius: 12px; font-size: 14px; background: var(--card); border: 1px solid var(--line); word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; }
  .msg.mine .bubble { background: var(--brand); color: #fff; border-color: var(--brand); }
  .msg .sender { font-size: 11px; color: var(--hint); margin-bottom: 2px; }
  /* 时间戳跟随气泡方向：左侧消息靠左，自己发的右侧消息靠右 */
  .msg-time { font-size: 10px; color: var(--hint); margin-top: 2px; text-align: left; }
  .msg.mine .msg-time { text-align: right; }
  .fav-mark { color: #e0a03a; font-size: 11px; margin-right: 2px; }
  .chat-input { display: flex; gap: 8px; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); }
  .chat-input input { flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; font-size: 14px; }
  .chat-input button { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; border: none; font-size: 16px; cursor: pointer; }
  .chat-input .mention-btn { background: var(--gray-light); color: var(--text); flex: none; }

  /* 登录 */
  .login { padding: 40px 24px; }
  .login .logo { text-align: center; margin-bottom: 28px; }
  .login .logo .mark { width: 62px; height: 62px; margin: 0 auto 12px; line-height: 0; }
  .login .logo .mark svg,
  .login .logo .mark img {
    display: block; width: 62px; height: 62px; border-radius: 15px;
    box-shadow: 0 6px 16px rgba(76, 77, 220, 0.22);
  }
  .login .logo h1 { font-size: 20px; margin: 0 0 4px; }
  .login .logo p { color: var(--hint); font-size: 13px; margin: 0; }
  .login-form { margin-bottom: 22px; }
  .login-form .btn { margin-top: 4px; }
  .login-tip { text-align: center; color: var(--hint); font-size: 12px; margin-top: 10px; line-height: 1.5; }
  .account-actions { display: flex; gap: 8px; margin: 4px 0 6px; }

  .notice-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; display: flex; gap: 9px; align-items: flex-start; }
  .notice-item.unread { border-left: 3px solid var(--brand); }
  .stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
  .stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
  .stat-card .num { font-size: 26px; font-weight: 700; color: var(--brand); }
  .stat-card .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .empty { text-align: center; color: var(--hint); font-size: 12px; padding: 18px 0; }
  /* 日期选择器 */
  .cal { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
  .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
  .cal-head .nav { padding: 4px 12px; cursor: pointer; color: var(--brand); }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .cal-grid .wd { text-align: center; font-size: 11px; color: var(--hint); padding: 4px 0; }
  .cal-grid .d { text-align: center; font-size: 13px; padding: 7px 0; border-radius: 8px; cursor: pointer; }
  .cal-grid .d.off { color: #ccc; }
  .cal-grid .d.today { border: 1px solid var(--brand); }
  .cal-grid .d.sel { background: var(--brand); color: #fff; font-weight: 600; }
  .cal-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
  .cal-quick .qk { font-size: 12px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; color: var(--text); }
  .cal-quick .qk.on { background: var(--brand); color: #fff; border-color: var(--brand); }
  /* 聊天多选 */
  .msg.selectable .bubble { cursor: pointer; }
  .msg.selected .bubble { outline: 2px solid var(--brand); outline-offset: 1px; }
  .select-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; align-items: center; z-index: 60; }
  .recalled { color: var(--hint); font-style: italic; font-size: 13px; }
  /* 延期申请 */
  .extend-card { background: #fff8e6; border: 1px solid #ecd9a0; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
  .extend-card .ext-actions { display: flex; gap: 8px; margin-top: 8px; }
  .carry-tag { display: inline-block; background: #eaf2ff; color: var(--brand); font-size: 10px; padding: 1px 7px; border-radius: 8px; margin-left: 4px; }
  /* 周报 */
  .report-bar { background: linear-gradient(135deg, var(--brand), #5c92f0); color: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; }
  .report-bar .big { font-size: 34px; font-weight: 700; line-height: 1; }
  .report-bar .lbl { font-size: 12px; opacity: .85; margin-top: 4px; }
  .report-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .report-row:last-child { border-bottom: none; }
  .progress-wrap { flex: 1; height: 8px; background: var(--gray-light); border-radius: 4px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 4px; background: var(--brand); }
  .ai-box { background: #eaf2ff; border: 1px solid #d9e7ff; border-radius: 12px; padding: 12px; font-size: 13px; margin-top: 10px; white-space: pre-wrap; line-height: 1.7; }
  /* AI 周报结构块 */
  .rp-block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-top: 10px; }
  .rp-block .rp-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
  .rp-member { padding: 8px 0; border-bottom: 1px dashed var(--line); }
  .rp-member:last-child { border-bottom: none; }
  .rp-member .rp-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
  .rp-member .rp-works { font-size: 12px; color: var(--muted); line-height: 1.8; padding-left: 4px; }
  .rp-member .rp-works li { margin: 1px 0; }
  .rp-item { font-size: 12px; line-height: 1.8; padding: 3px 0 3px 4px; }
  .rp-next { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line); }
  .rp-next:last-child { border-bottom: none; }
  .member-bar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
  .member-bar .m-stats { flex: 1; font-size: 11px; color: var(--muted); line-height: 1.6; }
  .member-bar .m-num { font-weight: 700; font-size: 14px; color: var(--text); }

  /* ===== 桌面端宽屏适配（电脑浏览器） ===== */
  /* ===== v1.1 框架增强：安全区 / 图标 / FAB / Toast / 深色 ===== */
  /* 安全区：刘海屏与手势条不再压住顶栏和 Tab */
  .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .tabbar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .chat-input { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .select-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  /* 底部 Tab：真图标 + 命中区 */
  .tab { padding: 6px 0 5px; }
  .tab .tab-ico { font-size: 0; line-height: 0; margin-bottom: 3px; display: block; }
  .tab .tab-ico svg { display: inline-block; vertical-align: middle; }
  .tab.active .tab-ico svg { stroke-width: 2.3; }

  /* 全局创建按钮 */
  .fab {
    position: fixed; z-index: 55; width: 56px; height: 56px; border-radius: 50%;
    right: max(16px, calc(50vw - 215px + 16px));
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, #2f70e0, #4a87ef); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 6px 20px rgba(47,112,224,.38);
  }
  .fab:active { transform: scale(.94); }
  @media (min-width: 768px) { .fab { right: max(16px, calc(50vw - 480px + 24px)); } }

  /* 给 FAB 留出安全距离，避免最后一条被悬浮按钮压住 */
  .content { padding-bottom: 96px; }

  /* Toast */
  .toast {
    position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
    background: rgba(35,35,43,.95); color: #fff; font-size: 13px; line-height: 1.45;
    padding: 10px 16px; border-radius: 10px; max-width: 78vw; text-align: center;
    transition: opacity .2s ease, transform .2s ease; z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }
  .toast.error { background: rgba(198,54,50,.96); }
  .toast.success { background: rgba(20,130,82,.96); }

  /* 操作表（长按菜单） */
  .action-sheet {
    width: 100%; max-width: 430px; background: var(--card);
    border-radius: 16px 16px 0 0; padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    animation: sheetUp .18s ease;
  }
  @keyframes sheetUp { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
  .action-sheet .as-title { font-size: 12px; color: var(--hint); text-align: center; padding: 10px 16px 8px; border-bottom: 1px solid var(--line); word-break: break-all; }
  .action-sheet .as-item { padding: 15px 20px; font-size: 15px; text-align: center; cursor: pointer; border-bottom: 1px solid var(--line); }
  .action-sheet .as-item:last-child { border-bottom: none; }
  .action-sheet .as-item:active { background: var(--gray-light); }
  .action-sheet .as-danger { color: var(--red); }
  .action-sheet .as-cancel { color: var(--muted); border-top: 8px solid var(--bg); }

  /* 确认弹窗 */
  .confirm-modal { border-radius: 16px 16px 0 0; }
  .btn.danger { background: var(--red); color: #fff; border-color: var(--red); }

  /* 今日工作台 */
  .today-head { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
  .today-head .td-date { font-size: 13px; color: var(--muted); }
  .today-head .td-num { font-size: 22px; font-weight: 700; margin-top: 2px; }
  .today-head .td-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .today-sec { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 2px 7px; display: flex; align-items: center; gap: 6px; }
  .today-sec .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
  .today-item { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; }
  .today-item .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
  .today-item .tick:active { background: var(--brand-light); border-color: var(--brand); }
  .today-item .ti-main { flex: 1; min-width: 0; }
  .today-item .ti-title { font-size: 14px; line-height: 1.45; }
  .today-item .ti-title.done { text-decoration: line-through; color: var(--hint); }
  .today-item .ti-meta { font-size: 11px; color: var(--hint); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .today-item.overdue { border-left: 3px solid var(--red); }

  /* 骨架屏 */
  .sk { background: linear-gradient(90deg, #eceef6 25%, #f5f7fc 37%, #eceef6 63%); background-size: 400% 100%; animation: skShine 1.2s ease infinite; border-radius: 8px; }
  @keyframes skShine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
  .sk-card { height: 58px; margin-bottom: 8px; border-radius: 12px; }
  .sk-line { height: 12px; margin-bottom: 8px; }

  /* 任务详情：属性 pills + 底部主操作 */
  .pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
  .pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 6px 11px; border-radius: 999px; background: var(--gray-light); color: var(--text); border: 1px solid transparent; cursor: pointer; }
  .pill:active { border-color: var(--brand); }
  .pill.warn { background: var(--red-light); color: var(--red); }
  .detail-actions {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 430px;
    display: flex; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--card); border-top: 1px solid var(--line); z-index: 60;
  }
  @media (min-width: 768px) { .detail-actions { max-width: 960px; } }
  .detail-actions .btn { flex: 1; }
  .detail-pad { padding-bottom: 84px; }

  /* 搜索页 */
  .search-input-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
  .search-input-row input { flex: 1; border: 1px solid var(--line); border-radius: 22px; padding: 10px 16px; font-size: 14px; background: var(--card); }
  .search-group { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 2px 7px; }

  /* 聊天视口自适应：键盘弹出时用 visualViewport 的真实高度，避免输入框被遮挡 */
  .chat-view { height: calc(var(--app-vh, 100vh) - 56px); }
  .chat-view.selecting { height: calc(var(--app-vh, 100vh) - 116px); }

  /* 下拉刷新指示器 */
  .ptr {
    position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
    width: 32px; height: 32px; border-radius: 50%; background: var(--card);
    box-shadow: 0 2px 12px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center;
    z-index: 70; opacity: 0; transition: opacity .15s ease; pointer-events: none;
  }
  .ptr.show { opacity: 1; }
  .ptr .spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: ptrspin .7s linear infinite; }
  @keyframes ptrspin { to { transform: rotate(360deg); } }

  /* 聊天：引用条 / 加载更早 / @高亮 */
  .reply-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--brand-light); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
  .reply-bar .rb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reply-bar .rb-close { color: var(--muted); flex: none; padding: 0 4px; cursor: pointer; }
  .load-older { text-align: center; font-size: 12px; color: var(--brand); padding: 10px 0 6px; cursor: pointer; }
  /* v1.4：更早消息来自本机存档时的提示条 */
  
  .archive-note.gap-note { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-line); border-style: solid; }
  /* v1.4.7 附件到期占位：只留文件名与提示，不显示坏图/空链接 */
  .att-expired { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); background: var(--gray-light); line-height: 1.5; }
  .msg.mine .att-expired { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.12); }
  .quote-in-bubble { border-left: 3px solid rgba(255,255,255,.55); padding: 2px 8px; margin-bottom: 5px; font-size: 12px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .msg:not(.mine) .quote-in-bubble { border-left-color: var(--brand); color: var(--muted); }
  .at-me { color: var(--brand); font-weight: 600; }
  .msg.mine .at-me { color: #fff; text-decoration: underline; }

  /* ===== v1.3 新增组件 ===== */
  /* 图片大图预览 */
  .img-preview { position: fixed; inset: 0; background: rgba(0,0,0,.93); z-index: 400; display: flex; align-items: center; justify-content: center; }
  .img-preview img { max-width: 100vw; max-height: 88vh; }
  .img-preview .ip-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; }
  .img-preview .ip-hint { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); color: rgba(255,255,255,.6); font-size: 12px; }

  /* 日历视图 */
  .cal-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
  .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .cal-head .m { font-weight: 600; font-size: 15px; }
  .cal-weekday { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 11px; color: var(--hint); margin-bottom: 4px; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .cal-cell { min-height: 56px; border-radius: 8px; background: var(--bg); border: 1px solid transparent; padding: 4px 3px; font-size: 11px; cursor: pointer; overflow: hidden; }
  .cal-cell.other { opacity: .32; }
  .cal-cell.today { border-color: var(--brand); }
  .cal-cell .d { font-weight: 600; font-size: 12px; }
  .cal-cell .dots { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 3px; }
  .cal-cell .dots i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
  .cal-cell .n { font-size: 10px; color: var(--muted); }

  /* 表情回应 */
  .reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
  .reaction { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--gray-light); cursor: pointer; border: 1px solid transparent; }
  .reaction.me { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
  .emoji-bar { display: flex; gap: 12px; justify-content: center; padding: 10px 0 2px; }
  .emoji-bar .e { font-size: 26px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
  .emoji-bar .e:active { background: var(--gray-light); }

  /* 审计时间线 */
  .audit-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
  .audit-item:last-child { border-bottom: none; }
  .audit-item .at { color: var(--hint); font-size: 11px; flex: none; width: 62px; }
  .audit-item .ab { flex: 1; }

  /* 任务多选 */
  .task-select-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 430px; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: center; z-index: 60; }
  @media (min-width: 768px) { .task-select-bar { max-width: 960px; } }

  /* 引导卡 */
  .onboard { background: var(--brand-light); border: 1px solid var(--brand); border-radius: 14px; padding: 14px; margin-bottom: 12px; font-size: 13px; }
  .onboard .ob-step { display: flex; gap: 8px; align-items: flex-start; margin: 7px 0; color: var(--text); }

  /* 深色模式（跟随系统） */
  /* 深色模式：由 JS 解析「跟随系统/浅色/深色」后写到 <html data-theme="dark">，
     这样既能跟随系统，也能手动切换（原 @media 方案无法手动覆盖）。 */
  html[data-theme="dark"] {
    --bg: #14151c; --card: #1d1e27; --text: #eceef6; --muted: #a6a8bd; --hint: #7b7d93;
    --line: #2c2e3c; --gray-light: #262835; --brand: #8fb4ff; --brand-deep: #b7ceff; --brand-light: #1b3566;
    /* 语义色：深色下改为低亮度底 + 高亮度字，避免横幅/chip 变成刺眼白块 */
    --danger-bg: #3a1d1d; --danger-fg: #ff9a92; --danger-line: #c0392f;
    --warn-bg: #3a2c14; --warn-fg: #ffc06a; --warn-line: #b26a00;
    --neutral-bg: #262835; --neutral-fg: #a6a8bd;
  }
  html[data-theme="dark"] body { background: #0d0e13; }
  html[data-theme="dark"] #app { box-shadow: none; }
  html[data-theme="dark"] .field input,
  html[data-theme="dark"] .field textarea,
  html[data-theme="dark"] .field select { background: #232530; color: var(--text); }
  /* 表单与分段控件：原样式写死了浅色底，暗色下会"白块刺眼" */
  html[data-theme="dark"] .search-box input,
  html[data-theme="dark"] .chat-input input,
  html[data-theme="dark"] #cmtInput,
  html[data-theme="dark"] .search-filters select { background: #232530; color: var(--text); border-color: var(--line); }
  html[data-theme="dark"] .seg { background: #232530; border-color: var(--line); }
  html[data-theme="dark"] .seg-item.on,
  html[data-theme="dark"] .seg .opt.on { background: #234070; color: #b7ceff; box-shadow: none; }
  html[data-theme="dark"] .bubble { background: #262835; }
  html[data-theme="dark"] .msg.mine .bubble { background: var(--brand); }
  html[data-theme="dark"] .notice-item.unread { background: rgba(47,112,224,.16); }
  html[data-theme="dark"] .action-sheet .as-item:active { background: #262835; }
  html[data-theme="dark"] .today-item,
  html[data-theme="dark"] .task-card,
  html[data-theme="dark"] .list-item { border-color: var(--line); }
  html[data-theme="dark"] .sk { background: linear-gradient(90deg, #22242f 25%, #2a2c38 37%, #22242f 63%); background-size: 400% 100%; }

  @media (min-width: 768px) {
    #app { max-width: 960px; }
    .tabbar { max-width: 960px; }
    .content { max-width: 960px; margin: 0 auto; }
    .chat-view { max-width: 960px; margin: 0 auto; width: 100%; }
    .msg > div { max-width: 520px; }
    .quad-grid { grid-template-columns: 1fr 1fr; }
    /* 弹窗在桌面端居中显示，圆角四周 */
    .modal-mask { align-items: center; padding: 24px; }
    .modal { border-radius: 18px; }
    .action-sheet { border-radius: 16px; }
  }
