* { margin: 0; padding: 0; box-sizing: border-box; }
.zxcount { margin-top: 4px; font-size: 12px; color: #64748b; text-align: right; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f4f8; color: #1f2937; min-height: 100vh; display: flex; flex-direction: column; }

.app-header { background: #1d4ed8; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 960px; margin: 0 auto; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
nav a { color: rgba(255,255,255,.85); margin-left: 24px; text-decoration: none; font-size: 15px; }
nav a:hover, nav a.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }

main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 20px 48px; }
.app-footer { text-align: center; color: #94a3b8; font-size: 12px; padding: 14px; }

/* 首页卡片 */
.home-title { text-align: center; margin: 12px 0 6px; font-size: 24px; }
.home-sub { text-align: center; color: #64748b; margin-bottom: 28px; font-size: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.form-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.form-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.form-card h3 { font-size: 17px; margin-bottom: 10px; color: #1d4ed8; }
.form-card p { font-size: 13px; color: #64748b; flex: 1; line-height: 1.6; }
.form-card .meta { margin-top: 14px; font-size: 12px; color: #94a3b8; }
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 8px; padding: 10px 22px; font-size: 14px; background: #1d4ed8; color: #fff; transition: background .15s; }
.btn:hover { background: #1e40af; }
.btn.secondary { background: #e2e8f0; color: #334155; }
.btn.secondary:hover { background: #cbd5e1; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.danger:hover { background: #fecaca; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.progress-bar { height: 6px; background: #e2e8f0; border-radius: 3px; margin: 12px 0 8px; overflow: hidden; }
.progress-bar > div { height: 100%; background: #1d4ed8; transition: width .3s; }

/* 问卷 */
.q-wrap { background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.step-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.step-chip { font-size: 12px; padding: 5px 12px; border-radius: 20px; background: #e2e8f0; color: #64748b; cursor: pointer; border: none; }
.step-chip.active { background: #1d4ed8; color: #fff; }
.step-chip.done { background: #dcfce7; color: #15803d; }
.step-title { font-size: 19px; margin-bottom: 4px; }
.step-hint { font-size: 13px; color: #ef4444; margin-bottom: 20px; }
.q-item { margin-bottom: 18px; }
.q-item > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.q-item .hint { font-size: 12px; color: #ef4444; margin-top: 4px; }
.q-item input[type=text], .q-item input[type=number], .q-item input[type=date], .q-item select, .q-item textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; background: #f8fafc;
}
.q-item input:focus, .q-item select:focus, .q-item textarea:focus { outline: none; border-color: #1d4ed8; background: #fff; }
/* 格式校验不通过：输入框标红 */
.q-item input.invalid, .rows-table input.invalid { border-color: #ef4444 !important; background: #fef2f2 !important; }
.q-item textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-group label { font-weight: 400; font-size: 14px; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.check-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; background: #f8fafc; }
.check-item span { font-size: 14px; }
.check-item .yesno { display: flex; gap: 14px; font-size: 13px; }
.ym-group, .datefull { display: flex; align-items: center; gap: 8px; }
.ym-group input, .datefull input { width: 100px; }
.ym-group span, .datefull span { color: #64748b; }

/* 动态行 */
.rows-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.rows-table th { background: #eff6ff; font-size: 13px; padding: 8px 6px; border: 1px solid #cbd5e1; font-weight: 600; }
.rows-table td { border: 1px solid #cbd5e1; padding: 4px; }
.rows-table input, .rows-table select { width: 100%; border: none; padding: 6px; font-size: 13px; background: transparent; }
.rows-table input:focus, .rows-table select:focus { outline: 1px solid #93c5fd; background: #fff; }
.row-actions { display: flex; gap: 10px; margin-bottom: 6px; }
.rows-note { font-size: 12px; color: #ef4444; margin-top: 4px; }

.nav-btns { display: flex; justify-content: space-between; margin-top: 26px; }
.auto-save-tip { text-align: right; color: #94a3b8; font-size: 12px; margin-top: 10px; }

/* 完成页 */
.done-box { text-align: center; padding: 30px 0; }
.done-box h2 { margin-bottom: 10px; }
.done-box p { color: #64748b; margin-bottom: 24px; font-size: 14px; }
.done-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.preview-frame { width: 100%; height: 640px; border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 20px; background: #fff; }

/* 记录页 */
.record-list { display: flex; flex-direction: column; gap: 14px; }
.record-item { background: #fff; border-radius: 10px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05); flex-wrap: wrap; }
.record-item .info { flex: 1; min-width: 200px; }
.record-item .info h4 { font-size: 15px; margin-bottom: 4px; }
.record-item .info .time { font-size: 12px; color: #94a3b8; }
.record-item .ops { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 99; }
.toast.show { opacity: .92; }

@media print { .app-header, .app-footer, .nav-btns { display: none; } }
