/* 记工对账 样式：与手机站一致的红白配色，375px 起不横向滚动 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font: 400 14px "微软雅黑", Arial, Helvetica, sans-serif;
  color: #222;
  background: #ededed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.tk-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5f6f8;
  padding-bottom: 64px;
  position: relative;
}

/* 顶栏 */
.tk-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #ececec;
}
.tk-top-back {
  font-size: 26px;
  line-height: 1;
  color: #555;
  width: 24px;
  text-align: left;
  padding-bottom: 4px;
}
.tk-top-brand { display: block; flex: 0 0 auto; }
.tk-top-brand img { display: block; height: 26px; width: auto; }
.tk-top-brand--text { font-size: 15px; font-weight: 700; color: #e53935; }
.tk-top-title {
  margin-left: auto;
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.tk-main { padding: 10px 12px 18px; }

/* 卡片 */
.tk-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.tk-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  color: #222;
}

/* 统计条 */
.tk-stat {
  display: flex;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.tk-stat-item {
  flex: 1;
  text-align: center;
  padding: 12px 4px 10px;
  border-right: 1px solid #f2f2f2;
}
.tk-stat-item:last-child { border-right: none; }
.tk-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #e53935;
  line-height: 1.2;
}
.tk-stat-num.ok { color: #2e7d32; }
.tk-stat-num.warn { color: #ef6c00; }
.tk-stat-label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.tk-stat-link { display: block; }

/* 表单 */
.tk-field { display: block; margin-bottom: 10px; }
.tk-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}
.tk-input {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font-size: 14px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.tk-input:focus { border-color: #e53935; outline: none; }
select.tk-input { background-image: linear-gradient(45deg, transparent 50%, #999 50%), linear-gradient(135deg, #999 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.tk-textarea { height: auto; min-height: 68px; padding: 9px 10px; line-height: 1.5; resize: none; }
.tk-row { display: flex; gap: 8px; }
.tk-field-half, .tk-field-third { flex: 1 1 0; min-width: 0; }

/* 分段计价 */
.tk-seg {
  display: flex;
  padding: 3px;
  background: #f2f3f5;
  border-radius: 8px;
}
.tk-seg-item { flex: 1; position: relative; }
.tk-seg-item input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.tk-seg-item span {
  display: block;
  text-align: center;
  line-height: 32px;
  font-size: 13px;
  color: #555;
  border-radius: 6px;
}
.tk-seg-item input:checked + span {
  background: #fff;
  color: #e53935;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.tk-sumline {
  font-size: 13px;
  color: #666;
  padding: 8px 10px;
  background: #fafafa;
  border-radius: 8px;
  margin-bottom: 10px;
}
.tk-sumline strong { color: #e53935; font-size: 18px; margin: 0 2px; }

/* 按钮 */
.tk-btn {
  display: inline-block;
  height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 15px;
  font-family: inherit;
  line-height: 42px;
  text-align: center;
  cursor: pointer;
}
.tk-btn-primary { background: #e53935; border-color: #e53935; color: #fff; }
.tk-btn-primary:active { background: #c62828; }
.tk-btn-line { border-color: #e53935; color: #e53935; background: #fff; }
.tk-btn-danger { background: #c62828; border-color: #c62828; color: #fff; }
.tk-btn-block { display: block; width: 100%; margin-top: 6px; }
.tk-btn-text {
  height: auto;
  line-height: 1.6;
  padding: 6px 0;
  background: none;
  color: #999;
  font-size: 12px;
  text-decoration: underline;
}
.tk-btnrow { display: flex; gap: 8px; margin-top: 8px; }
.tk-btnrow .tk-btn { flex: 1; min-width: 0; }

/* 底部页签 */
.tk-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid #ececec;
  padding-bottom: env(safe-area-inset-bottom);
}
.tk-tab {
  flex: 1;
  text-align: center;
  line-height: 48px;
  font-size: 14px;
  color: #999;
}
.tk-tab.on { color: #e53935; font-weight: 600; }

/* 列表 */
.tk-list { list-style: none; margin: 0; padding: 0; }
.tk-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f4;
}
.tk-list-item:last-child { border-bottom: none; }
.tk-list-main { flex: 1 1 auto; min-width: 0; }
.tk-list-title {
  font-size: 14px;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-list-sub {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
  margin-top: 3px;
  word-break: break-all;
}
.tk-list-side { flex: 0 0 auto; text-align: right; font-size: 12px; color: #999; }
.tk-money { font-size: 15px; font-weight: 600; color: #222; }
.tk-list-ops { display: flex; gap: 10px; justify-content: flex-end; margin-top: 3px; }
.tk-link {
  color: #e53935;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.tk-link-danger { color: #c62828; }
.tk-inline { display: inline; }
.tk-check { flex: 0 0 22px; width: 22px; padding-top: 2px; }
.tk-check input { width: 18px; height: 18px; accent-color: #e53935; }
.tk-check-off { display: block; width: 22px; padding-top: 2px; }

.tk-batchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f2f2f2;
}

/* 标记 */
.tk-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 400;
  vertical-align: 1px;
}
.tk-badge.ok { background: #e8f5e9; color: #2e7d32; }
.tk-badge.wait { background: #fff3e0; color: #ef6c00; }
.tk-badge.warn { background: #fff8e1; color: #8a6d00; }
.tk-badge.mute { background: #eee; color: #888; }

/* 提示 */
.tk-tip {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.tk-tip-ok { background: #e8f5e9; color: #2e7d32; }
.tk-tip-error { background: #ffebee; color: #c62828; }
.tk-tip-warn { background: #fff8e1; color: #8a6d00; }
.tk-hint { font-size: 12px; color: #999; line-height: 1.6; margin: 6px 0 0; }
.tk-muted { color: #888; font-size: 13px; line-height: 1.6; }
.tk-tiny { font-size: 11px; color: #aaa; }
.tk-center { text-align: center; margin-top: 8px; }

/* 表格 */
.tk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk-table th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  color: #999;
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
}
.tk-table td { padding: 8px 4px; border-bottom: 1px solid #f5f5f5; word-break: break-word; }
.tk-table .num { text-align: right; }
.tk-table tfoot td {
  font-weight: 600;
  border-top: 1px solid #eee;
  border-bottom: none;
}
.tk-table-sm { font-size: 12px; }
.tk-table-sm th, .tk-table-sm td { padding: 6px 3px; }

/* 对账单头部 */
.tk-batch-head { padding-top: 12px; }
.tk-batch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tk-batch-name { font-size: 16px; font-weight: 600; line-height: 1.4; }
.tk-batch-amount { margin-top: 10px; }

.tk-agree {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  margin: 4px 0 10px;
}
.tk-agree input { width: 18px; height: 18px; accent-color: #e53935; }

.tk-more {
  margin: 8px 0 4px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}
.tk-more summary { font-size: 13px; color: #666; cursor: pointer; }
.tk-more[open] summary { margin-bottom: 10px; }
.tk-more-add { margin-top: 12px; }

.tk-empty { text-align: center; padding: 30px 14px; }
.tk-empty-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.tk-declare { background: #fafafa; }
.tk-declare p { margin: 0 0 4px; font-size: 12px; color: #999; line-height: 1.7; }

.tk-hidden { display: none !important; }

/* 打印版默认不显示 */
.tk-print { display: none; }

@media (max-width: 359px) {
  .tk-stat-num { font-size: 17px; }
  .tk-table { font-size: 12px; }
  .tk-money { font-size: 14px; }
}

/* 打印：只输出对账单，A4 一页 */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .tk-app { max-width: none; min-height: 0; padding: 0; background: #fff; }
  .tk-top, .tk-tabs { display: none !important; }
  .tk-main { padding: 0; }
  .tk-main > *:not(.tk-print) { display: none !important; }
  .tk-print { display: block !important; color: #000; font-size: 12px; }
  .tk-print-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 2px solid #e53935;
  }
  .tk-print-logo { height: 38px; width: auto; }
  .tk-print-site { font-size: 12px; color: #666; }
  .tk-print-title {
    margin: 16px 0 10px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 3px;
  }
  .tk-print-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
  }
  .tk-print-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .tk-print-table th, .tk-print-table td {
    padding: 5px 6px;
    border: 1px solid #999;
    text-align: left;
  }
  .tk-print-table th { background: #f2f2f2; font-weight: 600; }
  .tk-print-table .num { text-align: right; }
  .tk-print-total {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
  }
  .tk-print-sign {
    display: flex;
    justify-content: space-between;
    margin-top: 26px;
    font-size: 12px;
  }
  .tk-print-note {
    margin-top: 16px;
    font-size: 10px;
    color: #666;
    line-height: 1.7;
  }
}