/* ================= 蔡蔡的钩织工作台 · 清新雅致·护眼（浅薄荷鼠尾草绿主题） =================
   配色方向（用户要求：清新雅致 + 护眼为主）：
     背景    = 浅薄荷三段渐变 #EAF4EE → #DCEDE6 → #CFE3DA（明亮柔和，不刺眼）
     卡片    = 近白薄荷 #FBFDFB → #EAF3EE（顶部高光 + 柔和绿调阴影）
     主色    = 清新鼠尾草绿 #3E9E8C（按钮/强调）
     深主色  = 深松绿 #1F6B5E（文字深/深色/导航深）
     亮绿    = #2FA98A（强调/进度）/ 浅薄荷 #6FC3AE（高光）
     文字    = 柔墨绿 #234B43（非纯黑，护眼）
     任务三级语义色：红 #E06A66 / 橙 #E89B45 / 绿 #2E9E7E（柔和但仍可区分） */
:root {
  --bg: #DCEDE6;
  --bg2: #CFE3DA;
  --card: #FBFDFB;
  --card2: #EAF3EE;
  --line: #C3D9D0;
  --main: #3E9E8C;       /* 清新鼠尾草绿 */
  --main-dark: #1F6B5E;  /* 深松绿 */
  --accent: #2FA98A;     /* 亮绿强调 */
  --accent-2: #6FC3AE;   /* 浅薄荷高光 */
  --sage: #4FA88F;
  --sage-bg: #DDEBE4;
  --jade: #2E9E7E;       /* 法翠（计数/增减点缀） */
  --text: #234B43;
  --muted: #5C7A70;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(31,107,94,.12), 0 1px 3px rgba(31,107,94,.07), inset 0 1px 0 rgba(255,255,255,.9);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", serif;
  background: linear-gradient(160deg, #EAF4EE 0%, #DCEDE6 50%, #CFE3DA 100%);
  background-attachment: fixed;
  color: var(--text); font-size: 14px; min-height: 100%;
}
.layout { display: flex; min-height: 100vh; }

/* ---------------- 侧边导航（清新深松绿三段渐变 + 圆柱面） ---------------- */
.sidebar {
  width: 104px; flex-shrink: 0;
  background: linear-gradient(180deg, #4FA88F 0%, #2E8B79 48%, #1F6B5E 100%);
  box-shadow: inset 7px 0 14px rgba(255,255,255,.28), inset -7px 0 16px rgba(20,60,52,.3), 5px 0 18px rgba(20,60,52,.4);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px calc(10px + env(safe-area-inset-bottom));
  position: sticky; top: 0; height: 100vh;
}
.logo { text-align: center; margin-bottom: 16px; color: #EAF6F1; }
.logo-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 6px; border: 2px solid rgba(255,255,255,.45); box-shadow: 0 3px 8px rgba(20,60,52,.25); background: #fff; }
.logo-t { font-size: 12.5px; letter-spacing: 2px; line-height: 1.5; opacity: .95; }
.nav { display: flex; flex-direction: column; gap: 8px; width: 100%; flex: 1; }
.nav-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #E4F3ED; border-radius: 12px; padding: 9px 4px; cursor: pointer;
  font-size: 17px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: .18s;
}
.nav-btn span { font-size: 11.5px; letter-spacing: 1px; }
.nav-btn.active {
  background: linear-gradient(180deg, #ffffff, #E0EEF8); color: var(--main-dark);
  font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.9);
}
.sidebar-foot { color: rgba(234,246,241,.8); font-size: 10.5px; text-align: center; letter-spacing: 1px; }

/* ---------------- 主内容 ---------------- */
.main { flex: 1; padding: 16px 16px 40px; max-width: 760px; margin: 0 auto; min-width: 0; }
.page { display: none; animation: fade .25s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; gap: 8px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; letter-spacing: 1px; background: linear-gradient(100deg, #1F6B5E, #3E9E8C); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片（近白薄荷 + 顶部高光 + 柔和绿调阴影） ---------------- */
.card {
  background: linear-gradient(180deg, #FBFDFB, #EAF3EE);
  border: 1px solid var(--line); border-top: 1px solid rgba(255,255,255,.85); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 12px;
}
.card.slim { padding: 10px 14px; }
.card-title { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; background: linear-gradient(100deg, #3E9E8C, #1F6B5E); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.card-title .sub { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; background: none; -webkit-text-fill-color: var(--muted); }

/* ---------------- 按钮（清新绿果冻质感） ---------------- */
.btn {
  background: linear-gradient(180deg, #4FA88F, #2E8B79); color: #F4FAF7; border: none;
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 3px 7px rgba(20,60,52,.32), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 6px rgba(20,60,52,.22);
  transition: .15s;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(20,60,52,.28), inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 5px rgba(20,60,52,.32);
}
.btn-ghost { background: transparent; color: var(--main-dark); border: 1.5px solid var(--main); box-shadow: none; }
.btn-block { width: 100%; margin-top: 4px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: linear-gradient(180deg, #D98C7E, #C26E60); }
.export-tip { font-size: 12.5px; color: #3A6357; line-height: 1.7; margin: 2px 0 10px; }
.btn-sage { background: linear-gradient(180deg, #4FA88F, #2E8B79); }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
input, textarea, select {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px;
  background: #F6FBF8; color: var(--text); outline: none; width: 100%; font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--main); box-shadow: 0 0 0 3px rgba(63,158,140,.25), inset 0 1px 2px rgba(31,107,94,.06); }
textarea { resize: vertical; min-height: 56px; }

.result-band {
  background: linear-gradient(180deg, #DDEBE4, #C2DDD2); border: 1px dashed #4FA88F; border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; color: #234B43; line-height: 1.8; margin-top: 4px;
}
.result-band b { color: #1C4A40; font-size: 15px; }

/* ---------------- 计时器 ---------------- */
.timer-card { text-align: center; background: linear-gradient(180deg, #EAF3EE, #D6E9E0); }
.timer-title { font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.timer-display {
  font-size: 44px; font-weight: 700; letter-spacing: 3px; color: var(--main-dark);
  font-variant-numeric: tabular-nums; margin: 6px 0 10px;
  text-shadow: 0 2px 4px rgba(20,60,52,.12);
}
.timer-btns { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.timer-tip { font-size: 12px; color: var(--muted); }

/* ---------------- 计数器项目 ---------------- */
.counter-card { position: relative; }
.counter-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.counter-name { font-size: 15px; font-weight: 700; color: var(--main-dark); flex: 1; min-width: 0; }
.counter-ops { display: flex; gap: 6px; }
.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted);
  padding: 4px 6px; border-radius: 8px;
}
.icon-btn:active { background: var(--bg2); }
.counter-body { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 6px; }
.count-btn {
  width: 62px; height: 62px; border-radius: 50%; border: none; font-size: 30px; cursor: pointer;
  color: #F4FAF7; font-weight: 700; transition: .12s;
  box-shadow: 0 3px 8px rgba(20,60,52,.28), inset 0 2px 0 rgba(255,255,255,.3);
}
.count-btn:active { transform: scale(.94); }
.count-minus { background: linear-gradient(180deg, #2E8B79, #1F6B5E); }
.count-plus { background: linear-gradient(180deg, #4FA88F, #2E8B79); width: 74px; height: 74px; font-size: 36px; }
.count-num { text-align: center; }
.count-num .n { font-size: 46px; font-weight: 800; color: var(--jade); font-variant-numeric: tabular-nums; line-height: 1.1; }
.count-num .u { font-size: 12px; color: var(--muted); letter-spacing: 2px; }
.counter-foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.records-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.record-line {
  display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted);
  padding: 3px 4px; font-variant-numeric: tabular-nums;
}
.record-line b { color: var(--main-dark); }
.record-line .diff { color: #2FA98A; }
.notes-box textarea { margin-top: 8px; background: #EAF3EE; }

/* ---------------- 花样 ---------------- */
.pattern-search { display: flex; gap: 8px; }
.pattern-search input { flex: 1; }
.pattern-card { border-left: 4px solid var(--sage); }
.pattern-card.mine { border-left-color: var(--accent); }
.pattern-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pattern-name { font-size: 15px; font-weight: 700; color: var(--main-dark); }
.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: var(--sage-bg); color: #234B43; border: 1px solid #C3D9D0;
}
.tag.warm { background: #DDEBE4; color: #1F6B5E; border-color: #7FBAAE; }
.tag.mine-tag { background: linear-gradient(180deg, #EAF3EE, #9FCDBF); color: #1F6B5E; border-color: #4FA88F; font-weight: 600; }
.pattern-desc { font-size: 13px; color: var(--text); line-height: 1.8; margin-top: 6px; }
.pattern-meta { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.pattern-img {
  width: 100%; max-height: 260px; object-fit: contain; background: #F1F8F4; border-radius: 10px; margin-top: 8px;
  border: 1px solid var(--line); cursor: pointer; box-shadow: 0 2px 6px rgba(31,107,94,.14);
}
.pattern-ops { display: flex; gap: 8px; margin-top: 10px; }

/* ---------------- 作品记录 ---------------- */
.work-card { display: flex; gap: 12px; }
.work-thumb {
  width: 86px; height: 86px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--bg2);
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--muted);
}
.work-info { flex: 1; min-width: 0; }
.work-name { font-size: 15px; font-weight: 700; color: var(--main-dark); }
.from-task-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #fff; background: linear-gradient(100deg, #3E9E8C, #1F6B5E); cursor: pointer; vertical-align: middle;
  box-shadow: 0 1px 4px rgba(31,107,94,.25); }
.from-task-tag:hover { opacity: .9; }
.work-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.7; word-break: break-all; }
.work-ops { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.photo-strip { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.photo-strip img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }

/* ---------------- 线材管理 ---------------- */
.yarn-item, .accessory-item { display: flex; align-items: center; gap: 10px; }
.yarn-dot, .accessory-dot { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #DDEBE4, #4FA88F); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: inset 0 1px 3px rgba(255,255,255,.55); }
.accessory-dot { background: linear-gradient(135deg, #E8E4DD, #B8A88A); }
.yarn-info, .accessory-info { flex: 1; min-width: 0; }
.yarn-name, .accessory-name { font-size: 14px; font-weight: 700; color: var(--main-dark); }
.yarn-sub, .accessory-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.yarn-qty { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--main); background: #F6FBF8;
  color: var(--main-dark); font-size: 16px; cursor: pointer; font-weight: 700; line-height: 1;
}
.qty-btn:active { background: var(--bg2); }
.qty-num { font-size: 17px; font-weight: 800; color: var(--jade); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.qty-num small { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 进销存汇总 */
.jxc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.jxc-cell { background: #F4FAF6; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.jxc-k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.jxc-v { display: block; font-size: 13px; font-weight: 700; color: var(--main-dark); line-height: 1.4; }
.jxc-total { font-size: 15px; font-weight: 700; color: var(--main-dark); padding: 2px 2px 0; }
.jxc-total b { color: var(--accent); font-size: 18px; }
.jxc-eq { font-size: 11.5px; color: var(--muted); text-align: right; margin-top: 4px; letter-spacing: .3px; }
.yarn-kind { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; vertical-align: middle; margin-right: 5px; }
.yarn-kind.in { color: #1F6B5E; background: #E3F1EA; border: 1px solid #BFE0D2; }
.yarn-kind.out { color: #B26A00; background: #FBEFDD; border: 1px solid #F0D9AF; }
/* 线材表单单价自动计算预览 */
.price-preview { font-size: 12.5px; color: var(--main-dark); background: #EAF3EE; border: 1px solid var(--main);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; line-height: 1.5; }
.price-preview b { color: var(--accent); }

/* ---------------- 线材库（市场品牌目录） ---------------- */
.yarn-lib { margin-top: 14px; }
.yarn-lib-search { display: flex; gap: 8px; margin-bottom: 12px; }
.yarn-lib-search input { flex: 1; }
.yarn-lib-search select { flex: 0 0 38%; }
.yarn-lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.yarn-lib-card {
  background: var(--bg2); border: 1px solid #E4EFE9; border-radius: 14px; padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 3px; position: relative;
}
.ylc-brand { font-size: 12px; color: var(--muted); }
.ylc-name { font-size: 14.5px; font-weight: 700; color: var(--main-dark); line-height: 1.3; }
.ylc-price { font-size: 15px; font-weight: 800; color: var(--accent); margin-top: 2px; }
.ylc-price small { font-size: 11px; color: var(--muted); font-weight: 400; }
.ylc-add { margin-top: 8px; padding: 7px 0; font-size: 13px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31,107,94,.5); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal h3 { color: var(--main-dark); font-size: 16px; margin-bottom: 12px; }
.modal .form-grid.single { grid-template-columns: 1fr; }
.modal-btns { display: flex; gap: 10px; margin-top: 14px; }
.modal-btns .btn { flex: 1; }
.self-input-hint { font-size: 12px; color: var(--muted); background: #EAF3EE; border: 1px dashed var(--main);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.6; }
.upload-box {
  border: 1.5px dashed var(--main); border-radius: 12px; padding: 10px; text-align: center;
  color: var(--muted); font-size: 12.5px; cursor: pointer; background: #EAF3EE;
}
.upload-box img { max-width: 100%; max-height: 140px; border-radius: 8px; margin-top: 6px; }
.up-name { font-size: 11px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.upload-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; justify-content: center; }
.upload-thumbs .ut { position: relative; }
.upload-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.upload-thumbs .rm {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; font-size: 11px; cursor: pointer; line-height: 1;
}

.img-viewer { position: fixed; inset: 0; background: rgba(20,45,40,.92); z-index: 60; display: flex; align-items: center; justify-content: center; }
.img-viewer img { max-width: 94vw; max-height: 90vh; border-radius: 10px; }

/* ---------------- 其他 ---------------- */
.empty { text-align: center; color: var(--muted); padding: 26px 0; font-size: 13px; }
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,107,94,.92); color: #EAF3EE; padding: 9px 20px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 70; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------------- 我的 / 个性化 ---------------- */
.mine-field { margin: 12px 0 4px; }
.mine-field input { margin-top: 7px; }
.title-preview {
  font-size: 17px; font-weight: 700; letter-spacing: 1px; text-align: center;
  background: linear-gradient(180deg, #FBFDFB, #EAF3EE); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 10px; color: var(--main-dark);
  box-shadow: var(--shadow);
}
.mine-preview { margin-top: 12px; text-align: center; line-height: 1.8; }
.cloud-status { margin: 4px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 7px 10px; border-radius: 9px; background: #F3F4F3; }
.cloud-status.ok { color: #1c7a4f; background: #E6F4EC; }
.cloud-status.warn { color: #9a6b1e; background: #FBF1DD; }
.cloud-account { font-size: 13px; color: var(--main-dark); margin: 6px 0 10px; word-break: break-all; }
.mine-preview .mp-greet { font-size: 15px; font-weight: 600; color: var(--text); }
.mine-preview .mp-sign { font-size: 13px; color: var(--muted); }

/* ---------------- 手机适配 ---------------- */
@media (max-width: 560px) {
  .sidebar { width: 74px; padding: 12px 5px calc(8px + env(safe-area-inset-bottom)); }
  .logo-img { width: 40px; height: 40px; }
  .logo-t { font-size: 10px; letter-spacing: 1px; }
  .nav { overflow-y: auto; padding-right: 2px; }
  .nav-btn { font-size: 15px; padding: 8px 2px; border-radius: 10px; }
  .nav-btn span { font-size: 10px; letter-spacing: 0; }
  .main { padding: 12px 10px 34px; }
  .timer-display { font-size: 36px; }
  .form-grid { gap: 7px 7px; }
  .jxc { grid-template-columns: 1fr; }
  .work-thumb { width: 72px; height: 72px; }
  .sidebar-foot { display: none; }
  .task-material-row { grid-template-columns: 78px 1fr 56px 28px; }
  .yarn-lib-grid { grid-template-columns: 1fr; }
  .yarn-lib-search { flex-direction: column; }
  .yarn-lib-search select { flex: 1; }
}

/* ============================================================
   任务计划 —— 三级分色色条 + 紧凑卡片 + 完成态 + 紧急区/折叠
   ============================================================ */
.task-summary {
  background: linear-gradient(180deg, #FBFDFB, #EAF3EE);
  font-size: 13.5px; color: var(--main-dark);
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
}
.task-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 11.5px; color: var(--muted); padding: 8px 12px !important;
}
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.ldot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ldot.l1 { background: #E06A66; box-shadow: 0 0 0 2px #F6D9D7; }
.ldot.l2 { background: #E89B45; box-shadow: 0 0 0 2px #F8E6CB; }
.ldot.l3 { background: #2E9E7E; box-shadow: 0 0 0 2px #D2EBE1; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 14px !important; margin: 6px 0 8px !important; border-left: 4px solid var(--main); }
.sh-title { font-size: 14px; font-weight: 700; color: var(--main-dark); }
.sh-sub { font-size: 11.5px; color: var(--muted); }
.section-foldable { cursor: pointer; user-select: none; transition: background .15s; }
.section-foldable:active { background: var(--bg2); }
.fold-caret { display: inline-block; font-size: 12px; color: var(--muted); margin-left: 2px; }

.task-card {
  position: relative; padding: 10px 12px 10px 18px !important;
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px !important;
  overflow: hidden;
}
.task-card .task-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.task-card.task-lv-l1 .task-stripe { background: linear-gradient(180deg, #EC807C, #D85551); box-shadow: 0 0 6px rgba(216,85,81,.35); }
.task-card.task-lv-l2 .task-stripe { background: linear-gradient(180deg, #F0AA5A, #D9822E); box-shadow: 0 0 6px rgba(217,130,46,.3); }
.task-card.task-lv-l3 .task-stripe { background: linear-gradient(180deg, #4FA88F, #2E9E7E); box-shadow: 0 0 6px rgba(46,158,126,.35); }

.task-card.task-lv-l1 { background: linear-gradient(180deg, #FCEFEE, #F8E2DF); border-color: #F0CFCB; }
.task-card.task-lv-l2 { background: linear-gradient(180deg, #FBF5EC, #F7E9D2); border-color: #EFD7AE; }
.task-card.task-lv-l3 { background: linear-gradient(180deg, #F1F8F4, #DDEBE4); border-color: #C3D9D0; }
.task-card.task-overdue { border-width: 2px; }
.task-card.task-overdue.task-lv-l1 { background: linear-gradient(180deg, #FBE0DD, #F6CFCA); }

.task-body { flex: 1; min-width: 0; }
.task-line1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.task-level {
  font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600; letter-spacing: .5px;
  border: 1px solid transparent;
}
.task-level.lv-l1 { background: linear-gradient(180deg, #FBDAD8, #F3C3C0); color: #B23A36; border-color: #EEB0AD; }
.task-level.lv-l2 { background: linear-gradient(180deg, #FAE6C8, #F2CC92); color: #A8631A; border-color: #E6B274; }
.task-level.lv-l3 { background: linear-gradient(180deg, #DDEBE4, #9FCDBF); color: #1F6B5E; border-color: #4FA88F; }

.task-deadline { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-deadline.dd-overdue { color: #D2554F; font-weight: 700; }

.task-title {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.45;
  word-break: break-all;
}
.task-notes { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.65; }
.task-done-at { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-style: italic; }

.task-status {
  font-size: 10.5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .3px;
  border: 1px solid transparent;
}
.task-status.st-todo { background: #E4EDE9; color: #34564D; border-color: #BBD3CC; }
.task-status.st-doing { background: #DDEBE4; color: #1F6B5E; border-color: #9FCDBF; }
.task-status.st-done { background: #D2EBE1; color: #2E9E7E; border-color: #A6D8C9; }

/* 进度条：加宽 + 浅灰绿轨道与鲜艳绿填充强对比，进度一目了然 */
.task-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.task-progress-track {
  flex: 1; height: 12px; border-radius: 999px; background: #E0EAE5;
  overflow: hidden; box-shadow: inset 0 1px 2px rgba(31,107,94,.14);
}
.task-progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #6EDBB0, #2FA98A);
  box-shadow: 0 0 6px rgba(47,169,138,.5);
  transition: width .3s ease;
}
.task-progress-txt { font-size: 11.5px; color: var(--main-dark); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

.task-ops { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.task-check {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--sage);
  background: #F6FBF8; color: var(--main); font-size: 18px; font-weight: 700;
  cursor: pointer; line-height: 1; transition: .15s;
  box-shadow: 0 2px 4px rgba(31,107,94,.12), inset 0 1px 0 rgba(255,255,255,.6);
}
.task-check:active { transform: scale(.92); }
.task-check.checked {
  background: linear-gradient(180deg, #4FA88F, #2E9E7E); color: #F4FAF7; border-color: #2E9E7E;
  box-shadow: 0 2px 6px rgba(46,158,126,.42), inset 0 1px 0 rgba(255,255,255,.3);
}

.task-card.task-done { opacity: .62; }
.task-card.task-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-card.task-done .task-level { filter: grayscale(.6); }

/* 任务材料包 */
.task-material-row { display: grid; grid-template-columns: 90px 1fr 70px 32px; gap: 6px; align-items: center; margin-bottom: 7px; }
.task-material-row select, .task-material-row input { font-size: 13px; padding: 7px 6px; }
.task-material-total { margin-top: 8px; font-size: 13px; color: var(--main-dark); text-align: right; }
.task-material-total b { color: var(--accent); font-size: 15px; }
.task-materials b { color: var(--accent); }

/* 任务卡片：成本/人工加粗数值沿用强调色 */
.task-notes b { color: var(--accent); font-weight: 700; }

/* 任务类型标签（作品/接单/商务/日常/其他） */
.task-type {
  font-size: 11px; padding: 2px 9px; border-radius: 999px; letter-spacing: .3px;
  background: linear-gradient(180deg, #EAF3EE, #CFE6DC); color: #1F6B5E;
  border: 1px solid #7FBAAE; font-weight: 600; white-space: nowrap;
}
/* 计数器关联任务的小标签 */
.counter-task {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 500;
  background: #E4EDE9; color: #34564D; border: 1px solid #BBD3CC; white-space: nowrap;
}

/* 作品记录搜索栏（吸顶，滚动长列表时保持可见） */
.search-bar {
  position: sticky; top: 0; z-index: 5; margin-bottom: 12px;
  padding: 2px 0 6px;
  background: linear-gradient(180deg, #EAF4EE 0%, rgba(234,244,238,.7) 100%);
}
.search-bar input {
  width: 100%; border-radius: 999px; padding: 10px 16px;
  background: #F7FBF9; font-size: 13.5px;
}

/* 弹窗内「材料成本 / 人工成本 / 作品详情」分区标题与说明 */
.modal .card.slim .card-title .sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; background: none; -webkit-text-fill-color: var(--muted); }

@media (max-width: 560px) {
  .task-check { width: 30px; height: 30px; font-size: 16px; }
  .task-title { font-size: 14px; }
  .task-legend { font-size: 10.5px; gap: 3px 10px; }
  .task-type { font-size: 10px; padding: 1px 7px; }
  .counter-task { font-size: 10px; padding: 1px 6px; }
  .search-bar input { padding: 9px 14px; }
}
