* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 18px; }
html, body { height: 100%; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #1a1a1a; font-size: 18px; line-height: 1.6; }
.screen { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.hidden { display: none !important; }

/* 开屏 */
#splash { align-items: center; justify-content: center; background: linear-gradient(135deg, #4e8cff, #6f5bff); }
.circles { display: flex; flex-direction: column; gap: 44px; align-items: center; }
.entry { display: flex; align-items: center; gap: 20px; cursor: pointer; transition: transform .15s; }
.entry:active { transform: scale(0.97); }
.entry-text { font-size: 30px; font-weight: 800; color: #fff; }
.big-circle {
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,0.97); color: #3a5bff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.c-title { font-size: 76px; font-weight: 800; }

/* 功能页 */
.topbar { height: 60px; display: flex; align-items: center; padding: 0 16px; background: #3a5bff; color: #fff; }
.topbar .back { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 8px; }
.topbar .title { flex: 1; text-align: center; font-size: 22px; font-weight: 700; margin-right: 48px; }
.content { flex: 1; overflow-y: auto; padding: 18px; padding-bottom: 90px; }
/* 算运费向导：内容区内部滚动，上一步/下一步固定底部 */
.content.calc-mode { display: flex; flex-direction: column; overflow: hidden; padding: 0; padding-bottom: 72px; }
.content.calc-mode .calc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 28px; }
/* 算运费页表格留出分页行与底部操作栏的空间，避免分页被遮 */
.content.calc-mode .table-scroll { max-height: calc(100vh - 380px); }
.content.calc-mode .step-bar { flex: none; margin: 0; padding: 10px 18px; background: #f5f6f8; border-top: 1px solid #e3e6ef; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: 72px; display: flex; background: #fff; border-top: 3px solid #3a5bff; box-shadow: 0 -3px 12px rgba(0,0,0,0.14); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 19px; color: #555; cursor: pointer; font-weight: 600; border-right: 2px solid #e3e6ef; }
.tab:last-child { border-right: none; }
.tab.active { color: #3a5bff; font-weight: 800; background: #eef2ff; }

.card { background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card p { font-size: 17px; color: #444; margin-bottom: 14px; line-height: 1.7; }

.step-head { font-size: 20px; font-weight: 700; margin-bottom: 12px; color: #222; }
.step-bar { display: flex; gap: 12px; margin-top: 16px; margin-bottom: 12px; }
/* 结果/预览表格固定为窗口大小，框内滚动，避免整页无限下滑、与分页重叠 */
.table-scroll { max-height: calc(100vh - 300px); overflow: auto; border-radius: 10px; }
.step-bar button { flex: 1; padding: 10px 8px; border: none; border-radius: 12px; background: #e9ecf5; font-size: 17px; font-weight: 600; cursor: pointer; min-height: 46px; }
.step-bar button.primary { background: #3a5bff; color: #fff; }

button.action { background: #3a5bff; color: #fff; border: none; padding: 11px 18px; border-radius: 10px; cursor: pointer; font-size: 18px; font-weight: 700; width: 100%; min-height: 46px; }
button.ghost { background: #fff; border: 2px solid #b8c0d6; padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 16px; min-height: 42px; }
input[type=file] { width: 100%; margin: 12px 0; font-size: 17px; padding: 12px; border: 2px dashed #b8c0d6; border-radius: 10px; background: #fafbff; }
input, select { padding: 8px 10px; border: 2px solid #c4ccdd; border-radius: 10px; font-size: 17px; width: 100%; min-height: 42px; }
/* 模板省份表里的小数字输入框：尺寸贴合文字，不空旷 */
input.mini { min-height: 38px; padding: 6px 8px; font-size: 16px; width: 76px; text-align: center; }
/* 日期框触屏优化：更高更易点，16px 防 iOS 聚焦缩放 */
input[type="date"] { min-height: 46px; font-size: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
/* 起止日期行：两个日期框始终同一行，各占一半、不换行 */
.date-row { flex-wrap: nowrap; }
.date-row label { flex: 1; min-width: 0; }
.date-row input[type="date"] { width: 100%; }
/* 省份+筛选按钮同一行 */
.filter-row { flex-wrap: nowrap; }
.filter-row select { flex: 1; min-width: 0; width: auto; }
.filter-row .action { width: auto; flex: none; padding-left: 22px; padding-right: 22px; }
/* 看运费表格限高：留出筛选区/统计行/分页，避免超出窗口 */
#viewTable { max-height: calc(100vh - 268px); }
.radio { font-size: 18px; display: flex; align-items: center; gap: 10px; margin: 10px 0; }
/* 模板列表项：紧凑间距，避免选项间大片空白 */
.radio.tpl-item { margin: 4px 0; }
.radio input { width: 24px; height: 24px; }
/* 单价格选项：文字一行，是/否另起一行并排，radio 保持小尺寸 */
.radio-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 10px 0; }
.radio-row > span { font-size: 17px; font-weight: 600; }
.radio-opts { display: flex; gap: 28px; }
.radio-opts label { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; cursor: pointer; }
.radio-opts input[type="radio"] { width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; flex: none; }
.face-row { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.face-row input[type="number"] { width: 64px; min-height: 42px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
th, td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; white-space: nowrap; }
th { background: #e8edff; font-weight: 700; color: #222; position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 #c4ccdd; }
/* 列多的表给最小宽度：窄屏横向滑动，而不是把列挤成一团 */
.table-scroll > table { min-width: 820px; }
.tpl-table-wrap { overflow-x: auto; }
.tpl-table-wrap > table { min-width: 520px; }
.diff-pos { color: #d42222; font-weight: 700; }
.diff-neg { color: #0a8f4a; font-weight: 700; }
.i-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #3a5bff; color: #3a5bff; background: #fff; cursor: pointer; font-style: italic; font-size: 13px; line-height: 1; padding: 0; }

.small { font-size: 15px; color: #777; }
.edit-bar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 10px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 16px; padding: 22px; width: 92%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.detail-card { border: 2px solid #e3e6ef; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.detail-card h4 { font-size: 18px; margin-bottom: 8px; color: #3a5bff; }
.kv { display: flex; justify-content: space-between; font-size: 16px; padding: 6px 0; border-bottom: 1px dashed #eee; }

.loading { position: fixed; inset: 0; background: rgba(255,255,255,0.88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 99; font-size: 24px; font-weight: 700; color: #3a5bff; }
.spinner { width: 48px; height: 48px; border: 5px solid #cdd6ff; border-top-color: #3a5bff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 上传进度条（真实百分比） */
.pbar { height: 14px; background: #e0e4f0; border-radius: 7px; overflow: hidden; margin-top: 14px; }
.pbar.hidden { display: none; }
.pbar-fill { height: 100%; width: 0%; border-radius: 7px; background: linear-gradient(90deg, #3a5bff, #7a8cff); transition: width .2s ease; }

/* 表格分页（适老化大按钮） */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; margin-bottom: 8px; flex-wrap: nowrap; font-size: 14px; font-weight: 600; }
.pager button { min-height: 40px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.pager button:disabled { opacity: .45; }
.pager-info { text-align: center; font-weight: 700; color: #333; white-space: nowrap; }
/* 对照页分段选项卡 */
.seg { display: flex; gap: 8px; margin: 0 0 12px; }
.seg button { flex: 1; padding: 10px 8px; border: 1px solid #d6dbe8; background: #fff; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; color: #333; }
.seg button.active { background: #3a5bff; color: #fff; border-color: #3a5bff; }

.stats-cards { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: nowrap; }
.stats-card { flex: 1; min-width: 0; background: #fff; border-radius: 14px; padding: 14px 8px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.stats-card .v { font-size: 24px; font-weight: 800; margin-top: 6px; }
/* 年度/月份筛选同一行 */
.stat-filter { flex-wrap: nowrap; }
.stat-filter label { flex: 1; min-width: 0; }
.stats-card .v.c { color: #3a5bff; }
.stats-card .v.k { color: #0a8f4a; }
.stats-card .v.d { color: #d42222; }
