/* 生成记录：对齐 miniprogram-native/pages/history 与 components/ys-type-mark */

.page.hist-page { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

.hist-head { margin: 10px 0 9px; }
.hist-title {
  display: block;
  margin: 0;
  color: #29231e;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.hist-lead { display: block; margin: 4px 0 0; color: #8c8073; font-size: 12px; line-height: 1.45; }

.hist-filters { margin: 0 0 6px; }
.hist-filter-bar { display: flex; gap: 6px; }
.hist-filter-btn {
  min-height: 28px;
  margin: 0;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #e3d5c4;
  background: #fffdf8;
  color: #29231e;
  font-size: 12px;
  font-weight: 700;
}
.hist-filter-btn.is-on { border-color: #29231e; }
.hist-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 6px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(187, 164, 127, 0.35);
}
.hist-filter {
  margin: 0;
  padding: 4px 0 6px;
  border: 0;
  background: transparent;
  color: #8c8073;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.hist-filter.is-on { color: #29231e; box-shadow: inset 0 -2px 0 #29231e; }

.hist-page .more {
  display: block;
  width: 100%;
  min-height: 36px;
  margin: 4px 0 10px;
  border-radius: 9px;
  background: #fffef9;
  border: 1px solid #e3d5c4;
  color: #1a6f68;
  font-size: 13px;
  font-weight: 700;
}
.hist-page .empty { display: block; padding: 12px 4px; color: #8c8073; font-size: 12px; text-align: center; }

.hist-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  margin-bottom: 6px;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid #e3d5c4;
  background: linear-gradient(180deg, #fffef9 0%, #fbf6ee 100%);
  box-shadow: 0 3px 8px rgba(78, 55, 33, 0.05);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* 类型图标：对齐 components/ys-type-mark 纸色方块 */
.tm {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #f3ebe0;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 42, 0.1);
}
.tm.is-wash { background: #f4efe4; }
.tm.is-lantern { background: #f7ecd8; }
.tm.is-frame { background: #eee8df; }
.tm.is-chop { background: #f6e8e2; }
.tm.is-pulse { background: #f1ebe3; }
.tm.is-ribbon { background: #f3eadc; }
.tm.is-thread { background: #f0ebe4; }
.tm.is-comb { background: #efe8dc; }
.tm.is-rule { background: #f1eadc; }
.tm.is-seal { background: #f6e8e2; }
.tm-mark { position: relative; width: 18px; height: 18px; }
.tm-mark .t { position: absolute; box-sizing: border-box; }
.tm-brush .t1 { left: 8px; top: 0; width: 3px; height: 10px; border-radius: 1.5px; background: #5c4630; transform: rotate(26deg); transform-origin: center bottom; }
.tm-brush .t2 { left: 6.5px; top: 9px; width: 6px; height: 6px; border-radius: 1px 1px 6px 6px; background: #c4a574; transform: rotate(26deg); }
.tm-brush .t3 { left: 2px; bottom: 0; width: 4px; height: 4px; border-radius: 50% 50% 50% 12%; background: #5c4630; transform: rotate(-18deg); }
.tm-wash .t1,
.tm-wash .t2 { left: 2px; width: 14px; height: 4px; border-radius: 999px; border: 1.5px solid #5c4630; border-top-color: transparent; transform: rotate(-18deg); }
.tm-wash .t1 { top: 4px; }
.tm-wash .t2 { top: 9px; opacity: 0.55; }
.tm-wash .t3 { right: 1px; top: 2px; width: 4px; height: 4px; border-radius: 50%; background: #c4a574; }
.tm-lantern .t1 { left: 4px; top: 3px; width: 10px; height: 11px; border-radius: 2px 2px 5px 5px; border: 1.5px solid #5c4630; }
.tm-lantern .t2 { left: 8px; top: 0; width: 2px; height: 4px; border-radius: 1px; background: #c4a574; }
.tm-lantern .t3 { left: 7px; top: 6px; width: 4px; height: 4px; border-radius: 50%; background: #c4a574; }
.tm-frame .t1 { left: 1px; top: 3px; width: 16px; height: 12px; border-radius: 2px; border: 1.5px solid #5c4630; }
.tm-frame .t2 { left: 4px; top: 9px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 4px solid #c4a574; }
.tm-frame .t3 { right: 4px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: #c4a574; }
.tm-chop .t1 { left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #5c4630; }
.tm-chop .t2 { left: 6px; top: 5px; width: 6px; height: 6px; border-radius: 1px; border: 1.5px solid #5c4630; transform: rotate(12deg); }
.tm-chop .t3 { left: 5px; top: 4px; width: 2px; height: 9px; border-radius: 1px; background: #c4553a; transform: rotate(28deg); }
.tm-pulse .t1 { left: 1px; bottom: 3px; width: 16px; height: 1.5px; border-radius: 1px; background: #5c4630; opacity: 0.35; }
.tm-pulse .t2 { left: 3px; top: 8px; width: 5px; height: 1.5px; background: #5c4630; transform: rotate(-42deg); }
.tm-pulse .t3 { left: 7px; top: 4px; width: 8px; height: 1.5px; background: #c4a574; transform: rotate(38deg); }
.tm-ribbon .t1 { left: 5px; top: 1px; width: 8px; height: 11px; border-radius: 1px 1px 0 0; background: #5c4630; }
.tm-ribbon .t2 { left: 5px; top: 11px; width: 0; height: 0; border-left: 4px solid #5c4630; border-right: 4px solid #5c4630; border-bottom: 4px solid transparent; }
.tm-ribbon .t3 { left: 7px; top: 4px; width: 4px; height: 1.5px; border-radius: 1px; background: #f3ebe0; }
.tm-thread .t1 { left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #5c4630; }
.tm-thread .t2 { left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid #c4a574; }
.tm-thread .t3 { left: 11px; top: 1px; width: 5px; height: 1.5px; border-radius: 1px; background: #c4a574; transform: rotate(28deg); }
.tm-comb .t1,
.tm-comb .t2,
.tm-comb .t3 { left: 2px; width: 14px; height: 2px; border-radius: 999px; background: #5c4630; }
.tm-comb .t1 { top: 4px; }
.tm-comb .t2 { top: 8px; width: 11px; background: #c4a574; }
.tm-comb .t3 { top: 12px; width: 8px; opacity: 0.55; }

.hist-card .meta { min-width: 0; }
.hist-card .head { display: flex; align-items: center; gap: 4px; }
.hist-card .kind { min-width: 0; color: #5c4630; font-size: 12px; font-weight: 800; }
.hist-card .badge { padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.hist-card .badge.is-fail { color: #c4553a; background: #f8e4dc; }
.hist-card .when { margin-left: auto; flex-shrink: 0; color: #8c8073; font-size: 11px; }
.hist-card .headline {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: #29231e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.hist-card .preview {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #8c8073;
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.run-box { margin-top: 6px; }
.run-track { position: relative; height: 6px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: rgba(196, 165, 116, 0.22); }
.run-sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 36%;
  background: linear-gradient(90deg, transparent, rgba(255, 253, 248, 0.42), transparent);
  animation: histRunSweep 2.8s ease-in-out infinite;
}
.run-fill { position: relative; z-index: 1; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d7c09a 0%, #c4a574 58%, #8d6b45 100%); transition: width 0.55s ease; }
.run-head {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 236, 0.9) 70%, #e8d3ad);
  animation: histRunHead 2.2s ease-in-out infinite;
}
@keyframes histRunSweep { from { transform: translateX(-90%); } to { transform: translateX(320%); } }
@keyframes histRunHead { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.hist-card .foot { display: flex; gap: 6px; margin-top: 6px; }
.hist-card .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  margin: 0;
  padding: 2px 8px 2px 2px;
  border: 0;
  border-radius: 999px;
  background: #f4efe4;
}
.hist-card .chip.is-wait { background: #f4ead8; }
.hist-card .chip.is-del { background: #f6e8e2; }
.chip-txt { color: #5c4630; font-size: 12px; font-weight: 800; line-height: 1.2; }
.nav-ico {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid #e3d5c4;
  background: #fffdf8;
}
.nav-ico .mk { position: relative; width: 13px; height: 13px; }
.mk-clip { width: 9px; height: 11px; margin: 1px auto 0; border: 1.5px solid #c4a574; border-radius: 2px 4px 3px 3px; }
.mk-fold { position: absolute; top: -1.5px; right: -1.5px; width: 5px; height: 5px; border-bottom: 1.5px solid #c4a574; border-left: 1.5px solid #c4a574; background: #fffdf8; }
.mk-line { width: 5px; height: 1.5px; margin: 2px 0 0 1px; border-radius: 1px; background: #5c4630; }
.mk-line.short { width: 3px; margin-top: 1px; }
.mk-x { width: 11px; height: 11px; margin: 1px auto 0; }
.mk-x-a,
.mk-x-b { position: absolute; left: 2px; top: 4.5px; width: 7px; height: 1.5px; border-radius: 1px; background: #5c4630; }
.mk-x-a { transform: rotate(45deg); }
.mk-x-b { transform: rotate(-45deg); }
.ink-dots { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; gap: 3px; flex-shrink: 0; }
.ink-dot { width: 4px; height: 4px; border-radius: 50%; background: #c4a574; animation: histInkDot 1.15s ease-in-out infinite; }
.ink-dot:nth-child(2) { animation-delay: 0.16s; background: #b08960; }
.ink-dot:nth-child(3) { animation-delay: 0.32s; background: #8d6b45; }
@keyframes histInkDot { 0%, 80%, 100% { opacity: 0.28; transform: scale(0.82); } 40% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .run-sweep,
  .run-head,
  .ink-dot { animation: none; }
  .ink-dot { opacity: 0.85; transform: none; }
}

@media (min-width: 768px) {
  .page.hist-page { padding-bottom: 32px; }
  .hist-title { font-size: 24px; line-height: 1.3; }
  .hist-lead,
  .hist-page .empty { font-size: 13px; }
  .hist-card { gap: 12px; margin-bottom: 10px; padding: 14px 16px; border-radius: 14px; }
  .tm { border-radius: 10px; overflow: hidden; }
  .hist-card .kind { font-size: 13px; }
  .hist-card .when,
  .hist-card .preview,
  .hist-card .badge { font-size: 12px; }
  .hist-card .headline { font-size: 16px; }
  .hist-card .foot { flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
  .hist-card .chip { min-height: 32px; padding: 0 12px 0 4px; gap: 6px; border-radius: 16px; }
  .chip-txt { white-space: nowrap; }
  .nav-ico,
  .ink-dots { width: 22px; height: 22px; }
  .hist-filters { margin-bottom: 8px; }
  .hist-filter-bar { gap: 8px; }
  .hist-filter-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
  .hist-filter { padding: 4px 0 6px; font-size: 13px; }
  .hist-card:hover { border-color: #d8c6b1; }
}
