:root{--bg:#f5f7f8;--surface:#fff;--ink:#203334;--muted:#6c7b7e;--line:#e1e8e8;--green:#087c68;--pale:#eaf6f1;--error:#b63832;font-family:Inter,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #269c85;outline-offset:4px}[hidden]{display:none!important}.container{width:min(1160px,calc(100% - 64px));margin-inline:auto}
.header{background:var(--surface);border-bottom:1px solid var(--line)}.header-inner{height:80px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:700;letter-spacing:-.6px}.brand strong{color:var(--green);font-size:20px}.brand-mark{display:grid;place-items:center;width:39px;height:39px;border-radius:10px;background:var(--green);color:#fff}.brand-mark svg{width:29px;height:29px}.header-note,.local-note{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}.status-dot{height:6px;width:6px;display:inline-block;border-radius:50%;background:#149c7e}
.hero{padding:48px 0 39px;display:flex;align-items:center;justify-content:space-between;gap:30px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--green);margin:0 0 15px}.eyebrow span{color:#8d999b;margin-left:8px}h1{font-size:36px;letter-spacing:-1.2px;margin:0 0 16px;line-height:1.35}.subtitle{font-size:14px;color:var(--muted);margin:0;line-height:1.8}.mobile-break{display:none}.hero-equation{width:260px;min-height:133px;border-left:1px solid #dce5e3;padding:9px 0 9px 35px;color:#6c8780;display:flex;flex-direction:column;gap:14px}.hero-equation>span{font-size:9px;letter-spacing:2px}.hero-equation b{display:flex;align-items:center;gap:12px;font-family:Georgia,serif;font-style:italic;font-size:29px;font-weight:400}.hero-equation small{font-size:11px;color:#8b9c97}.fraction{display:inline-flex;flex-direction:column;text-align:center;font-size:23px;gap:3px}.fraction span:first-child{border-bottom:1px solid #9cb2a9;padding:0 7px 5px}
.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.section-heading h2{font-size:15px;margin:0}.section-heading>span{font-size:11px;color:var(--muted);letter-spacing:1px}.tool-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.tool-card{padding:18px 19px 20px;border:1px solid var(--line);border-radius:11px;background:#fafbfb}.tool-card.active{border-color:#8bbcac;background:#f0f9f5;transition:box-shadow .15s,border-color .15s}.tool-card.active:hover{border-color:var(--green);box-shadow:0 3px 12px #163b3010}.tool-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:21px}.tool-number{font-size:12px;font-family:Consolas,monospace;color:#899c9b}.active .tool-number{color:var(--green)}.badge{font-size:10px;border-radius:5px;background:#edf0f1;padding:4px 7px;color:#778489}.badge.available{background:#d9eee4;color:var(--green)}.tool-card h3{font-size:15px;margin:0 0 8px;font-weight:600}.tool-card h3 span{float:right;color:var(--green)}.tool-card p{font-size:11px;color:var(--muted);margin:0}.upcoming h3{color:#657779}
.calculator-section{scroll-margin-top:24px;margin-top:42px}.calculator-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:22px;gap:20px}.calculator-heading .eyebrow{margin-bottom:9px}.calculator-heading h2{font-size:25px;margin:0 0 10px;letter-spacing:-.5px}.calculator-heading p:not(.eyebrow){font-size:12px;color:var(--muted);margin:0;line-height:1.7}.local-note{font-size:11px;padding-bottom:4px}.calculator-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:22px}.panel{border:1px solid var(--line);background:var(--surface);border-radius:13px;padding:26px}.panel-title{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:22px;border-bottom:1px solid #edf0f0}.panel-title h3{font-size:14px;margin:0;display:flex;align-items:center;gap:10px}.panel-title>span{font-size:10px;color:#859290}.step-number{width:23px;height:23px;border-radius:6px;background:#edf5f1;color:var(--green);font-size:11px;display:inline-grid;place-items:center}.field{margin-top:24px}label{display:block;font-size:13px;font-weight:600;margin-bottom:10px}label>span{font-family:Georgia,serif;font-style:italic;color:var(--green);margin-left:6px;font-size:16px}.input-wrap{position:relative}.input-wrap input{width:100%;height:49px;border:1px solid #d8e1e1;border-radius:7px;background:#fdfefe;color:var(--ink);font-size:16px;padding:12px 66px 12px 14px;transition:border-color .15s,box-shadow .15s}.input-wrap input::placeholder{color:#a4afaf;font-size:13px}.input-wrap input:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 3px #0b826411}.input-wrap input[aria-invalid="true"]{border-color:var(--error)}.unit{position:absolute;right:15px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--muted);pointer-events:none}.field-help,.field-error{font-size:11px;line-height:1.6;margin:7px 0 0;color:#8a9798}.field-error{color:var(--error)}.form-actions{display:flex;gap:10px;margin-top:25px}.calculate-button{flex:1;background:var(--green);color:white;border:1px solid var(--green);height:46px;border-radius:7px;font-size:13px;font-weight:600}.calculate-button span{margin-left:12px}.calculate-button:hover{background:#066755}.reset-button{padding:0 21px;border:1px solid var(--line);border-radius:7px;background:white;color:var(--muted);font-size:12px}.reset-button:hover{background:var(--bg)}.example-button{display:block;margin:13px auto 0;border:0;background:none;color:var(--muted);font-size:11px;line-height:1.8;padding:4px}.example-button:hover{color:var(--green)}.example-button span{margin-left:5px}.formula-note{display:flex;gap:10px;background:#f6f8f8;border-radius:8px;margin-top:24px;padding:15px}.note-icon{font-family:Georgia,serif;border:1px solid #9aaca7;color:#7c9790;border-radius:50%;height:14px;width:14px;font-size:10px;text-align:center;flex-shrink:0;margin-top:1px}.formula-note h4{font-size:11px;margin:0 0 9px;font-weight:600}.formula-note p{color:var(--muted);font-size:10px;line-height:1.9;margin:0}.formula-note .formula{font-size:13px;color:#405f57;margin-bottom:5px;font-family:Consolas,"Segoe UI",monospace}
.result-panel{display:flex;flex-direction:column}.result-panel #result-content{flex:1}.empty-result{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:408px;padding:25px 0}.empty-symbol{display:block;font-family:Georgia,serif;font-size:36px;font-style:italic;background:#f0f5f3;color:#89a79c;width:68px;height:68px;line-height:68px;border-radius:17px;margin-bottom:20px}.empty-symbol span{font-size:22px;margin-left:3px}.empty-result h4{font-size:15px;font-weight:500;margin:0 0 12px}.empty-result p{font-size:12px;line-height:2;color:#879693;margin:0}.empty-formula{color:#879c94;background:#f6f8f7;border:1px dashed #dce6e1;font-family:Consolas,monospace;font-size:13px;border-radius:5px;padding:10px 20px;margin-top:26px}.result-footnote{font-size:10px;color:#8d9a99;margin:20px 0 0;padding-top:17px;border-top:1px solid #edf0f0;line-height:1.8}.calculation-step{display:flex;gap:13px;margin-top:25px}.calculation-step>div{min-width:0}.process-number{font-size:10px;font-family:Consolas,monospace;color:#8ea79e;margin-top:3px}.calculation-step h4{font-size:11px;color:var(--muted);font-weight:400;margin:0 0 11px}.given-data{display:flex;gap:12px;flex-wrap:wrap}.given-data p{margin:0;background:#f3f6f5;border:1px solid #eaf0ed;border-radius:5px;padding:8px 12px;font-size:12px;overflow-wrap:anywhere}.given-data strong{font-weight:600}.process-formula{font-size:17px;font-family:Consolas,"Segoe UI",monospace;margin:0;line-height:1.7;overflow-wrap:anywhere}.answer{background:#173e35;color:#fff;border-radius:10px;padding:23px;margin-top:29px;position:relative;overflow:hidden}.answer::after{content:"";position:absolute;width:125px;height:125px;border:1px solid #ffffff0d;border-radius:50%;right:-40px;bottom:-50px;box-shadow:0 0 0 20px #ffffff04,0 0 0 40px #ffffff03;pointer-events:none}.answer-label{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#d0e8de}.answer-label span:last-child{font-size:9px;letter-spacing:2px;color:#8bb7a5}.answer-value{font-size:25px;margin:20px 0 11px;line-height:1.3;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.answer-value strong{font-size:43px;font-weight:600;letter-spacing:-1px}.answer-value>span{font-size:17px;color:#d1e6dd;white-space:nowrap}.answer>p:last-child{font-size:10px;color:#94b9aa;margin-bottom:0}
.footer{border-top:1px solid var(--line);margin-top:38px;padding-block:24px 28px;display:flex;align-items:center;justify-content:space-between;gap:20px;color:#899694;font-size:10px}.footer>span{white-space:nowrap;color:#5f7570;font-size:11px}.footer strong{font-size:9px;font-weight:400;margin-left:5px}.footer p{margin:0;line-height:1.8}.noscript-note{color:var(--error)}
@media(min-width:1400px){.hero{padding-top:55px}}
@media(max-width:960px){.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tool-top{margin-bottom:16px}.calculator-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}.panel{padding:21px}.hero-equation{width:215px;padding-left:25px}.footer{align-items:flex-start}.answer-value strong{font-size:36px}}
@media(max-width:700px){.container{width:calc(100% - 32px)}.header-inner{height:68px}.brand{font-size:19px;gap:9px}.brand strong{font-size:18px}.brand-mark{width:34px;height:34px}.header-note{font-size:10px}.hero{padding:32px 0}.hero-equation{display:none}h1{font-size:30px}.subtitle{font-size:12px}.eyebrow{font-size:9px}.tool-grid{gap:10px}.tool-card{padding:14px 12px 16px}.tool-card h3{font-size:13px;line-height:1.7}.tool-card p{font-size:10px}.tool-card h3 span{display:none}.badge{font-size:9px}.tool-top{margin-bottom:14px}.calculator-section{margin-top:32px}.calculator-heading{align-items:flex-start;flex-direction:column;gap:12px;margin-bottom:16px}.calculator-heading h2{font-size:23px}.calculator-grid{grid-template-columns:1fr}.panel{padding:21px}.empty-result{min-height:290px}.footer{flex-direction:column;gap:10px;margin-top:28px;padding-block:20px 25px}.local-note{font-size:10px}.answer-value strong{font-size:40px}}
@media(max-width:360px){.header-note{display:none}.mobile-break{display:block}.tool-card h3{font-size:12px}.answer-value strong{font-size:34px}.panel{padding:17px}}

/* Tool 02 additions; keep existing calculator styles unchanged. */
#gear-result-content { flex: 1; }
.gear-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; margin: 24px 0; }
.gear-values > div { min-width: 0; }
.gear-values dt { font-size: 11px; line-height: 1.8; color: #b5d3c5; }
.gear-values dd { margin: 8px 0 0; line-height: 1.5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gear-values strong { font-size: 29px; font-weight: 600; }
.gear-values dd span { font-size: 12px; color: #d1e6dd; white-space: nowrap; }
.gear-answer > p:last-child { line-height: 1.8; }
.gear-engineering-note { margin: 18px 0 0; border-left: 3px solid #bdd8cc; padding: 4px 0 4px 13px; color: var(--muted); font-size: 11px; line-height: 1.9; }
@media (max-width: 420px) {
  .gear-values { grid-template-columns: 1fr; gap: 18px; }
  #gear-calculator .empty-formula { padding-inline: 10px; font-size: 11px; }
}

/* Tool 03 additions; no changes to the existing modules. */
#bolt-result-content { flex: 1; }
.bolt-area { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 24px 0 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8f8; }
.bolt-area dt { font-size: 12px; color: var(--muted); }
.bolt-area dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 16px; font-variant-numeric: tabular-nums; }
.bolt-area strong { font-size: 23px; font-weight: 600; }
.bolt-area dd span { font-size: 12px; color: var(--muted); }
.bolt-precision { line-height: 1.8; }
.bolt-engineering-note { margin: 18px 0 0; border-left: 3px solid #bdd8cc; padding: 4px 0 4px 13px; color: var(--muted); font-size: 11px; line-height: 1.9; }
@media (max-width: 420px) {
  #bolt-calculator .empty-formula { padding-inline: 10px; font-size: 11px; }
}

/* Tool 04 additions; existing module rules remain unchanged. */
#shaft-result-content { flex: 1; }
.shaft-intermediate { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f6f8f8; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.shaft-intermediate strong { color: var(--green); font-weight: 600; }
.shaft-precision { line-height: 1.8; }
.shaft-engineering-note { margin: 18px 0 0; border-left: 3px solid #bdd8cc; padding: 4px 0 4px 13px; color: var(--muted); font-size: 11px; line-height: 1.9; }

/* View navigation only; retain the existing calculator layouts and palette. */
.tool-navigation { padding-top: 26px; }
.back-home { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--green); font-size: 12px; }
.back-home:hover { background: var(--pale); }
.tool-navigation ~ .calculator-section { margin-top: 22px; }
.hero h1[tabindex="-1"]:focus, .calculator-heading h2[tabindex="-1"]:focus { outline: none; }
@media (max-width: 700px) {
  .tool-navigation { padding-top: 16px; }
  #home .section-heading { gap: 12px; flex-wrap: wrap; }
}

/* Shared result-copy controls; calculation layouts stay unchanged. */
.copy-controls { margin-top: 18px; }
.copy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.copy-button, .copy-close { min-height: 42px; padding: 9px 15px; border: 1px solid #a8cbbc; border-radius: 7px; background: var(--pale); color: var(--green); font-size: 12px; }
.copy-button:hover, .copy-close:hover { background: #dcefe6; }
.copy-button:disabled { cursor: default; opacity: .55; }
.copy-status { font-size: 12px; color: var(--green); line-height: 1.7; }
.copy-manual { margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8f8; }
.copy-manual label { font-size: 12px; line-height: 1.8; font-weight: 400; }
.copy-manual textarea { display: block; width: 100%; min-height: 190px; resize: vertical; padding: 10px; border: 1px solid #a8cbbc; border-radius: 5px; font: 16px/1.7 "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); overflow-wrap: anywhere; }
.copy-manual textarea:focus { outline: 2px solid var(--green); outline-offset: 2px; }
.copy-close { margin-top: 10px; }

/* Favorite controls are siblings of the existing tool-card links. */
.tool-card-shell { position: relative; min-width: 0; }
.tool-card-shell > .tool-card { display: block; height: 100%; padding-bottom: 62px; }
.favorite-button { position: absolute; right: 12px; bottom: 12px; min-height: 36px; padding: 7px 10px; border: 1px solid #c8d8d2; border-radius: 6px; color: var(--muted); background: var(--surface); font-size: 12px; }
.favorite-button[aria-pressed="true"] { color: var(--green); border-color: #8bbcac; background: #d9eee4; }
.favorite-button:hover { border-color: var(--green); }
.favorites-section { margin-top: 28px; }
.favorites-list { display: flex; flex-wrap: wrap; gap: 10px; }
.favorite-shortcut { display: inline-flex; align-items: center; min-height: 42px; max-width: 100%; padding: 10px 13px; border: 1px solid #bdd8cc; border-radius: 7px; background: var(--pale); color: var(--green); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.favorite-shortcut:hover { border-color: var(--green); }
.favorites-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.favorite-feedback { margin: 12px 0 0; font-size: 12px; line-height: 1.8; color: var(--green); overflow-wrap: anywhere; }

/* Local calculation history; reuse the existing card palette. */
.recent-section { margin-top: 32px; }
.history-section { margin-top: 22px; }
.history-link { color: var(--green); font-size: 12px; padding: 10px 0 10px 12px; }
.history-list { display: grid; gap: 12px; }
.history-record { display: grid; gap: 8px; width: 100%; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; overflow-wrap: anywhere; }
.history-record:hover { border-color: #8bbcac; background: #f0f9f5; }
.history-record strong { font-size: 14px; }
.history-record span { font-size: 12px; line-height: 1.8; color: var(--muted); }
.history-record .history-results { color: var(--green); }
.history-record time { font-size: 11px; color: var(--muted); }
.history-empty { padding: 24px; margin: 0; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); font-size: 13px; line-height: 1.8; }
.history-privacy, .history-count { color: var(--muted); font-size: 12px; line-height: 1.8; }
.history-action { min-height: 42px; padding: 9px 15px; border: 1px solid #a8cbbc; border-radius: 7px; background: var(--pale); color: var(--green); font-size: 12px; }
.history-action:disabled { opacity: .55; cursor: default; }
.history-confirm, .history-notice { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--pale); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.history-confirm p { margin-top: 0; }
.history-section .calculator-heading { flex-wrap: wrap; align-items: center; }
.history-section h2[tabindex="-1"]:focus { outline: none; }
@media (max-width: 420px) {
  .history-record { padding: 16px; }
  .history-empty { padding: 18px; }
}

/* Unit converter: scoped controls and wrapping at narrow widths. */
#unit-converter select { width:100%; min-width:0; height:49px; padding:10px; border:1px solid #d8e1e1; border-radius:7px; background:var(--surface); color:var(--ink); font:inherit; }
#unit-converter select:focus { outline:2px solid var(--green); outline-offset:2px; }
.converter-units { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#unit-converter .field { min-width:0; }
#converter-value { padding-right:14px; }
#converter-equation { margin-top:20px; font-size:24px; }
#converter-relation { margin-top:20px; font-size:15px; }

/* V1.1-5: native, collapsed formula guidance below the main calculation. */
.formula-guide { margin-top:18px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--ink); }
.formula-guide > summary { padding:14px 18px; min-height:46px; cursor:pointer; color:var(--green); font-size:13px; font-weight:600; line-height:1.7; }
.formula-guide > summary:hover { background:var(--pale); border-radius:9px; }
.formula-guide > summary:focus-visible { outline:2px solid var(--green); outline-offset:3px; border-radius:9px; }
.formula-guide-content { padding:0 18px 18px; border-top:1px solid var(--line); font-size:12px; line-height:1.9; overflow-wrap:anywhere; }
.formula-guide-content h3 { margin:18px 0 8px; font-size:13px; font-weight:600; }
.formula-guide-content p { margin:0; color:var(--muted); }
.formula-symbols { margin:0; }
.formula-symbols > div { display:grid; grid-template-columns:52px minmax(0,1fr); gap:12px; padding:5px 0; }
.formula-symbols dt { font-family:Consolas,monospace; color:var(--green); }
.formula-symbols dd { margin:0; min-width:0; color:var(--muted); }
.formula-guide-content .formula-guide-boundary { margin-top:16px; padding:10px 12px; border-left:3px solid #bdd8cc; background:var(--pale); }
