:root{color-scheme:dark;--bg:#091625;--panel:#14273d;--panel2:#1a3049;--border:#49627b;--gold:#ffd17b;--txt:#f4f1ea;--muted:#b6c7d6;font-family:system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 7% -10%,#274669 0%,transparent 38%),radial-gradient(circle at 95% 15%,#234260 0%,transparent 35%),linear-gradient(145deg,#071421,#101f33);color:var(--txt);line-height:1.6;min-width:320px}body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.10;background:repeating-linear-gradient(90deg,transparent 0,transparent 99px,#bed2dc 100px,transparent 101px)}.castle-shell{max-width:1380px;margin:0 auto;padding-left:clamp(16px,3vw,38px);padding-right:clamp(16px,3vw,38px)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-top:22px;padding-bottom:22px}.brand{display:flex;gap:12px;align-items:center}.crest{display:grid;place-items:center;flex:none;width:51px;height:58px;font-size:32px;color:var(--gold);border:2px solid #b88a44;background:#1c344d;clip-path:polygon(50% 0%,90% 16%,87% 72%,50% 100%,13% 72%,10% 16%)}.brand strong{display:block;font-size:28px;letter-spacing:.07em;line-height:1.15}.brand strong span{color:#f5bb51}.brand small{display:block;color:var(--muted);font-size:11px;letter-spacing:.05em;margin-top:4px}nav{display:flex;gap:5px;border:1px solid #4e6579;padding:5px;background:#091b2c;border-radius:9px}nav a{font-size:13px;color:#e2eaf0;text-decoration:none;border-radius:6px;padding:10px 13px;font-weight:700}nav a[aria-current],nav a:hover{background:#2b4056;color:var(--gold)}.masthead{padding:41px 35px;margin:0 0 22px;border-top:1px solid #a38147;border-bottom:1px solid #a38147;background:radial-gradient(circle at 95% 25%,#3b607f77,transparent 40%),linear-gradient(120deg,#11263b,#1e3650 72%,#13243a);position:relative;overflow:hidden}.masthead:after{content:"♜";position:absolute;right:45px;top:-70px;font-size:280px;color:#f1c47911;pointer-events:none}.overline{font-size:11px;letter-spacing:.18em;color:#f6ce8a;font-weight:900}.masthead h1{font-size:clamp(29px,4vw,48px);line-height:1.2;margin:11px 0 13px}.masthead h1 span{color:var(--gold);margin-left:.22em}.masthead p{max-width:720px;color:#d0dee9;font-size:14px}.tagline{display:flex;flex-wrap:wrap;gap:15px;font-size:12px;color:#e8c98b}.calculator-layout{display:grid;grid-template-columns:minmax(290px,.87fr) minmax(0,1.45fr);gap:18px;align-items:start}.castle-panel{min-width:0;border:1px solid #46617b;border-radius:12px;background:linear-gradient(150deg,#1c324d,#101f31 82%);padding:23px;box-shadow:inset 0 1px #ffffff0d,0 14px 36px #0003}.section-title{display:flex;align-items:start;justify-content:space-between;border-bottom:1px solid #886c4285;padding-bottom:13px;margin-bottom:20px}.section-title small{font-size:10px;color:#d7aa67;letter-spacing:.14em;font-weight:800}.section-title h2{font-size:23px;margin:3px 0 0;color:#fff1d6}.number-label{border:1px solid #94784e;color:#f5d8a3;padding:5px 11px;border-radius:6px;font-weight:800}h3{color:#f3d5a5;font-size:15px;margin:26px 0 13px}label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:700;color:#cdd9e4}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.field-grid.triple{grid-template-columns:repeat(3,minmax(0,1fr))}select,input{color:#f4f5f7;background:#091b2d;border:1px solid #506d87;border-radius:7px;padding:11px;min-width:0;width:100%;font:inherit;font-size:14px;min-height:43px}select:focus-visible,input:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid #ffcb77;outline-offset:2px}.inline-tip,.minor{font-size:12px;color:#a9bdd0;line-height:1.8}.inline-tip{margin:13px 0}.minor{margin:14px 0 0}.discount-label strong{color:#ffce7e;font-size:15px}.actionbar{display:flex;gap:10px;flex-wrap:wrap;margin-top:23px}button{cursor:pointer;min-height:43px;padding:10px 18px;border-radius:7px;background:linear-gradient(#ffe09c,#d99b39);border:1px solid #f0ca82;color:#382506;font-weight:850;font:inherit}button:hover{filter:brightness(1.07)}button.castle-secondary{background:#2b425a;color:#ebeff3;border-color:#66829c}.resource-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.resource-card{display:flex;flex-direction:column;gap:4px;padding:17px 13px;border:1px solid #557089;border-radius:9px;background:#0c2034;min-width:0}.resource-icon{font-size:25px}.resource-card small{color:#b5c9d9;font-size:10px;letter-spacing:.06em}.resource-card strong{font-size:clamp(16px,2.1vw,27px);color:#ffe2a5;overflow-wrap:anywhere;line-height:1.35}.resource-card>span:last-child{font-size:11px;color:#cad9e4}.resource-card b{color:#ffc472}.summary-count{display:flex;flex-direction:column;gap:3px;font-size:12px;color:#c8d6e4;margin:14px 0 0}.castle-result-block{margin-top:26px}.castle-result-block h2{font-size:17px;color:#f6d5a1;margin:0 0 11px}.castle-detail-title{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.castle-detail-title button{font-size:12px;min-height:36px;padding:6px 10px}.castle-table{border-collapse:collapse;width:100%;font-size:12px}.castle-table td,.castle-table th{border-bottom:1px solid #486078;padding:11px 7px;text-align:right;font-variant-numeric:tabular-nums}.castle-table td:first-child,.castle-table th:first-child{text-align:left}.castle-table th{background:#243b53;color:#f0d0a1}.castle-table a,.source-links a{color:#ffda93;text-decoration:none}.castle-table a:hover,.source-links a:hover{text-decoration:underline}.detail-table td:last-child,.detail-table th:last-child{text-align:left;color:#b5c7d6}.method-note{border:1px solid #80663d;background:#241f1a70;border-radius:9px;padding:16px;margin-top:25px;color:#d9d0c0;font-size:12px;line-height:1.8}.method-note strong{color:#ffe0a7;font-size:14px}.method-note p{margin:9px 0 0}.castle-warning{padding:15px;color:#ffe3ac;background:#5e3b1c70;border:1px solid #c49b5c;border-radius:8px}.source-block{margin:20px 0 28px;border:1px solid #3b5269;border-radius:10px;padding:21px 24px;background:#102137}.source-block h2{font-size:18px;color:#f2d09a;margin:0}.source-block p{font-size:12px;color:#b5c7d6;line-height:1.9}.source-links{display:flex;flex-wrap:wrap;gap:12px}.source-links a{font-size:12px}.footer{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;font-size:11px;color:#849db4;border-top:1px solid #415367;padding-top:15px;padding-bottom:28px}@media(max-width:900px){.calculator-layout{grid-template-columns:1fr}}@media(max-width:560px){.topbar{flex-direction:column;align-items:stretch}nav{justify-content:space-between}nav a{text-align:center;flex:1;font-size:12px}.masthead{padding:29px 19px}.masthead:after{right:-55px;opacity:.5}.castle-panel{padding:16px}.field-grid.triple{grid-template-columns:1fr}.resource-cards{grid-template-columns:1fr}.resource-card{display:grid;grid-template-columns:34px 1fr;column-gap:9px}.resource-card strong{grid-column:2;font-size:24px}.resource-card>span:last-child{grid-column:2}.resource-icon{grid-row:1/4;align-self:center}.detail-table{font-size:11px}.detail-table td,.detail-table th{padding:8px 3px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* V17: resource-cost calibration */
.castle-check{display:flex;flex-direction:row;align-items:center;gap:10px;margin-bottom:13px;cursor:pointer;font-size:14px;color:#ffe0a7}.castle-check input{width:18px;min-width:18px;height:18px;min-height:18px;accent-color:#dbb567}.calibration-box{padding:15px;border:1px solid #806b4c;background:#102438;border-radius:9px}.calibration-box .inline-tip{margin:0 0 14px}.calibration-result{margin:12px 0 0;font-size:12px;color:#f2d4a4;line-height:1.8}.calibration-result.error{color:#ffc2a7}.calibration-result strong{color:#f9d583}.calibration-box input:disabled{opacity:.5}.discount-label input:disabled{opacity:.65}

/* V18: million-unit display */
.unit-mark{font-size:12px;color:#d4b881;font-weight:600}
.resource-card strong{font-variant-numeric:tabular-nums}
