/* 墨蓝标识工作区，矿物青用于操作；警示与完成同时用颜色和文字标记。 */
:root {
  --navy: #183748;
  --nav-text: #d3e5e9;
  --primary: #08686c;
  --primary-hover: #075357;
  --primary-soft: #e3f2ef;
  --ink: #193540;
  --muted: #52666d;
  --line: #d5e0df;
  --inset: #f0f5f4;
  --bg: #f4f7f6;
  --success: #236643;
  --success-soft: #e7f4e9;
  --amber: #85550a;
  --amber-soft: #fff2d9;
  --red: #a5392b;
  --red-soft: #ffede6;
  --mobile-nav-height: 66px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover { border-color: #94b1b1; background: #f0f6f5; }
button:disabled { cursor: default; opacity: .5; }
button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
button.primary:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
button.danger { color: var(--red); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #aebfbe;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
textarea { min-height: 88px; resize: vertical; }
label { display: block; margin: 15px 0 7px; color: var(--muted); font-size: 13px; }
h1, h2, h3 { color: var(--ink); overflow-wrap: anywhere; }
h1 { margin: 8px 0; font-size: 28px; line-height: 1.35; letter-spacing: -.4px; }
h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.45; }
h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.5; }
p { line-height: 1.7; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { display: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.stack { margin-top: 20px; }
.panel, .task, .card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--inset); color: var(--muted); }
.error { color: var(--red); line-height: 1.7; overflow-wrap: anywhere; }

/* 桌面导航、个人入口与日期。 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 232px;
  padding: 30px 20px 24px;
  border-right: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
}
.brand { flex: 0 0 auto; color: var(--ink); font-size: 21px; font-weight: 750; line-height: 1.4; white-space: nowrap; }
.brand i, .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  margin-right: 9px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-style: normal;
  vertical-align: middle;
}

.sidebar .brand, .login .brand { color: #fff; }
.sidebar .brand-mark, .login .brand-mark { background: #a0e1d2; color: var(--navy); }
.sidebar :focus-visible { outline: 3px solid #a0e1d2; outline-offset: -3px; }
.subtitle { margin: 16px 0 26px; color: var(--nav-text); font-size: 12px; }
.nav { min-height: 0; overflow-y: auto; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 5px 0;
  padding: 13px 12px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  color: var(--nav-text);
}
.nav button:hover { background: #254858; color: #fff; }
.nav button.active { background: #c6eee2; color: var(--navy); font-weight: 700; }
.nav-symbol { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
.nav-symbol svg { display: block; width: 22px; height: 22px; }
.nav button.nav-more { display: none; }
.profile { flex: 0 0 auto; margin-top: auto; padding-top: 18px; border-top: 1px solid #40616e; }
.profile > div:first-child { overflow-wrap: anywhere; }
.profile .stack { margin-top: 8px; }
.profile > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.profile .muted { color: var(--nav-text); }
.profile button { padding: 9px 12px; border-color: #567480; background: transparent; color: #eff8f7; font-size: 12px; }
.profile button:hover { background: #254858; }
.main { min-width: 0; max-width: 1500px; margin-left: 232px; padding: 32px 40px; }
.header { align-items: flex-start; gap: 22px; }
.header h1 { margin: 6px 0 8px; font-size: 32px; line-height: 1.25; letter-spacing: -.025em; }
.pageintro { display: block; max-width: 540px; line-height: 1.6; }
.datebar { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.datebar input { width: 164px; text-align: center; }
.datebar button { flex: 0 0 auto; padding: 10px 12px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 20px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.week button { min-width: 0; padding: 10px 4px; border-color: transparent; background: transparent; font-size: 13px; color: var(--muted); }
.week button:hover { background: var(--primary-soft); }
.week button.current { background: var(--navy); color: #fff; font-weight: 700; }
.week .small { display: block; margin-bottom: 4px; font-size: 12px; }
.syncbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 12px 0 18px; color: var(--muted); font-size: 13px; }
#syncstatus { min-width: 0; overflow-wrap: anywhere; }
.sync-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sync-actions button { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
#content { min-width: 0; }
.footer { margin: 26px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* 统计、完成进度与持续可见的照片入口。 */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 12px; }
.card {
  --card-tone: var(--ink);
  --card-soft: var(--inset);
  padding: 17px 18px;
}
.card-total { --card-tone: #305267; --card-soft: #e6eef1; }
.card-complete { --card-tone: var(--success); --card-soft: var(--success-soft); }
.card-pending { --card-tone: var(--amber); --card-soft: var(--amber-soft); }
.card-late { --card-tone: var(--red); --card-soft: var(--red-soft); }
.cards button.card { border-color: transparent; background: var(--card-soft); color: var(--ink); text-align: left; }
.cardlabel { display: block; font-weight: 650; color: var(--card-tone); font-size: 13px; line-height: 1.5; }
.card .number { margin: 8px 0; color: var(--card-tone); font-size: 35px; font-weight: 740; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card > .small { color: var(--muted); line-height: 1.6; }
.cards button.card:hover { border-color: var(--card-tone); background: var(--card-soft); }
.cards button.card[aria-pressed="true"] { border-color: var(--card-tone); background: var(--card-soft); box-shadow: inset 0 0 0 1px var(--card-tone); }
.day-progress { margin: 14px 2px 20px; color: var(--muted); }
.day-progress .row { margin-bottom: 8px; }
.day-progress .row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.day-progressbar { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 8px; background: #d6e4df; color: var(--success); appearance: none; }
.day-progressbar::-webkit-progress-bar { border-radius: 8px; background: #d6e4df; }
.day-progressbar::-webkit-progress-value { border-radius: 8px; background: var(--success); }
.day-progressbar::-moz-progress-bar { border-radius: 8px; background: var(--success); }
.progress { height: 7px; overflow: hidden; border-radius: 8px; background: #d6e4df; }
.progress i { display: block; width: var(--progress, 0%); height: 100%; background: var(--success); }
.records-link { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 16px 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: #eaf2f1; color: var(--ink); font-size: 14px; line-height: 1.65; }
.records-link > span { min-width: 0; overflow-wrap: anywhere; }
.records-link p { margin: 0; }
.records-link button { flex: 0 0 auto; border-color: #b4d8d5; background: var(--primary-soft); color: var(--primary); font-weight: 650; }

/* 通知可折叠，草稿、断网和冲突信息仍保持显著。 */
.hero { margin: 18px 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.hero h2 { margin-bottom: 6px; }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.hero.personnel-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.banner { margin: 16px 0; padding: 14px 18px; border: 1px solid #e4c588; border-radius: 12px; background: var(--amber-soft); color: var(--amber); line-height: 1.7; overflow-wrap: anywhere; }
#connectionnotice { font-size: 13px; }
details.banner { padding: 0 16px; }
details.banner > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 0; list-style: none; font-size: 13px; cursor: pointer; }
details.banner > summary::-webkit-details-marker { display: none; }
details.banner > summary::before { content: "▸"; flex: 0 0 auto; font-size: 15px; }
details.banner[open] > summary::before { transform: rotate(90deg); }
details.banner > summary > b { flex: 1 1 auto; font-weight: 650; }
details.banner > summary > span { flex: 0 0 auto; font-size: 12px; }
details.banner[open] > summary { border-bottom: 1px solid #e4c588; }
.overdue-banner { border-color: #edbdb0; background: var(--red-soft); color: var(--red); }
details.overdue-banner[open] > summary { border-bottom-color: #edbdb0; }
.overdue-list { padding: 3px 0 10px; }
.overdue-list p { margin: 10px 0; }
.calendar-notice p { margin: 10px 0 14px; font-size: 13px; }
#draftresume .banner { font-size: 13px; }
#draftresume button { margin: 6px 6px 0 0; }

/* 同一次提交可跨页面继续，逐条标明服务器回执和待处理情况。 */
#backgrounduploads { border-color: var(--line); background: #fff; color: var(--ink); }
#backgrounduploads ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
#backgrounduploads li { padding: 8px 12px; border-inline-start: 3px solid currentColor; border-radius: 0 6px 6px 0; background: var(--inset); color: var(--muted); font-size: 14px; font-weight: 650; }
#backgrounduploads .upload-uploading, #backgrounduploads .upload-confirming { color: var(--primary-hover); background: var(--primary-soft); }
#backgrounduploads .upload-completed { color: var(--success); background: var(--success-soft); }
#backgrounduploads .upload-paused { color: var(--red); background: var(--red-soft); }
#backgrounduploads p { margin: 9px 0 0; color: var(--muted); }

/* 项目以单条记录排列，长名称可完整阅读。 */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0 16px; }
.toolbar input, .toolbar select { max-width: 260px; }
.taskgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.task { padding: 22px; }
.task h3 { line-height: 1.6; }
.taskmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.task .row.actions { justify-content: flex-start; gap: 8px; }
.task .extension { margin-top: 9px; color: var(--amber); font-size: 12px; }
.taskgrid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task-group { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); background: #e5eeed; color: var(--muted); font-size: 13px; }
.task-group:first-child { border-top: 0; }
.deadline-time { color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.deadline-count { font-size: 12px; font-variant-numeric: tabular-nums; }
.tasktile { display: grid; position: relative; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; min-width: 0; min-height: 88px; padding: 17px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; text-align: left; }
.tasktile:hover { background: #f0f6f5; }
.tasktile:focus-visible { outline-offset: -3px; }
.tilehead { display: contents; }
.taskicon { display: flex; grid-column: 1; grid-row: 1 / 3; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--inset); color: var(--muted); }
.taskicon svg { width: 20px; height: 20px; }
.tasktile .badge { grid-column: 3; grid-row: 1 / 3; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.task-state-done .taskicon { background: var(--success-soft); color: var(--success); }
.task-state-late .taskicon { background: var(--red-soft); color: var(--red); }
.task-state-pending .taskicon { background: var(--amber-soft); color: var(--amber); }
.tilename { display: block; grid-column: 2; grid-row: 1; min-width: 0; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.tilemeta { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.tilepeople { color: #455e66; }
.tilehint { display: none; }
.tilehint.notice { display: block; grid-column: 2 / -1; color: var(--amber); font-size: 12px; line-height: 1.6; }
.project-info { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--inset); overflow-wrap: anywhere; }
.project-actions { justify-content: flex-start; margin-top: 18px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photos img { width: 90px; height: 76px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; cursor: pointer; }
.empty { grid-column: 1 / -1; padding: 44px 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted); text-align: center; line-height: 1.7; overflow-wrap: anywhere; }
.taskgrid.compact > .empty { border: 0; border-radius: 0; }
.empty p { margin: 0 0 12px; }
.task-empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.task-empty-actions button { min-width: 110px; }

/* 汇总照片、表格和管理。表格自身滚动，页面不横向扩展。 */
.record-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.record-controls input { flex: 1 1 240px; max-width: none; }
.record-controls select { flex: 0 1 200px; width: auto; max-width: none; }
.report-list { min-width: 0; }
.panel.report-list { padding: 0; border: 0; background: transparent; }
.report-item { margin: 0 0 16px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; scroll-margin-top: 18px; overflow-wrap: anywhere; }
.report-item:last-child { margin-bottom: 0; }
.report-item h3 { margin: 0; line-height: 1.6; }
.report-item > hr { display: none; }
.report-item p { margin: 12px 0; }
.report-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.report-photos figure { min-width: 0; margin: 0; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--inset); }
.report-photos img { display: block; width: 100%; max-height: 320px; border-radius: 6px; object-fit: contain; cursor: pointer; }
.report-photos figcaption { padding: 8px 2px 2px; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.report-export { margin: 20px 0; padding: 8px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.report-export > summary { min-height: 44px; padding: 10px 0; color: var(--ink); font-weight: 650; line-height: 1.6; cursor: pointer; }
.report-export .toolbar { margin: 12px 0 10px; }
.section-title { margin: 28px 0 16px; }
.tablewrap { width: 100%; min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-weight: 650; white-space: nowrap; }
td .badge { white-space: nowrap; }
.settingsgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; margin: 5px 0; color: var(--ink); overflow-wrap: anywhere; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-event { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.personbuttons { display: flex; flex-wrap: wrap; gap: 7px; min-width: 200px; }
.personbuttons button { padding: 8px 10px; font-size: 12px; }
.affected-list { max-height: 180px; margin-top: 15px; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 1.9; }
input.assigncheck { width: 22px; height: 22px; cursor: pointer; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.management-grid button { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 88px; padding: 15px; background: var(--inset); text-align: left; white-space: normal; overflow-wrap: anywhere; }
.menu-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.menu-icon svg { display: block; width: 22px; height: 22px; }
.menu-copy { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.menu-copy b { font-size: 14px; }
.menu-copy .small { font-weight: 400; line-height: 1.6; }
.menu-arrow { color: var(--muted); }

/* 登录、弹窗与相机。 */
.login { width: min(450px, calc(100% - 32px)); margin: clamp(28px, 10vh, 105px) auto; padding-bottom: 24px; }
.login .panel { padding: 32px; border-top: 0; border-radius: 0 0 16px 16px; box-shadow: 0 14px 30px #173b460d; }
.login .brand {
  display: flex;
  position: relative;
  align-items: center;
  overflow: hidden;
  padding: 23px 32px;
  border-radius: 16px 16px 0 0;
  background: var(--navy);
}
.login .brand::after {
  content: "";
  position: absolute;
  inset: 0 0 0 64%;
  background: repeating-linear-gradient(127deg, transparent 0 14px, #49737c 14px 16px, transparent 16px 24px);
  opacity: .55;
  pointer-events: none;
}
.login h1 { margin: 0 0 12px; font-size: 24px; }
.login-lead { margin: 0 0 24px; font-size: 14px; }
.login form > button { width: 100%; margin-top: 22px; font-weight: 650; }
.login .login-footnote { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); line-height: 1.8; }
#loginerror:empty { margin-top: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 80px; }
.login .password-field #togglepassword { position: absolute; right: 4px; top: 50%; width: auto; min-height: 40px; margin: 0; padding: 8px 10px; transform: translateY(-50%); border: 0; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
dialog {
  --dialog-padding: 24px;
  width: min(620px, 94vw);
  max-height: calc(100vh - 40px);
  padding: var(--dialog-padding);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 80px #18374830;
}
dialog.wide { width: min(960px, 94vw); }
dialog::backdrop { background: #18374880; }
dialog.camera-dialog { overflow: auto; }
video { display: block; width: 100%; max-height: 44vh; margin: 16px 0; border-radius: 10px; background: #183748; }
.fullphoto { display: block; max-width: 100%; max-height: 70vh; margin: 16px auto; }
.camera-step { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--primary-soft); color: var(--primary-hover); font-size: 13px; line-height: 1.65; }
.camera-step p { margin: 0; }
.camera-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.camera-controls select { max-width: 210px; }
.camera-controls button { min-height: 48px; }
.camera-controls #shutter { font-weight: 650; }
#draftstatus { margin: 10px 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#draftstatus.error { color: var(--red); }
#submissionstatus, #noteconflict { font-size: 13px; line-height: 1.7; }
#noteconflict button { margin: 8px 6px 0 0; white-space: normal; }
.capture-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.capture-list figure { width: 120px; min-width: 0; margin: 0; }
.capture-list img { display: block; width: 100%; height: 100px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; }
.capture-list figcaption { margin: 6px 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.capture-list button { min-height: 44px; padding: 8px 10px; font-size: 12px; }
.camera-footer { position: sticky; bottom: calc(-1 * var(--dialog-padding)); z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px calc(-1 * var(--dialog-padding)) calc(-1 * var(--dialog-padding)); padding: 14px var(--dialog-padding); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 18px #18374808; }
.camera-footer button { flex: 1 1 auto; min-height: 46px; font-size: 14px; }
#toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; width: max-content; max-width: min(600px, 92vw); padding: 13px 20px; transform: translateX(-50%); border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; box-shadow: 0 4px 18px #18374822; }
dialog #toast { position: sticky; top: 0; left: auto; bottom: auto; z-index: 6; width: auto; max-width: none; margin: 0 0 16px; transform: none; }
.print-only { display: none; }

/* 宽屏工作区：清单与工具提醒并排，统计始终跨整栏。 */
@media screen and (min-width: 1200px) {
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(305px, 25vw, 375px);
    align-items: start;
    gap: 22px;
  }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench > * { min-width: 0; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks { grid-area: 1 / 1; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-notices { grid-area: 1 / 2; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-notices .tool-expiry-home { margin-top: 0; padding: 17px 16px; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-notices .tool-expiry-recent { grid-template-columns: minmax(0, 1fr); }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks .week { margin-top: 0; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks .taskgrid.compact { grid-template-columns: minmax(0, 1fr); }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks .toolbar input { flex: 1 1 160px; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks .toolbar select { width: auto; }
  .main:is([data-view="tasks"], [data-view="overview"]) .workbench-tasks .toolbar #notify { font-size: 13px; }
}

/* 平板：保留桌面入口，内容收为单列。 */
@media (max-width: 1050px) {
  .sidebar { width: 190px; padding: 26px 14px 20px; }
  .brand { font-size: 19px; }
  .brand i, .brand-mark { width: 32px; height: 32px; margin-right: 7px; font-size: 20px; }
  .main { margin-left: 190px; padding: 26px; }
  .taskgrid, .taskgrid.compact, .settingsgrid { grid-template-columns: minmax(0, 1fr); }
  .header { gap: 16px; }
  .header h1 { font-size: 26px; }
  .cards { gap: 10px; }
  .card { padding: 16px 13px; }
}

/* 管理页面不使用日期筛选，保留绑定节点并收起无关的周历。 */
.main[data-view="people"] .datebar,
.main[data-view="people"] .week,
.main[data-view="settings"] .datebar,
.main[data-view="settings"] .week,
.main[data-view="approvals"] .datebar,
.main[data-view="approvals"] .week { display: none; }

/* 手机：四个主入口、双列统计、单列项目，以及安全区。 */
@media (max-width: 650px) {
  body { padding-bottom: 86px; padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 20px); }
  input, select, textarea { font-size: 16px; }
  .sidebar { position: static; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; width: 100%; padding: 15px 16px; padding-top: calc(15px + env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-right: 0; border-bottom: 1px solid var(--navy); }
  .brand { font-size: 17px; }
  .brand i, .brand-mark { width: 30px; height: 30px; margin-right: 7px; font-size: 19px; border-radius: 9px; }
  .subtitle { display: none; }
  .profile { display: flex; flex: 1 1 144px; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
  .profile > div:first-child { min-width: 0; font-size: 13px; }
  .profile .small { display: none; }
  .profile > div:last-child { flex: 0 0 auto; gap: 4px; margin: 0; }
  .profile button { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .profile #changepwd { display: inline-block; }
  .nav { position: fixed; z-index: 40; inset: auto 0 0; display: flex; align-items: stretch; justify-content: space-around; gap: 4px; margin: 0; padding: 6px 8px; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); overflow: visible; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -4px 18px #18374806; }
  .nav button { display: flex; color: var(--muted); flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: auto; min-width: 0; max-width: 150px; min-height: 52px; margin: 0; padding: 5px 2px; border-radius: 10px; font-size: 12px; line-height: 1.3; text-align: center; white-space: normal; }
  .nav button:hover { background: var(--inset); color: var(--ink); }
  .nav button.active { background: var(--primary-soft); color: var(--primary-hover); }
  .nav button:focus-visible { outline-color: var(--primary); }
  .nav button[data-nav-tier="secondary"] { display: none; }
  .nav button.nav-more { display: flex; }
  .nav-symbol { margin: 0; }
  .main { margin: 0; padding: 18px 16px 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .header { display: block; }
  .header h1 { margin: 0 0 6px; font-size: 24px; }
  .pageintro { font-size: 12px; }
  .datebar { width: 100%; gap: 6px; margin-top: 14px; padding: 0; }
  .datebar input { flex: 1 1 0; width: 0; min-width: 0; max-width: 200px; padding: 9px 5px; font-size: 16px; }
  .datebar button { min-width: 44px; padding: 9px 10px; }
  .week { gap: 3px; margin: 14px 0 10px; }
  .week button { min-height: 54px; padding: 7px 1px; font-size: 12px; }
  .week .small { font-size: 11px; }
  .week-date { display: block; font-size: 16px; font-weight: 650; line-height: 1.25; white-space: nowrap; }
  .syncbar { flex-wrap: nowrap; gap: 8px; margin: 10px 0 16px; font-size: 12px; }
  #syncstatus { flex: 1 1 0; }
  .sync-actions { flex: 0 0 auto; gap: 6px; }
  .sync-actions button { padding: 8px 10px; font-size: 13px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
  .cards .card, .cards button.card { min-height: 88px; padding: 14px 16px; border-radius: 12px; text-align: left; }
  .cardlabel { font-size: 13px; line-height: 1.5; }
  .card .number { margin: 8px 0 0; font-size: 28px; }
  .card > .small { display: none; }
  .day-progress { margin: 14px 0 16px; }
  .records-link { gap: 10px; margin: 14px 0; padding: 13px; font-size: 13px; }
  .records-link button { flex: 1 1 150px; font-size: 14px; }
  .banner { margin: 12px 0; padding: 12px 14px; font-size: 13px; }
  details.banner { padding: 0 13px; }
  details.banner > summary { gap: 8px; font-size: 13px; }
  details.banner > summary > span { font-size: 11px; }
  .hero { padding: 18px; margin: 16px 0; }
  .hero.personnel-hero { display: flex; gap: 12px; }
  .hero.personnel-hero h2 { font-size: 18px; }
  .hero.personnel-hero > button { width: 100%; }
  .toolbar { display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 8px; margin: 16px 0 12px; }
  .toolbar input, .toolbar select { width: 100%; max-width: none; padding: 10px 8px; font-size: 16px; }
  .toolbar #notify { display: none; }
  .taskgrid, .taskgrid.compact { grid-template-columns: minmax(0, 1fr); }
  .taskgrid.compact { gap: 0; }
  .task-group { padding: 12px; }
  .tasktile { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 5px 9px; min-height: 84px; padding: 15px 12px; }
  .taskicon { width: 30px; height: 30px; }
  .taskicon svg { width: 19px; height: 19px; }
  .tilename { font-size: 15px; line-height: 1.55; }
  .tilemeta { font-size: 12px; }
  .tasktile .badge { padding: 5px 7px; font-size: 11px; }
  .panel, .task { padding: 18px; }
  .empty { padding: 32px 16px; font-size: 14px; }
  .task-empty-actions { gap: 8px; margin-top: 14px; }
  .task-empty-actions button { flex: 1 1 110px; font-size: 14px; }
  .project-actions button { width: 100%; padding: 12px; }
  .record-controls { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 8px; margin: 14px 0; }
  .record-controls input, .record-controls select { width: 100%; padding: 10px 8px; font-size: 16px; }
  .report-item { padding: 17px; border-radius: 12px; }
  .report-item h3 { font-size: 16px; }
  .report-item .small { font-size: 13px; }
  .report-photos { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
  .report-photos img { max-height: 340px; }
  .report-export { padding: 8px 14px; }
  .toolbar.no-print { display: flex; gap: 8px; }
  .toolbar.no-print button { flex: 1 1 135px; padding: 10px 8px; font-size: 13px; }
  .settingsgrid, .formgrid { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist label { min-height: 44px; }
  th, td { padding: 12px 8px; }
  .management-grid { gap: 10px; }
  .management-grid button { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 13px; }
  .menu-icon { width: 28px; height: 28px; }
  .login { margin: 6vh auto; }
  .login .panel { padding: 26px; }
  .login .brand { padding: 19px 26px; }
  .login h1 { font-size: 23px; }
  dialog, dialog.wide { --dialog-padding: 20px; width: calc(100vw - 24px); max-height: calc(100vh - 32px); border-radius: 16px; }
  dialog h2 { font-size: 19px; }
  .camera-dialog video { max-height: 36vh; margin: 12px 0; }
  .camera-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .camera-controls select { grid-column: 1 / -1; max-width: none; }
  .camera-controls button { min-height: 50px; padding: 10px 12px; font-size: 14px; }
  .camera-controls #shutter { font-size: 16px; }
  .camera-step { margin: 10px 0; padding: 10px; }
  .capture-list figure { width: calc((100% - 12px) / 2); }
  .capture-list button { width: 100%; }
  .camera-footer { gap: 8px; margin-top: 18px; padding: 12px var(--dialog-padding); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .camera-footer button { flex: 1 1 40%; min-height: 44px; padding: 10px 8px; line-height: 1.4; }
  .camera-footer #submitphotos { flex: 1 0 100%; min-height: 48px; font-size: 16px; font-weight: 650; }
  #noteconflict button { min-height: 44px; font-size: 14px; }
  #toast { bottom: 78px; bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px); max-width: calc(100vw - 32px); padding: 12px 16px; }
  .footer { margin: 22px 0 4px; line-height: 1.7; }
}

@media (max-width: 380px) {
  .record-controls, .management-grid { grid-template-columns: minmax(0, 1fr); }
  .cards .card, .cards button.card { padding: 13px 14px; }
  .datebar input { padding-left: 2px; padding-right: 2px; }
  .camera-footer button { font-size: 13px; }
}

/* 旧浏览器继续用 vh；支持动态视口时避开地址栏与键盘占用。 */
@supports (max-height: 100dvh) {
  dialog { max-height: calc(100dvh - 40px); }
  .camera-dialog video { max-height: 40dvh; }
  @media (max-width: 650px) {
    dialog, dialog.wide { max-height: calc(100dvh - 32px); }
    .camera-dialog video { max-height: 36dvh; }
  }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}

/* 工具到期台账：独立于点检日期，危险状态同时显示明确文字。 */
.tool-expiry-home { margin: 22px 0 18px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tool-expiry-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.tool-expiry-heading > div { min-width: 0; }
.tool-expiry-heading h2 { margin: 0 0 6px; font-size: 19px; }
.tool-expiry-heading p { margin: 0; }
.tool-expiry-count { display: inline-block; margin-left: 10px; padding: 4px 8px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 12px; vertical-align: middle; }
.tool-expiry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tool-expiry-actions button { min-height: 44px; padding: 9px 12px; font-size: 13px; }
.tool-expiry-alerts, .tool-expiry-ledger { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tool-expiry-item { min-width: 0; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid #abbfbe; border-radius: 10px; background: var(--inset); overflow-wrap: anywhere; }
.tool-expiry-red { border-color: #edbdb0; border-left-color: var(--red); background: var(--red-soft); }
.tool-expiry-amber { border-color: #e4c588; border-left-color: var(--amber); background: var(--amber-soft); }
.tool-expiry-taken { color: var(--success); }
.tool-expiry-item.tool-expiry-taken { border-color: #d1e5dc; border-left-color: var(--success); background: #f4f9f6; color: var(--ink); }
details.tool-expiry-item { padding: 0; }
.tool-expiry-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-height: 44px;
  padding: 7px 12px;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}
.tool-expiry-summary::-webkit-details-marker { display: none; }
.tool-expiry-summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px 2px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.tool-expiry-item[open] > .tool-expiry-summary::after { transform: rotate(225deg); }
.tool-expiry-summary > :first-child { flex: 1 1 7em; min-width: 0; font-weight: 650; }
.tool-expiry-item[open] > .tool-expiry-summary { border-bottom: 1px solid var(--line); }
details.tool-expiry-item > p { margin-inline: 12px; }
details.tool-expiry-item > :last-child:not(summary) { margin-bottom: 10px; }
.tool-expiry-itemhead { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.tool-expiry-itemhead h3 { flex: 1 1 180px; margin: 0; font-size: 15px; line-height: 1.55; }
.tool-expiry-state { flex: 0 1 auto; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.7; }
.tool-expiry-red .tool-expiry-state { color: var(--red); }
.tool-expiry-amber .tool-expiry-state { color: var(--amber); }
.tool-expiry-item.tool-expiry-taken .tool-expiry-state { color: var(--success); }
.tool-expiry-meta, .tool-expiry-note, p.tool-expiry-taken { margin: 6px 0 0; color: #455e66; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
p.tool-expiry-taken { color: var(--success); }
.tool-expiry-item .tool-expiry-actions { margin-top: 12px; }
.tool-expiry-empty { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.tool-expiry-recent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tool-expiry-recent > h3 { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.tool-expiry-feedback { margin: 12px 0; line-height: 1.7; font-size: 13px; overflow-wrap: anywhere; }
.tool-expiry-feedback:empty { display: none; }
.tool-expiry-feedback button { margin: 6px 0 0 8px; }
.tool-expiry-ledger-controls { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 10px; margin: 16px 0 12px; }
.tool-expiry-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.tool-expiry-formgrid > div { min-width: 0; }
.tool-expiry-conflict { margin: 16px 0; padding: 15px; border: 1px solid #e4c588; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.tool-expiry-latest { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--inset); color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.tool-expiry-latest p { margin: 8px 0 0; }
.tool-expiry-dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.tool-expiry-dialog-footer button { min-height: 44px; }
.tool-expiry-view input:disabled, .tool-expiry-view textarea:disabled { color: #455e66; background: var(--inset); opacity: 1; }
.demo-banner { margin: 0 0 18px; padding: 14px 16px; border: 2px solid #c69b3c; border-radius: 12px; background: #fff5df; color: #72500d; overflow-wrap: anywhere; }
.demo-banner > b { display: block; font-size: 16px; }
.demo-banner > p { margin: 6px 0 0; font-size: 13px; line-height: 1.7; }
dialog > .demo-banner { margin-bottom: 18px; }
@media (max-width: 650px) {
  .tool-expiry-home { margin: 18px 0 16px; padding: 15px; }
  .tool-expiry-heading { gap: 10px; }
  .tool-expiry-heading h2 { font-size: 18px; }
  .tool-expiry-count { margin: 6px 0 0 6px; }
  .tool-expiry-heading > .tool-expiry-actions { width: 100%; }
  .tool-expiry-heading > .tool-expiry-actions button { flex: 1 1 130px; }
  .tool-expiry-item { padding: 12px; }
  .tool-expiry-itemhead h3 { flex-basis: 130px; }
  .tool-expiry-state { font-size: 13px; }
  .tool-expiry-recent, .tool-expiry-ledger-controls, .tool-expiry-formgrid { grid-template-columns: minmax(0, 1fr); }
  .tool-expiry-feedback button { display: block; margin-left: 0; }
  .tool-expiry-dialog-footer button { flex: 1 1 140px; padding: 11px 10px; font-size: 14px; }
  .tool-expiry-conflict { padding: 12px; }
  .tool-expiry-conflict .tool-expiry-actions button { width: 100%; }
  .demo-banner { padding: 12px; margin-bottom: 16px; }
}

/* 打印始终使用完整清单，与屏幕上的搜索、筛选无关。 */
@media print {
  body { padding: 0; background: #fff; color: #000; }
  .sidebar, .header, .week, .toolbar, .cards, .hero, .banner, .footer, #toast,
  dialog, .no-print, .syncbar, .records-link, .record-controls, .task-empty-actions,
  .day-progress, #connectionnotice { display: none !important; }
  .main { max-width: none; margin: 0; padding: 0; }
  .print-only { display: block; }
  .panel, .panel.report-list { padding: 0; border: 0; background: #fff; }
  .report-item { margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px solid #ddd; border-radius: 0; break-inside: avoid; scroll-margin-top: 0; }
  .report-item h3, .report-item p, .report-item .small { color: #000; }
  .report-photos { display: flex; flex-wrap: wrap; gap: 12px; }
  .report-photos figure { width: 30%; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; }
  .report-photos img { max-height: 250px; }
  .badge { border: 1px solid #ddd; background: #fff !important; color: #000 !important; }
  .demo-banner { border-color: #000; background: #fff; color: #000; }
}

.daily-confirmation { padding: 16px 18px; border-color: #b4d8d5; background: #eff7f5; color: var(--ink); }
.daily-confirmation > b { color: var(--primary-hover); }
.daily-confirmation p { margin: 6px 0; font-size: 13px; }
.daily-confirmation .row { margin-top: 10px; }
.daily-confirmation #dailyconfirmfeedback:empty { display: none; }
.daily-download-links { display: flex; gap: 8px; flex-wrap: wrap; }
.daily-download-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid #b4d8d5; border-radius: 9px; color: var(--primary-hover); background: #fff; font-weight: 650; text-decoration: none; }
