-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1342 lines (1195 loc) · 48.2 KB
/
Copy pathindex.html
File metadata and controls
1342 lines (1195 loc) · 48.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light">
<title>E順遞|雙幣拆價運費表</title>
<style>
:root {
--paper: #f4f0e7;
--paper-strong: #fffdf7;
--ink: #171816;
--muted: #6d6e68;
--line: #c8c2b6;
--line-soft: rgba(23, 24, 22, 0.12);
--signal: #d62924;
--signal-dark: #9f1e1a;
--signal-soft: #f4d3ce;
--zone-a: #c9342e;
--zone-a-soft: #fff0eb;
--zone-a-alt: #f9dfd8;
--zone-a-strong: #efb7ab;
--zone-b: #285548;
--zone-b-soft: #eaf2ed;
--zone-b-alt: #dce9e1;
--zone-b-strong: #b8d2c4;
--green: #0e7456;
--amber: #a45d00;
--shadow: 0 18px 55px rgba(41, 35, 28, 0.11);
--display: "Bodoni 72", "Bodoni MT", "Noto Serif TC", "PMingLiU", serif;
--body: "Aptos", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
min-width: 320px;
color: var(--ink);
background:
linear-gradient(90deg, transparent 0 48px, rgba(214, 41, 36, 0.11) 48px 49px, transparent 49px),
repeating-linear-gradient(0deg, transparent 0 31px, rgba(23, 24, 22, 0.035) 31px 32px),
var(--paper);
font-family: var(--body);
font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.shell {
width: min(1540px, calc(100% - 40px));
margin: 0 auto;
padding: 30px 0 72px;
}
.masthead {
position: relative;
overflow: hidden;
display: grid;
grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
gap: 34px;
min-height: 320px;
padding: 42px 46px;
color: white;
background: var(--ink);
box-shadow: var(--shadow);
animation: enter 620ms cubic-bezier(.2,.75,.2,1) both;
}
.masthead::before {
content: "";
position: absolute;
inset: -80px -80px auto auto;
width: 380px;
height: 380px;
border: 68px solid var(--signal);
border-radius: 50%;
opacity: 0.82;
}
.masthead::after {
content: "TW → CN";
position: absolute;
right: 26px;
bottom: 20px;
color: rgba(255,255,255,.08);
font: 700 clamp(60px, 9vw, 138px)/.8 var(--display);
letter-spacing: -0.05em;
white-space: nowrap;
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 10px;
margin: 0 0 20px;
color: #f0c0b9;
font-size: 12px;
font-weight: 800;
letter-spacing: .2em;
text-transform: uppercase;
}
.eyebrow::before {
content: "";
width: 38px;
height: 3px;
background: var(--signal);
}
h1 {
position: relative;
z-index: 1;
max-width: 850px;
margin: 0;
font: 700 clamp(52px, 7vw, 112px)/.82 var(--display);
letter-spacing: -.055em;
}
.deck {
position: relative;
z-index: 1;
max-width: 700px;
margin: 28px 0 0;
color: rgba(255,255,255,.72);
font-size: 16px;
line-height: 1.85;
}
.source-panel {
position: relative;
z-index: 2;
align-self: end;
padding: 26px;
border: 1px solid rgba(255,255,255,.18);
background: rgba(255,255,255,.07);
backdrop-filter: blur(10px);
}
.source-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 20px;
}
.source-heading h2 {
margin: 0;
font: 700 24px/1 var(--display);
}
.live-dot {
display: inline-flex;
align-items: center;
gap: 8px;
font-size: 12px;
font-weight: 800;
}
.live-dot::before {
content: "";
width: 9px;
height: 9px;
border-radius: 50%;
background: #aaa;
box-shadow: 0 0 0 5px rgba(255,255,255,.08);
}
.live-dot.live::before { background: #4fd1a2; }
.live-dot.warn::before { background: #ffb54a; }
.source-list {
display: grid;
gap: 10px;
margin: 0 0 20px;
padding: 0;
list-style: none;
}
.source-list li {
display: flex;
justify-content: space-between;
gap: 18px;
padding-bottom: 10px;
border-bottom: 1px solid rgba(255,255,255,.12);
color: rgba(255,255,255,.66);
font-size: 13px;
}
.source-list strong { color: white; font-weight: 700; text-align: right; }
.sync-button {
display: grid;
place-items: center;
width: 100%;
min-height: 45px;
border: 0;
color: white;
background: var(--signal);
font-weight: 800;
cursor: pointer;
text-decoration: none;
}
.sync-button:disabled { cursor: wait; opacity: .65; }
.notice {
display: none;
margin-top: 14px;
padding: 11px 13px;
color: #2c1b00;
background: #ffd895;
font-size: 12px;
line-height: 1.6;
}
.notice.show { display: block; }
.workspace {
display: grid;
grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
gap: 24px;
margin-top: 24px;
}
.card {
border: 1px solid var(--line);
background: rgba(255,253,247,.9);
box-shadow: 0 10px 28px rgba(41,35,28,.06);
animation: rise 560ms 120ms cubic-bezier(.2,.75,.2,1) both;
}
.controls {
align-self: start;
position: sticky;
top: 20px;
}
.card-head {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 16px;
padding: 22px 24px;
border-bottom: 1px solid var(--line);
}
.card-head h2 {
margin: 0;
font: 700 31px/1 var(--display);
letter-spacing: -.03em;
}
.card-head span {
color: var(--muted);
font-size: 11px;
font-weight: 800;
letter-spacing: .12em;
text-transform: uppercase;
}
.form-section {
padding: 22px 24px;
border-bottom: 1px solid var(--line);
}
.section-title {
display: flex;
align-items: center;
gap: 10px;
margin: 0 0 16px;
color: var(--signal-dark);
font-size: 12px;
font-weight: 900;
letter-spacing: .14em;
}
.section-title::before {
content: attr(data-step);
display: grid;
place-items: center;
width: 25px;
height: 25px;
color: white;
background: var(--signal);
border-radius: 50%;
letter-spacing: 0;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid .wide { grid-column: 1 / -1; }
label {
display: grid;
gap: 7px;
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
input, select {
width: 100%;
height: 44px;
border: 1px solid var(--line);
border-radius: 0;
color: var(--ink);
background: var(--paper-strong);
padding: 0 12px;
outline: none;
}
input:focus, select:focus {
border-color: var(--signal);
box-shadow: 0 0 0 3px var(--signal-soft);
}
.unit-field { position: relative; }
.unit-field input { padding-right: 50px; }
.unit-field b {
position: absolute;
right: 12px;
bottom: 13px;
color: var(--muted);
font-size: 11px;
}
.zone-key {
display: flex;
gap: 8px;
margin-top: 10px;
color: var(--muted);
font-size: 11px;
line-height: 1.5;
}
.zone-key::before {
content: "";
flex: 0 0 8px;
height: 8px;
margin-top: 4px;
background: var(--signal);
}
.field-note {
grid-column: 1 / -1;
margin: -3px 0 0;
color: var(--muted);
font-size: 11px;
line-height: 1.55;
}
.result-card {
padding: 24px;
color: white;
background: var(--signal);
}
.result-card small {
display: block;
color: rgba(255,255,255,.7);
font-weight: 800;
letter-spacing: .12em;
text-transform: uppercase;
}
.result-net-label {
margin-top: 16px;
color: rgba(255,255,255,.58);
font-size: 10px;
font-weight: 900;
letter-spacing: .12em;
}
.result-total {
margin: 8px 0 3px;
font: 700 58px/1 var(--display);
letter-spacing: -.04em;
}
.result-rmb {
margin: 12px 0 3px;
color: rgba(255,255,255,.78);
font: 700 27px/1.2 var(--display);
letter-spacing: -.02em;
}
.result-original,
.result-rmb-original {
color: rgba(255,255,255,.62);
font-size: 11px;
font-weight: 800;
}
.result-rmb-original { margin-bottom: 18px; }
.result-breakdown {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1px;
background: rgba(255,255,255,.28);
}
.result-breakdown div {
padding: 12px 9px;
background: var(--signal);
}
.result-breakdown span {
display: block;
color: rgba(255,255,255,.66);
font-size: 10px;
margin-bottom: 5px;
}
.result-breakdown strong { font-size: 16px; }
.price-stack {
display: inline-grid;
min-width: 76px;
gap: 5px;
line-height: 1.15;
text-align: right;
}
.price-currency {
display: grid;
gap: 2px;
white-space: nowrap;
}
.price-currency + .price-currency {
padding-top: 5px;
border-top: 1px solid rgba(17,17,17,.1);
}
.price-current {
color: var(--ink);
font-size: 12px;
font-weight: 900;
}
.price-original {
color: var(--muted);
font-size: 9px;
}
.price-changed .price-current { color: var(--signal-dark); }
.result-breakdown .price-stack { width: 100%; text-align: left; }
.result-breakdown .price-currency + .price-currency { border-top-color: rgba(255,255,255,.22); }
.result-breakdown .price-current { color: white; font-size: 14px; }
.result-breakdown .price-original { color: rgba(255,255,255,.62); }
.weight-note {
margin: 14px 0 0;
color: rgba(255,255,255,.72);
font-size: 11px;
line-height: 1.6;
}
.table-card { min-width: 0; }
.table-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px 20px;
border-bottom: 1px solid var(--line);
}
.table-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
color: var(--muted);
font-size: 12px;
}
.tag {
display: inline-flex;
align-items: center;
min-height: 26px;
padding: 0 9px;
color: var(--green);
background: #dcebe5;
font-weight: 900;
}
.zone-legend {
display: inline-flex;
align-items: center;
min-height: 28px;
padding: 0 10px;
border: 1px solid transparent;
font-size: 11px;
font-weight: 900;
}
.zone-legend::before {
content: "";
width: 9px;
height: 9px;
margin-right: 7px;
border-radius: 50%;
}
.zone-legend-a {
color: #81201c;
background: var(--zone-a-soft);
border-color: #e8b5aa;
}
.zone-legend-a::before { background: var(--zone-a); }
.zone-legend-b {
color: #193f35;
background: var(--zone-b-soft);
border-color: #aacabd;
}
.zone-legend-b::before { background: var(--zone-b); }
.toolbar-actions { display: flex; gap: 8px; }
.ghost-button {
min-height: 36px;
padding: 0 13px;
border: 1px solid var(--ink);
color: var(--ink);
background: transparent;
font-size: 12px;
font-weight: 800;
cursor: pointer;
}
.table-scroll { overflow: auto; max-height: 1120px; }
table {
width: 100%;
min-width: 900px;
border-collapse: separate;
border-spacing: 0;
font-size: 12px;
}
th, td {
padding: 10px 9px;
text-align: right;
border-right: 1px solid var(--line-soft);
border-bottom: 1px solid var(--line-soft);
white-space: nowrap;
}
th {
position: sticky;
top: 0;
z-index: 3;
color: white;
background: var(--ink);
font-size: 11px;
letter-spacing: .04em;
}
thead tr:first-child th {
top: 0;
padding-top: 14px;
padding-bottom: 14px;
font: 700 18px/1 var(--display);
letter-spacing: 0;
}
thead tr:nth-child(2) th { top: 46px; }
th:first-child, td:first-child {
position: sticky;
left: 0;
z-index: 2;
text-align: center;
background: #ece6da;
font-weight: 900;
}
thead th:first-child { z-index: 5; color: white; background: var(--ink); }
.zone-a { background: var(--zone-a); }
.zone-b { background: var(--zone-b); }
.subhead-a {
color: #6e1b18;
background: #efc5bb;
}
.subhead-b {
color: #173b31;
background: #bfd5ca;
}
th.zone-divider,
td.zone-divider {
border-left: 5px solid var(--paper-strong);
}
tbody td.zone-a-cell { background: var(--zone-a-soft); }
tbody td.zone-b-cell { background: var(--zone-b-soft); }
tbody tr:nth-child(even) td.zone-a-cell { background: var(--zone-a-alt); }
tbody tr:nth-child(even) td.zone-b-cell { background: var(--zone-b-alt); }
.total-column {
font-weight: 950;
box-shadow: inset 4px 0 0 rgba(23,24,22,.08);
}
tbody tr.selected td:first-child {
color: #5d1b17;
background: #f0c8bd;
box-shadow: inset 5px 0 0 var(--signal);
}
tbody tr.selected td.zone-a-cell {
color: #6f1714;
background: var(--zone-a-strong);
font-weight: 900;
}
tbody tr.selected td.zone-b-cell {
color: #123a2f;
background: var(--zone-b-strong);
font-weight: 900;
}
tbody tr:hover td.zone-a-cell { box-shadow: inset 0 0 0 999px rgba(201,52,46,.07); }
tbody tr:hover td.zone-b-cell { box-shadow: inset 0 0 0 999px rgba(40,85,72,.07); }
tbody tr:hover td.total-column { box-shadow: inset 4px 0 0 rgba(23,24,22,.14), inset 0 0 0 999px rgba(23,24,22,.025); }
.footnotes {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 24px;
margin-top: 24px;
padding: 26px 28px;
border-top: 5px solid var(--ink);
color: var(--muted);
background: rgba(255,253,247,.68);
font-size: 12px;
line-height: 1.75;
animation: rise 560ms 220ms cubic-bezier(.2,.75,.2,1) both;
}
.footnotes h3 {
margin: 0 0 8px;
color: var(--ink);
font: 700 22px/1 var(--display);
}
.footnotes p { margin: 0; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.source-links a { color: var(--signal-dark); font-weight: 800; }
@keyframes enter {
from { opacity: 0; transform: translateY(16px) scale(.992); }
to { opacity: 1; transform: none; }
}
@keyframes rise {
from { opacity: 0; transform: translateY(22px); }
to { opacity: 1; transform: none; }
}
@media (max-width: 980px) {
.shell { width: min(100% - 24px, 900px); padding-top: 12px; }
.masthead { grid-template-columns: 1fr; padding: 34px 30px; }
.source-panel { max-width: 560px; }
.workspace { grid-template-columns: 1fr; }
.controls { position: static; }
.footnotes { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
body { background-position-x: -28px; }
.shell { width: 100%; padding: 0 0 50px; }
.masthead { min-height: 0; padding: 28px 20px 24px; }
.masthead::before { width: 240px; height: 240px; border-width: 42px; }
h1 { font-size: 52px; }
.deck { font-size: 14px; }
.source-panel { padding: 20px; }
.workspace { margin-top: 12px; gap: 12px; }
.card { border-left: 0; border-right: 0; }
.field-grid { grid-template-columns: 1fr; }
.field-grid .wide { grid-column: auto; }
.table-toolbar { align-items: flex-start; flex-direction: column; }
.table-meta { align-items: flex-start; }
.result-total { font-size: 50px; }
.footnotes { margin-top: 12px; padding: 22px 20px; }
}
@media print {
body { background: white; }
.shell { width: 100%; padding: 0; }
.masthead { min-height: 0; padding: 20px; box-shadow: none; }
.source-panel, .controls, .toolbar-actions, .footnotes { display: none !important; }
.workspace { display: block; margin: 12px 0 0; }
.card { box-shadow: none; border: 0; }
.table-scroll { overflow: visible; max-height: none; }
table { min-width: 0; font-size: 9px; }
th, td { padding: 5px 4px; }
th, td { position: static !important; }
}
</style>
</head>
<body>
<main class="shell">
<header class="masthead">
<div>
<p class="eyebrow">Taiwan → Mainland China · E-Ship</p>
<h1>E順遞<br>拆價運費表</h1>
<p class="deck">基本運費與燃油附加費可分別設定折扣,資源調節費固定不折扣。原價與折後價同時顯示,折後金額如有小數一律向上進位;人民幣直接採用官網「到付價」拆解。</p>
</div>
<aside class="source-panel" aria-live="polite">
<div class="source-heading">
<h2>官方資料狀態</h2>
<span id="liveStatus" class="live-dot warn">準備同步</span>
</div>
<ul class="source-list">
<li><span>燃油費率</span><strong id="sourceFuel">依寄件日期</strong></li>
<li><span>資源調節費</span><strong id="sourceResource">NT$20 / kg</strong></li>
<li><span>人民幣到付價</span><strong id="sourceRmb">等待官方查價</strong></li>
<li><span>基本運費版本</span><strong id="sourceBase">2025年4月1日</strong></li>
<li><span>最後核對</span><strong id="sourceChecked">尚未同步</strong></li>
</ul>
<button id="syncButton" class="sync-button" type="button">立即同步順豐官網</button>
<div id="sourceNotice" class="notice"></div>
</aside>
</header>
<section class="workspace">
<aside class="card controls">
<div class="card-head">
<h2>試算條件</h2>
<span>Calculator</span>
</div>
<div class="form-section">
<h3 class="section-title" data-step="1">貨件資料</h3>
<div class="field-grid">
<label class="wide">目的地
<select id="destination"></select>
</label>
<label class="wide">預計寄件日期與時間
<input id="shippingDateTime" type="datetime-local">
</label>
<label class="unit-field">實際重量
<input id="actualWeight" type="number" min="0.1" max="20" step="0.1" value="1">
<b>kg</b>
</label>
<label class="unit-field">材積除數
<input id="volumeDivisor" type="number" min="1" step="1" value="6000">
<b>÷</b>
</label>
<label class="unit-field">長
<input id="length" type="number" min="0" step="0.1" value="1">
<b>cm</b>
</label>
<label class="unit-field">寬
<input id="width" type="number" min="0" step="0.1" value="1">
<b>cm</b>
</label>
<label class="unit-field wide">高
<input id="height" type="number" min="0" step="0.1" value="1">
<b>cm</b>
</label>
<p class="field-note">燃油費以寄件日期所落入的順豐週期計算;時間不影響燃油費率,但會保留在試算條件中。</p>
</div>
<div id="zoneHint" class="zone-key"></div>
</div>
<div class="form-section">
<h3 class="section-title" data-step="2">費率與折扣</h3>
<div class="field-grid">
<label class="unit-field">燃油費率
<input id="fuelRate" type="number" min="0" step="0.01" value="32.75">
<b>%</b>
</label>
<label class="unit-field">調節費
<input id="resourceRate" type="number" min="0" step="1" value="20">
<b>元/kg</b>
</label>
<label>表格幣別
<select id="currencyMode">
<option value="both">台幣+人民幣</option>
<option value="twd">只顯示台幣</option>
<option value="rmb">只顯示人民幣</option>
</select>
</label>
<label class="unit-field">基本運費折扣
<input id="baseDiscount" type="number" min="0" max="200" step="1" value="100">
<b>%</b>
</label>
<label class="unit-field">燃油費折扣
<input id="fuelDiscount" type="number" min="0" max="200" step="1" value="100">
<b>%</b>
</label>
<label>燃油計算基礎
<select id="fuelBasis">
<option value="list">公開基本運費(不隨運費折扣)</option>
<option value="discounted">折後基本運費</option>
</select>
</label>
</div>
</div>
<div class="result-card" aria-live="polite">
<small id="resultLabel">E順遞 · 其他省份 · 1 kg</small>
<div class="result-net-label">試算總額</div>
<div id="resultTotal" class="result-total">NT$284</div>
<div id="resultTotalOriginal" class="result-original">原價 NT$284</div>
<div id="resultTotalRmb" class="result-rmb">折後 RMB 正在同步</div>
<div id="resultTotalRmbOriginal" class="result-rmb-original">原價 RMB 正在同步</div>
<div class="result-breakdown">
<div><span>基本運費</span><strong id="resultBase">199</strong></div>
<div><span>燃油費</span><strong id="resultFuel">65</strong></div>
<div><span>調節費</span><strong id="resultResource">20</strong></div>
</div>
<p id="weightNote" class="weight-note"></p>
</div>
</aside>
<section class="card table-card">
<div class="card-head">
<h2>完整重量級距</h2>
<span>0.5–20 kg</span>
</div>
<div class="table-toolbar">
<div class="table-meta">
<span id="tableMode" class="tag">寄件日官方燃油</span>
<span class="zone-legend zone-legend-a">A區 · 暖紅</span>
<span class="zone-legend zone-legend-b">B區 · 冷綠</span>
<span id="currencyCaption">主數字為應付價;有折扣差異時才顯示原價</span>
</div>
<div class="toolbar-actions">
<button id="csvButton" class="ghost-button" type="button">匯出 CSV</button>
<button id="printButton" class="ghost-button" type="button">列印</button>
</div>
</div>
<div class="table-scroll">
<table aria-label="E順遞拆價運費表">
<thead>
<tr>
<th rowspan="2">重量</th>
<th class="zone-a" colspan="4">A區 · 福建/廣東/江西/海南/廣西</th>
<th class="zone-b" colspan="4">B區 · 中國大陸其他服務省份</th>
</tr>
<tr>
<th class="subhead-a">基本運費</th><th class="subhead-a">燃油費</th><th class="subhead-a">調節費</th><th class="subhead-a">總運費</th>
<th class="subhead-b zone-divider">基本運費</th><th class="subhead-b">燃油費</th><th class="subhead-b">調節費</th><th class="subhead-b">總運費</th>
</tr>
</thead>
<tbody id="rateTableBody"></tbody>
</table>
</div>
</section>
</section>
<footer class="footnotes">
<div>
<h3>計費規則</h3>
<p>計費重量取實際重量與材積重量較大者;材積重量=長×寬×高÷6000。20 kg 以下以 0.5 kg 進位。基本運費及燃油費可分別折扣,資源調節費固定不折扣;折後金額如有小數,一律無條件進位至整數。</p>
</div>
<div>
<h3>資料與責任</h3>
<p>啟動 Windows 或 macOS 本機服務後,工具會從順豐官網抓取燃油週期,以及 E順遞「到付價」的人民幣基本運費、燃油附加費、資源調節費與總運費。人民幣不由台幣換算;同步失敗時顯示「—」,不產生估算值。最終收費仍以順豐結算為準。</p>
<div class="source-links">
<a href="https://htm.sf-express.com/tw/tc/Customer_Zone/download_center/fuel_additional/" target="_blank" rel="noreferrer">燃油附加費來源</a>
<a href="https://htm.sf-express.com/tw/tc/Customer_Zone/download_center/price_down/" target="_blank" rel="noreferrer">E順遞價目表來源</a>
<a href="https://htm.sf-express.com/we/ow/#/tw/tc/price-query" target="_blank" rel="noreferrer">人民幣到付價來源</a>
</div>
</div>
</footer>
</main>
<script>
const BASE_RATES = {
A: [142,151,208,266,323,380,392,450,509,568,626,685,744,802,861,920,978,1037,1095,1154,1213,1271,1330,1389,1447,1506,1565,1623,1682,1741,1799,1858,1917,1975,2034,2093,2151,2210,2268,2300],
B: [185,199,280,363,444,525,533,608,682,757,831,905,980,1054,1129,1203,1277,1352,1426,1501,1575,1649,1724,1798,1873,1947,2021,2096,2170,2245,2319,2393,2468,2542,2617,2691,2765,2840,2914,2940]
};
const DESTINATIONS = [
["北京市","B"],["天津市","B"],["上海市","B"],["重慶市","B"],
["福建省","A"],["廣東省","A"],["江西省","A"],["海南省","A"],["廣西壯族自治區","A"],
["河北省","B"],["山西省","B"],["遼寧省","B"],["吉林省","B"],["黑龍江省","B"],
["江蘇省","B"],["浙江省","B"],["安徽省","B"],["山東省","B"],["河南省","B"],
["湖北省","B"],["湖南省","B"],["四川省","B"],["貴州省","B"],["雲南省","B"],
["陝西省","B"],["甘肅省","B"],["青海省","B"],["內蒙古自治區","B"],
["寧夏回族自治區","B"],["新疆維吾爾自治區","B"],["西藏自治區","NONE"]
];
const FALLBACK = {
fuelRate: 32.75,
fuelPeriod: "2026/7/27-2026/8/2",
resourceRate: 20,
baseEffective: "2025年4月1日"
};
let officialRmbRates = { A: {}, B: {} };
let officialRmbMeta = { count: 0, expectedCount: 80, checkedAt: null, shippingTime: "" };
let syncSequence = 0;
let fuelSchedule = [
{ start: "2026-07-27", end: "2026-08-02", rate: 32.75 },
{ start: "2026-07-20", end: "2026-07-26", rate: 26.50 },
{ start: "2026-07-13", end: "2026-07-19", rate: 25.25 },
{ start: "2026-07-06", end: "2026-07-12", rate: 25.00 },
{ start: "2026-06-29", end: "2026-07-05", rate: 25.50 },
{ start: "2026-06-22", end: "2026-06-28", rate: 29.00 },
{ start: "2026-06-15", end: "2026-06-21", rate: 31.25 },
{ start: "2026-06-08", end: "2026-06-14", rate: 30.25 },
{ start: "2026-06-01", end: "2026-06-07", rate: 40.50 },
{ start: "2026-05-25", end: "2026-05-31", rate: 41.00 },
{ start: "2026-05-18", end: "2026-05-24", rate: 39.75 },
{ start: "2026-05-11", end: "2026-05-17", rate: 41.25 }
];
const money = new Intl.NumberFormat("zh-TW", { maximumFractionDigits: 0 });
const rmbMoney = new Intl.NumberFormat("zh-TW", { minimumFractionDigits: 1, maximumFractionDigits: 1 });
const elements = Object.fromEntries([
"destination","shippingDateTime","actualWeight","volumeDivisor","length","width","height","fuelRate","resourceRate","currencyMode",
"baseDiscount","fuelDiscount","fuelBasis","zoneHint","resultLabel","resultTotal","resultTotalOriginal","resultTotalRmb","resultTotalRmbOriginal",
"resultBase","resultFuel","resultResource","weightNote","rateTableBody","syncButton","liveStatus",
"sourceFuel","sourceResource","sourceRmb","sourceBase","sourceChecked","sourceNotice","tableMode","currencyCaption","csvButton","printButton"
].map((id) => [id, document.getElementById(id)]));
function value(id, fallback = 0) {
const number = Number(elements[id].value);
return Number.isFinite(number) ? number : fallback;
}
function ceilMoney(number) {
return Math.ceil(Math.max(0, Number(number) || 0) - 1e-9);
}
function rmbBreakdown(zone, weight) {
const source = officialRmbRates[zone]?.[Number(weight).toFixed(1)];
if (!source) return null;
const baseFactor = value("baseDiscount", 100) / 100;
const fuelFactor = value("fuelDiscount", 100) / 100;
const discountedFuelFactor = elements.fuelBasis.value === "discounted" ? baseFactor : 1;
const fuelMultiplier = fuelFactor * discountedFuelFactor;
const base = baseFactor === 1 ? source.base : ceilMoney(source.base * baseFactor);
const fuel = fuelMultiplier === 1 ? source.fuel : ceilMoney(source.fuel * fuelMultiplier);
const resource = source.resource;
const unchanged = baseFactor === 1 && fuelMultiplier === 1;
const total = unchanged ? source.total : base + fuel + resource;
return { base, fuel, resource, total, source };
}
function samePrice(original, current) {
return original != null && current != null && Math.abs(Number(original) - Number(current)) < 1e-9;
}
function priceCurrency(original, current, currency) {
const formatter = currency === "twd" ? money : rmbMoney;
const prefix = currency === "twd" ? "NT$" : "RMB ";
const currentText = current == null ? `${prefix}—` : `${prefix}${formatter.format(current)}`;
const unchanged = samePrice(original, current);
const changed = original != null && current != null && !unchanged;
const originalLine = !unchanged && original != null
? `<span class="price-original">原 ${prefix}${formatter.format(original)}</span>`
: "";
return `<span class="price-currency ${changed ? "price-changed" : ""}">
<strong class="price-current">${currentText}</strong>${originalLine}
</span>`;
}
function priceCell(twdOriginal, twdNet, rmbOriginal, rmbNet) {
const mode = elements.currencyMode.value;
const twdPrice = priceCurrency(twdOriginal, twdNet, "twd");
const rmbPrice = priceCurrency(rmbOriginal, rmbNet, "rmb");
if (mode === "twd") return `<span class="price-stack">${twdPrice}</span>`;
if (mode === "rmb") return `<span class="price-stack">${rmbPrice}</span>`;
return `<span class="price-stack">${twdPrice}${rmbPrice}</span>`;
}
function localDateTimeValue(date = new Date()) {
const shifted = new Date(date.getTime() - date.getTimezoneOffset() * 60000);
return shifted.toISOString().slice(0, 16);
}
function displayDate(isoDate) {
const [year, month, day] = isoDate.split("-");
return `${year}/${Number(month)}/${Number(day)}`;