/* 周报系统 - 移动端优先样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #e8722a;
  --primary-dark: #d4601a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8f959e;
  --border: #e5e6eb;
  --danger: #f53f3f;
  --warn: #ff8800;
  --success: #00b42a;
  --radius: 10px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
}
/* 桌面端（宽屏）放宽容器，表格/表单自适应舒展 */
@media (min-width: 768px) {
  body { max-width: 1600px; padding: 0 24px; }
}

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.topbar h1 { font-size: 17px; font-weight: 600; }
.topbar h1::before { content: '山金期货 · '; color: var(--primary); font-weight: 600; }
.topbar .user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar button {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.topbar button:hover { border-color: var(--primary); color: var(--primary); }

/* 标签页 */
.tabs {
  display: flex; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 50px; z-index: 9; overflow-x: auto;
}
.tabs button {
  flex: 1; min-width: 88px; border: 0; background: none; padding: 12px 4px;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

main { padding: 12px; padding-bottom: 80px; }
.hidden { display: none !important; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card h3 { font-size: 15px; margin-bottom: 8px; }
.card .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* 表单 */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 72px; resize: vertical; }
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; }

/* 按钮 */
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; margin-top: 14px; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: #f2f3f5; color: var(--text); }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 条目卡片 */
.item { position: relative; }
.item .item-head { display: flex; justify-content: space-between; gap: 8px; }
.item .item-name { font-weight: 600; font-size: 15px; }
.item .item-tools { display: flex; gap: 6px; align-items: flex-start; }

/* 状态徽标 */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
}
.badge.done { background: #e8ffea; color: var(--success); }
.badge.ongoing { background: #e8f3ff; color: var(--primary); }
.badge.pending { background: #fff7e8; color: var(--warn); }
.badge.todo { background: #f2f3f5; color: var(--muted); }
.badge.imp-5 { background: #ffece8; color: var(--danger); }
.badge.imp-4 { background: #fff7e8; color: #ff8800; }
.badge.imp-3 { background: #fff7e8; color: #ff8800; }
.badge.imp-2 { background: #e8f3ff; color: var(--primary); }
.badge.imp-1 { background: #f2f3f5; color: var(--muted); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th, td { border: 1px solid var(--border); padding: 8px 6px; text-align: left; vertical-align: top; }
th { background: #f7f8fa; font-weight: 600; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 8px; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog {
  background: #fff; border-radius: 12px; width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto; padding: 18px;
}
.dialog h2 { font-size: 16px; margin-bottom: 4px; }
.dialog .close { float: right; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }

/* 通讯录选人 */
.pick-item { padding: 9px 12px; border-bottom: 1px solid #f0f1f3; cursor: pointer; }
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: #f6f8fb; }

/* 进度条 */
.progress-bar { height: 8px; background: #f2f3f5; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* 统计块 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-box { background: #fff; border-radius: 10px; padding: 12px; text-align: center; }
.stat-box .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-box .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 40px; z-index: 99;
  background: rgba(0,0,0,.8); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; max-width: 80%; display: none;
}
.toast.show { display: block; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }
a { color: var(--primary); text-decoration: none; }

/* 桌面端表格填报模式 */
.fill-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.fill-table th, .fill-table td { padding: 6px 8px; vertical-align: middle; border-bottom: 1px solid #eef0f3; }
.fill-table th {
  font-size: 13px; text-align: center; font-weight: 600; background: #f5f7fa; color: #333;
  height: 40px;
}
.fill-table input, .fill-table select, .fill-table textarea {
  width: 100%; height: 38px; padding: 0 10px; font-size: 13px;
  border: 1px solid #dcdfe6; border-radius: 6px; box-sizing: border-box; background: #fff;
}
.fill-table textarea { height: auto; min-height: 38px; padding: 8px 10px; resize: vertical; line-height: 1.4; overflow: hidden; }
.fill-table input[readonly] { background: #f7f8fa; cursor: pointer; color: var(--text); border-color: #e4e7ed; }
.fill-table select { padding: 0 6px; }
.fill-table .btn { white-space: nowrap; margin-top: 0; height: 32px; padding: 0 12px; font-size: 13px; }
.fill-table td .btn + .btn { margin-left: 4px; }
.fill-table td { text-align: left; }

/* 选人弹窗：姓名/部门两行，不折行 */
.pick-item2 {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 6px; border-bottom: 1px solid #f0f2f5; cursor: pointer;
}
.pick-item2:hover { background: #f7f8fa; }
.pi-main { flex: 1; min-width: 0; }
.pi-name { font-weight: 600; font-size: 14px; }
.pi-dept { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.pick-item2 input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; margin-left: 12px; }
