/* D：三列任务，阅读与作答相邻。 */
.stage-D .d18-sheet{height:850px;display:grid;grid-template-columns:.96fr 1fr 1.16fr;gap:16px;font-size:20px;line-height:1.4;color:#25483f}
.stage-D .d18-panel{min-width:0;min-height:0;border:1px solid #d5d9c8;border-radius:18px;padding:15px;box-shadow:0 5px 10px #344b3f08,0 1px 0 #fff inset;background:#fffdf6}
.stage-D .d21-column-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:47px;border-bottom:1px solid #d6decd;padding-bottom:10px}
.stage-D .d21-column-head h2{display:flex;align-items:center;gap:12px;font-size:30px;line-height:1.2;white-space:nowrap;margin:0;font-weight:800;letter-spacing:1px}
.stage-D .d21-column-head h2 i{display:inline-flex;align-items:center;justify-content:center;width:45px;height:43px;border-radius:13px;font-family:Georgia,serif;font-size:28px;line-height:1;font-style:normal;letter-spacing:0;color:#fff;background:#9e7837;box-shadow:inset 0 1px 1px #ffffff60,0 3px 0 #d4c298}
.stage-D .d21-column-head>span{font-size:18px;line-height:1.3;color:#6b796e;text-align:right;max-width:260px}
.stage-D .d18-sheet h3{margin:0;font-size:25px;line-height:1.35}
.stage-D .d18-calc{display:flex;flex-direction:column;gap:13px;background:linear-gradient(160deg,#fffdf7,#faf4e6);border-color:#dcca9e}
.stage-D .d18-calc .d21-column-head{border-color:#ded1af;color:#785b28}
.stage-D .d18-calc-problem{display:flex;flex-direction:column;gap:12px;min-width:0}
.stage-D .d18-calc-problem>h3{font-size:26px;color:#594b32}
.stage-D .d21-sample{border:1px solid #ded0ae;border-radius:13px;overflow:hidden;background:#fffef9;box-shadow:0 3px 0 #e9dfc649}
.stage-D .d21-sample-title{padding:5px 13px;font-size:20px;letter-spacing:.8px;color:#7e632d;background:#f2e6c9;border-bottom:1px solid #e0d3b3;font-weight:750}
.stage-D .d21-sample-data{display:grid;grid-template-columns:.75fr 1.25fr;padding:5px 13px 3px}
.stage-D .d21-sample-data>div{display:flex;align-items:center;flex-direction:column;gap:3px}
.stage-D .d21-sample-data>div+div{border-left:1px solid #e6deca}
.stage-D .d21-sample-data span{font-size:19px;color:#6c705e}
.stage-D .d21-sample-data strong{font-size:30px;font-weight:800;color:#77591f;line-height:1.1}
.stage-D .d21-sample-data small{font-size:20px;font-weight:600}
.stage-D .d18-formula{font-family:'Times New Roman','PingFang SC',serif;font-size:27px;line-height:1.2;text-align:center;color:#355a4c;padding:2px 12px}
.stage-D .d18-formula sub,.stage-D .d18-formula sup{font-size:70%}
.stage-D .d21-constants{display:flex;justify-content:center;gap:26px;padding:3px 10px 5px;font-size:21px;font-family:'Times New Roman','PingFang SC',serif;color:#5b614e}
.stage-D .d18-food-data{border:1px solid #e0d5b9;border-radius:12px;background:#fffdf7;overflow:hidden}
.stage-D .d18-food-data .d21-data-title{font-size:20px;font-weight:750;background:#f4eddb;padding:7px 12px}
.stage-D .d21-data-title span{font-size:17px;font-weight:500;margin-left:auto;color:#777461}
.stage-D .d18-food-data>div{display:flex;align-items:center;justify-content:space-between;padding:5px 14px;font-size:21px;line-height:1.25}
.stage-D .d18-food-data>div+div{border-top:1px solid #eee6d1}
.stage-D .d18-food-data strong{color:#8c6626;font-size:24px;font-variant-numeric:tabular-nums}
.stage-D .d18-food-data small{font-size:19px;font-weight:550}
.stage-D .d18-calc-response{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0}
.stage-D .d18-task{display:flex;flex-direction:column;gap:2px;font-size:20px}
.stage-D .d18-task>b{font-weight:750}
.stage-D .d18-task>span{font-size:18px;color:#7b725c}
.stage-D .d18-number-row{display:grid;grid-template-rows:repeat(3,62px);gap:9px}
.stage-D .d18-number-row label{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 166px;align-items:center;gap:9px;padding:6px 8px 6px 10px;background:linear-gradient(105deg,#f7e8c5,#fffaf0);border:1px solid #debf7e;border-radius:12px;box-shadow:0 3px 0 #e8dbc061,0 1px 0 white inset}
.stage-D .d18-number-row b{display:flex;align-items:center;gap:8px;font-size:21px;font-weight:700;white-space:nowrap}
.stage-D .d21-field-index{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border-radius:7px;font-size:16px;color:#94692d;background:#fffcf2;border:1px solid #dcc48e}
.stage-D .d18-number{display:flex;align-items:center;border:1px solid #c9af73;background:#fffdf8;border-radius:9px;height:46px;overflow:hidden;box-shadow:0 2px 3px #8e6a2820 inset}
.stage-D .d18-number input{appearance:textfield;-moz-appearance:textfield;background:transparent;border:0;width:100%;min-width:0;height:44px;box-shadow:none;padding:4px 10px;font-size:27px!important;font-weight:700;color:#795a24;font-variant-numeric:tabular-nums;text-align:right}
.stage-D .d18-number input::-webkit-inner-spin-button,.stage-D .d18-number input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.stage-D .d18-number input::placeholder{font-size:19px;font-weight:500;color:#a28e68;text-align:left}
.stage-D .d18-number em{font-size:20px;font-style:normal;padding:0 9px;color:#8c754d}
.stage-D .d18-boundary{font-size:17px;color:#80785f;line-height:1.35;display:block;margin-top:auto}
.stage-D .d18-sheet textarea{min-height:0;width:100%;resize:none;font-size:20px!important;line-height:1.35;padding:7px 11px;background:linear-gradient(150deg,#fffefa,#f6fbf8);border:1px solid #99bcb1;border-radius:10px;box-shadow:0 2px 4px #28574712 inset,0 2px 0 #fff;transition:border-color .15s,box-shadow .15s;color:#254d43}
.stage-D .d18-sheet textarea::placeholder{font-size:19px;color:#728d82}
.stage-D .d18-sheet textarea:focus{border-color:#2a9685;box-shadow:0 0 0 3px #49a89522,0 2px 4px #2857470d inset}
.stage-D .d18-sheet textarea:not(:placeholder-shown){background:#f0faf4;border-color:#6aab91}
.stage-D .d18-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;min-width:0;min-height:42px}
.stage-D .d18-actions>span{font-size:16px;line-height:1.25;color:#547160;min-width:0;overflow-wrap:anywhere}
.stage-D .d18-actions>button{flex-shrink:0;font-size:20px!important;line-height:1.2;min-height:39px;padding:7px 12px;border:1px solid #aac6b5;border-radius:9px;font-weight:700;background:#fffef8;color:#275b4d;box-shadow:0 2px 0 #d4ded1,0 1px 0 #fff inset;white-space:nowrap}
.stage-D .d18-actions>button.primary{background:linear-gradient(180deg,#1a8275,#11695e);color:#fff;border-color:#146d63;box-shadow:0 3px 0 #0b564b,0 1px 0 #ffffff70 inset}
.stage-D .d18-actions>button:active{transform:translateY(1px);box-shadow:0 1px 0 #93afa0}
.stage-D .d18-calc .d18-actions{margin-top:1px}
.stage-D .d18-calc .d18-actions>.primary{background:linear-gradient(#ab813b,#8d672d);border-color:#88632a;box-shadow:0 3px 0 #73511f,0 1px 0 #ffffff80 inset}
.stage-D .d18-weigh{display:flex;flex-direction:column;gap:14px;background:linear-gradient(160deg,#f5fafb,#f6f7f2);border-color:#bbd0d6}
.stage-D .d18-weigh .d21-column-head{color:#315f71;border-color:#c6d8dc}
.stage-D .d18-weigh .d21-column-head h2 i{background:#3d7d90;box-shadow:inset 0 1px 1px #ffffff60,0 3px 0 #bad2d9}
.stage-D .d18-question{padding:16px 15px 12px;display:flex;flex-direction:column;gap:15px;background:linear-gradient(145deg,#e6f1f6,#e0edf0);border:1px solid #b6d1db;border-radius:14px;box-shadow:0 3px 0 #c9dce13f,0 1px 0 #fff inset}
.stage-D .d18-question h3{font-size:27px;line-height:1.4;color:#255565;font-weight:800}
.stage-D .d18-priority-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stage-D .d18-priority-choices button{display:flex;align-items:center;justify-content:center;gap:7px;font-size:20px!important;font-weight:700;min-height:48px;padding:7px 5px;border-radius:12px;background:linear-gradient(#fff,#f0f8fa);color:#356675;border:1px solid #97bac6;box-shadow:0 3px 0 #bdd2d7,0 1px 0 white inset;white-space:nowrap}
.stage-D .d18-priority-choices button>span{width:17px;height:17px;border:1px solid #8baebc;border-radius:50%;background:#fff;flex-shrink:0}
.stage-D .d18-priority-choices button.selected{color:white;background:linear-gradient(#4a899c,#326d80);border-color:#316c80;box-shadow:0 3px 0 #255c6c,0 1px 0 #b7d9e3 inset}
.stage-D .d18-priority-choices button.selected>span{background:#fff;box-shadow:inset 0 0 0 4px #36768b;border-color:#fff}
.stage-D .d21-reason{display:grid;grid-template-rows:29px 91px;gap:6px}
.stage-D .d21-reason>b{font-size:22px;color:#355e69}
.stage-D .d18-question textarea{background:linear-gradient(#fff,#f3faff);border-color:#87b2c2;color:#2f6172}
.stage-D .d18-question textarea::placeholder{color:#7d9aa6}
.stage-D .d18-question textarea:not(:placeholder-shown){background:#f2faff;border-color:#5691a7}
.stage-D .d18-question .d18-actions>.primary{background:linear-gradient(#418296,#306d80);border-color:#2e6d80;box-shadow:0 3px 0 #225567,0 1px 0 #ffffff70 inset}
.stage-D .d18-compare{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1}
.stage-D .d18-compare>h3{font-size:22px;line-height:1.2;font-weight:700;color:#65776b;display:flex;align-items:center;gap:9px}
.stage-D .d18-compare>h3:before{content:'';height:18px;width:4px;border-radius:2px;background:#aabcb1}
.stage-D .d18-table-frame{border:1px solid #d2dbd2;border-radius:11px;overflow:hidden;background:#fafbf6;min-height:0;flex:1}
.stage-D .d18-compare table{width:100%;height:100%;table-layout:fixed;border-collapse:collapse}
.stage-D .d18-compare th,.stage-D .d18-compare td{border-bottom:1px solid #dce2d9;border-right:1px solid #e1e7de;padding:7px 9px;font-size:19px;line-height:1.35;text-align:left;vertical-align:middle;color:#5c6c61;overflow-wrap:break-word}
.stage-D .d18-compare thead th{background:#e9eee5;font-size:20px;font-weight:700;height:40px;color:#53685c}
.stage-D .d18-compare tbody th{font-weight:700;background:#f0f3ea;font-size:19px;color:#536b5c}
.stage-D .d18-compare tbody tr:nth-child(even) td{background:#f4f6f0}
.stage-D .d18-compare tr:last-child>*{border-bottom:0}
.stage-D .d18-people{display:grid;grid-template-rows:49px minmax(0,1fr);gap:12px;background:linear-gradient(150deg,#f2f8f2,#ecf4ea);border-color:#bed0b9}
.stage-D .d18-people .d21-column-head{color:#366a50}
.stage-D .d18-people .d21-column-head h2 i{background:#407b59;box-shadow:inset 0 1px 1px #ffffff60,0 3px 0 #baceb3}
.stage-D .d18-case-grid{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:7px;min-height:0}
.stage-D .d18-case{border:1px solid #bbd1bf;border-radius:13px;background:linear-gradient(120deg,#fffefa,#f8fcf4);box-shadow:0 3px 0 #cedecc77,0 1px 0 white inset;padding:5px 12px;display:grid;grid-template-rows:54px 78px 60px minmax(36px,1fr);gap:2px;min-width:0;min-height:0}
.stage-D .d18-person{display:flex;align-items:center;gap:10px;min-width:0}
.stage-D .d18-person svg{display:block;width:63px;height:56px;flex-shrink:0;background:#edf4e6;border-radius:12px}
.stage-D .d18-person>div{min-width:0}
.stage-D .d18-person h3{font-size:24px;line-height:1.2;margin:0 0 3px;color:#2d5e49}
.stage-D .d18-person p{font-size:19px;color:#6b7c67;line-height:1.25;margin:0}
.stage-D .d18-case-choices{display:grid;grid-template-rows:repeat(3,26px);gap:0}
.stage-D .d18-case-choices button{padding:0 6px;display:flex;align-items:center;gap:8px;text-align:left;border:1px solid transparent;background:transparent;border-radius:6px;font-size:20px!important;line-height:24px;color:#315647}
.stage-D .d18-case-choices button>span{width:16px;height:16px;border:1px solid #93b19a;border-radius:50%;background:#fff;flex-shrink:0}
.stage-D .d18-case-choices button:hover{background:#eaf3e5}
.stage-D .d18-case-choices button.selected{background:#e2efda;border-color:#9fbd98;font-weight:750}
.stage-D .d18-case-choices button.selected>span{background:#337957;box-shadow:inset 0 0 0 3px #f5fbef;border-color:#337957}
.stage-D .d18-case textarea{padding:5px 11px;background:linear-gradient(#fafff8,#eff8e8);border-color:#8fb59a;box-shadow:0 2px 4px #38603b12 inset,0 2px 0 #fff;border-radius:9px;font-size:19px!important;line-height:24px}
.stage-D .d18-case textarea::placeholder{font-size:19px;color:#78906f}
.stage-D .d18-case textarea:not(:placeholder-shown){border-color:#6b9e72;background:#eef9e8}
.stage-D .d18-case .d18-actions{min-height:36px;gap:7px}
.stage-D .d18-case .d18-actions>button{font-size:18px!important;min-height:33px;padding:5px 10px}
.stage-D .d18-case .d18-actions>span{font-size:15px;line-height:1.2}
.stage-D .d18-sheet :is(button,input,textarea):focus-visible{outline:3px solid #bb9144;outline-offset:2px}
.stage-D .d18-sheet button{transition:background .15s,border-color .15s,box-shadow .15s}
.stage-D.mobile-flow .d18-sheet{height:auto;grid-template-columns:1fr;gap:18px}
.stage-D.mobile-flow .d18-panel{padding:14px;border-radius:15px}
.stage-D.mobile-flow .d21-column-head{align-items:flex-start;min-height:50px}
.stage-D.mobile-flow .d21-column-head h2{font-size:26px;gap:9px}
.stage-D.mobile-flow .d21-column-head h2 i{width:39px;height:37px;font-size:24px;border-radius:10px}
.stage-D.mobile-flow .d21-column-head>span{font-size:16px;max-width:145px;padding-top:6px}
.stage-D.mobile-flow .d18-calc{gap:14px}
.stage-D.mobile-flow .d18-calc-problem>h3{font-size:24px}
.stage-D.mobile-flow .d21-sample-data span{font-size:17px}
.stage-D.mobile-flow .d21-sample-data strong{font-size:27px}
.stage-D.mobile-flow .d21-constants{gap:16px;font-size:20px}
.stage-D.mobile-flow .d21-data-title span{font-size:15px}
.stage-D.mobile-flow .d18-task>b{font-size:19px}
.stage-D.mobile-flow .d18-task>span{font-size:16px}
.stage-D.mobile-flow .d18-number-row{grid-template-rows:repeat(3,65px)}
.stage-D.mobile-flow .d18-number-row label{grid-template-columns:minmax(0,1fr) 123px;padding-left:7px;gap:4px}
.stage-D.mobile-flow .d18-number-row b{font-size:18px;gap:5px}
.stage-D.mobile-flow .d21-field-index{width:19px;height:22px;font-size:14px}
.stage-D.mobile-flow .d18-number input{font-size:25px!important;padding:5px 7px}
.stage-D.mobile-flow .d18-number em{font-size:18px;padding:0 7px}
.stage-D.mobile-flow .d18-actions{grid-template-columns:minmax(0,1fr) auto auto;row-gap:7px}
.stage-D.mobile-flow .d18-actions>span{font-size:15px;grid-column:1/-1}
.stage-D.mobile-flow .d18-actions>span:empty{display:none}
.stage-D.mobile-flow .d18-actions>button.primary{grid-column:2}
.stage-D.mobile-flow .d18-boundary{margin-top:3px;font-size:16px}
.stage-D.mobile-flow .d18-question{padding:13px;gap:14px}
.stage-D.mobile-flow .d18-question h3{font-size:24px}
.stage-D.mobile-flow .d18-priority-choices{gap:6px}
.stage-D.mobile-flow .d18-priority-choices button{font-size:18px!important;gap:5px;min-height:46px;padding:6px 3px}
.stage-D.mobile-flow .d18-priority-choices button>span{width:14px;height:14px}
.stage-D.mobile-flow .d21-reason{grid-template-rows:27px 92px}
.stage-D.mobile-flow .d21-reason>b{font-size:21px}
.stage-D.mobile-flow .d18-table-frame{flex:initial}
.stage-D.mobile-flow .d18-compare th,.stage-D.mobile-flow .d18-compare td{padding:9px 7px;font-size:17px;overflow-wrap:anywhere}
.stage-D.mobile-flow .d18-compare thead th{font-size:17px}
.stage-D.mobile-flow .d18-people{grid-template-rows:auto auto;gap:14px}
.stage-D.mobile-flow .d18-case-grid{grid-template-rows:none;gap:13px}
.stage-D.mobile-flow .d18-case{grid-template-rows:auto auto 65px auto;gap:8px;padding:12px}
.stage-D.mobile-flow .d18-person{align-items:center;min-height:68px}
.stage-D.mobile-flow .d18-person svg{width:65px;height:65px}
.stage-D.mobile-flow .d18-person h3{font-size:23px}
.stage-D.mobile-flow .d18-person p{font-size:17px;line-height:1.4}
.stage-D.mobile-flow .d18-case-choices{grid-template-rows:repeat(3,minmax(34px,auto));gap:4px}
.stage-D.mobile-flow .d18-case-choices button{font-size:18px!important;line-height:1.4;padding:4px 5px}
.stage-D.mobile-flow .d18-case .d18-actions>span{font-size:15px}

/* Reveal reference only after a matching submitted judgment. */
.stage-D .d18-compare[hidden],.stage-D .d18-reference-wait[hidden]{display:none}
.stage-D .d18-reference-wait{margin:0;padding:18px 15px;border:1px dashed #b6cbd0;border-radius:12px;color:#617981;font-size:20px;line-height:1.6;background:#f5f9f8}
