/* YYSI first-party toolbox pages. Self-contained; matches portal palette. */
:root{--paper:#fafbf7;--white:#fff;--ink:#172b25;--muted:#65736c;--line:#dce2d7;--lime:#d9f49c;--mint:#edf4e5;--accent:#587b38;--warn:#8e493d;--font:Inter,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--serif:Georgia,"Noto Serif SC","Songti SC",SimSun,serif}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}
body.tool-page{margin:0;background:var(--paper);color:var(--ink);font:16px/1.65 var(--font);-webkit-font-smoothing:antialiased}
body.tool-page a{color:inherit;text-decoration:none}body.tool-page a:hover{text-decoration:underline;text-underline-offset:4px}
body.tool-page button,body.tool-page input,body.tool-page select{font:inherit}
body.tool-page button{cursor:pointer;color:inherit}
body.tool-page button:focus-visible,body.tool-page a:focus-visible,body.tool-page input:focus-visible,body.tool-page select:focus-visible,body.tool-page [tabindex]:focus-visible{outline:3px solid #56863e;outline-offset:3px}
h1,h2,h3,p{margin:0}.tool-page h1,.tool-page h2{font-family:var(--serif);letter-spacing:-.02em;line-height:1.22}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.skip{position:fixed;top:-90px;left:16px;background:var(--ink);color:#fff;padding:12px;z-index:100}.skip:focus{top:12px}
[hidden]{display:none!important}

/* header / footer */
.tool-header{border-bottom:1px solid var(--line);background:var(--paper)}
.tool-header-in{max-width:1180px;margin:0 auto;padding:0 24px;height:72px;display:flex;align-items:center;gap:28px}
.tool-header .wordmark{display:inline-flex;align-items:center}
.tool-header .wordmark img{display:block;height:38px;width:auto}
.tool-header nav{display:flex;gap:22px;font-size:13.5px;font-weight:600}
.tool-header nav a[aria-current=page]{border-bottom:3px solid var(--ink);padding-bottom:2px}
.tool-lang{margin-left:auto;border:1px solid var(--line);background:#fff;padding:6px 12px;border-radius:30px;font-size:12.5px;font-weight:650;white-space:nowrap;flex-shrink:0}
@media (max-width:600px){.tool-header-in{gap:16px}.tool-header nav{gap:13px;font-size:12.5px}.tool-header .wordmark img{height:32px}}
.tool-footer{border-top:1px solid var(--line);margin-top:56px}
.tool-footer-in{max-width:1180px;margin:0 auto;padding:22px 24px;display:flex;flex-wrap:wrap;gap:14px 26px;align-items:center;justify-content:space-between;font-size:12.5px;color:var(--muted)}
.tool-footer nav{display:flex;flex-wrap:wrap;gap:18px}

/* page frame */
.tool-main{max-width:1180px;margin:0 auto;padding:30px 24px 0}
.breadcrumbs{font-size:12px;color:var(--muted);margin-bottom:14px}
.breadcrumbs a{color:var(--muted)}
.tool-intro h1{font-size:clamp(28px,3.6vw,40px)}
.tool-intro .lede{margin-top:10px;color:var(--muted);max-width:760px;font-size:16.5px}
.badges{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.badge{font-size:11.5px;font-weight:700;padding:5px 11px;border-radius:30px;background:var(--mint);border:1px solid #cfe0bd;color:#3c5a2a}
.badge.warn{background:#f7ece9;border-color:#e5cfc8;color:var(--warn)}

/* app */
.tool-app{margin-top:26px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:22px}
@media (max-width:720px){.tool-app{padding:14px;border-radius:10px}}
.dropzone{border:2px dashed #b9c8ac;border-radius:10px;background:var(--paper);padding:34px 18px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.dropzone:hover,.dropzone.dragging{border-color:#678b3e;background:var(--mint)}
.dropzone .dz-icon{font-size:30px;line-height:1;margin-bottom:10px}
.dropzone .dz-label{font-weight:650;font-size:15.5px}
.dropzone .dz-hint{margin-top:8px;font-size:12.5px;color:var(--muted)}
.sr-file{position:absolute;width:1px;height:1px;opacity:0}
.input-errors{margin:12px 0 0;padding:10px 14px;background:#f7ece9;border:1px solid #e5cfc8;border-radius:8px;color:var(--warn);font-size:13px}
.tool-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:26px;margin-top:20px}
@media (max-width:900px){.tool-layout{grid-template-columns:1fr}}
.tool-controls{border:1px solid var(--line);border-radius:10px;padding:16px;background:var(--paper);align-self:start}
.control{margin-bottom:14px}
.control label{display:block;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:5px}
.control select,.control input[type=number]{width:100%;padding:9px 10px;border:1px solid #b9c8ac;border-radius:7px;background:#fff;color:var(--ink)}
.control input[type=range]{width:100%;accent-color:#56863e}
.control output{font-weight:700;color:var(--ink)}
.control .pair{display:flex;gap:8px}.control .pair>div{flex:1}
.control-note{font-size:12px;color:var(--muted);line-height:1.55;margin:2px 0 12px}
.preview-line{margin-top:2px;padding:10px 12px;border:1px solid #cfe0bd;background:var(--mint);border-radius:7px;font-size:13.5px;font-weight:650}
.preview-line.warn{border-color:#e5cfc8;background:#f7ece9;color:var(--warn)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--ink);border-radius:7px;padding:11px 16px;font-size:13.5px;font-weight:700;background:#fff;color:var(--ink);text-decoration:none}
.btn:hover{text-decoration:none;box-shadow:0 2px 0 rgba(23,43,37,.25)}
.btn.primary{background:var(--ink);color:#fff}
.btn.primary:disabled{opacity:.45;cursor:not-allowed}
.btn.ghost{border-color:#b9c8ac;color:var(--muted)}
.btn.small{padding:7px 12px;font-size:12px;border-radius:6px}
.btn.wide{width:100%}
.controls-actions{margin-top:18px;display:flex;flex-direction:column;gap:10px}

/* queue rows */
.queue{display:flex;flex-direction:column;gap:10px;min-height:10px}
.queue:empty::after{content:attr(data-empty);color:var(--muted);font-size:13px;display:block;text-align:center;padding:40px 0}
.file-row{display:grid;grid-template-columns:74px minmax(0,1fr) auto auto;gap:14px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:10px 12px;background:#fff}
@media (max-width:640px){.file-row{grid-template-columns:56px minmax(0,1fr);row-gap:6px}.file-row .file-status{grid-column:1/-1}.file-row .file-actions{grid-column:1/-1;justify-self:start}}
.thumb{width:74px;height:56px;border-radius:6px;background:repeating-conic-gradient(#eef1e9 0 25%,#fff 0 50%) 0 0/16px 16px;border:1px solid var(--line);display:grid;place-items:center;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:contain}
.file-meta{min-width:0}
.file-name{display:block;font-weight:650;font-size:13.5px;overflow-wrap:anywhere}
.file-sub{display:block;font-size:12px;color:var(--muted)}
.file-status{display:block;font-size:12.5px;color:var(--muted);max-width:340px}
.file-status.st-done{color:#3c5a2a;font-weight:650}
.file-status.st-error,.file-status.st-no_reduction,.file-status.st-target_missed{color:var(--warn)}
.file-status.st-running{color:#2a5a86;font-weight:650}
.file-actions{display:flex;align-items:center;gap:8px}
.file-actions .remove{border:1px solid var(--line);background:#fff;border-radius:6px;width:30px;height:30px;font-size:15px;color:var(--muted)}
.file-actions .remove:hover{border-color:var(--warn);color:var(--warn)}
.progress-wrap{margin-top:16px;display:flex;align-items:center;gap:14px}
.progress{flex:1;height:8px;border-radius:6px;background:var(--mint);overflow:hidden}
.progress-bar{height:100%;width:0;background:#678b3e;transition:width .2s}
.progress-label{font-size:12.5px;color:var(--muted);white-space:nowrap}
.tool-actions{margin-top:16px;display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.output-summary{font-size:12.5px;color:var(--muted)}
.result-note{margin-top:12px;font-size:13px;color:var(--muted)}

/* notes */
.tool-notes{margin-top:30px;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.tool-notes section{background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px}
.tool-notes h2{font-size:17px;margin-bottom:8px}
.tool-notes p,.tool-notes li{font-size:13px;color:#4a5850;line-height:1.7}
.tool-notes ol,.tool-notes ul{margin:6px 0 0;padding-left:18px}
.tool-notes li{margin-bottom:5px}
.related-list{list-style:none;padding:0;margin:6px 0 0}
.related-list li{border-bottom:1px solid var(--line)}
.related-list li:last-child{border-bottom:0}
.related-list a{display:block;padding:8px 0;font-weight:650;font-size:13.5px}

/* batch B: account link, PDF page grids, reorder buttons, account card */
.tool-account{border:1px solid var(--line);background:#fff;padding:6px 12px;border-radius:30px;font-size:12.5px;font-weight:650;white-space:nowrap;flex-shrink:0;max-width:200px;overflow:hidden;text-overflow:ellipsis}
.tool-header-in{gap:22px}
.queue.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.queue.grid:empty::after{grid-column:1/-1}
.page-card{border:1px solid var(--line);border-radius:8px;background:#fff;overflow:hidden;cursor:pointer;position:relative;padding:0}
.page-card.sel{outline:3px solid #56863e;outline-offset:-3px}
.page-card .pc-num{position:absolute;top:4px;left:6px;font-size:11px;font-weight:700;background:#ffffffd9;padding:1px 6px;border-radius:8px;z-index:1}
.page-card .pc-rot{position:absolute;top:4px;right:6px;font-size:10px;background:#f2f5ed;padding:1px 5px;border-radius:8px;z-index:1}
.page-card .pc-thumb{width:100%;aspect-ratio:3/4;display:grid;place-items:center;background:repeating-conic-gradient(#eef1e9 0 25%,#fff 0 50%) 0 0/16px 16px}
.page-card .pc-thumb canvas{width:100%;height:100%;object-fit:contain}
.page-card .pc-tools{display:flex;justify-content:center;gap:4px;padding:5px;border-top:1px solid var(--line)}
.page-card .pc-tools button{border:1px solid var(--line);background:#fff;border-radius:5px;font-size:12px;line-height:1;padding:5px 8px}
.page-card .pc-tools button:hover{border-color:var(--accent)}
.reorder-btns{display:flex;flex-direction:column;gap:3px;flex-shrink:0}
.reorder-btns button{border:1px solid var(--line);background:#fff;border-radius:5px;width:28px;height:24px;font-size:11px;line-height:1}
.reorder-btns button:disabled{opacity:.35;cursor:default}
.file-row.dragging{opacity:.4}
.account-card{margin-top:26px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:26px;max-width:640px}
.auth-tabs{display:flex;gap:8px;margin-bottom:18px}
.auth-tab{border:1px solid var(--line);background:var(--paper);border-radius:30px;padding:8px 18px;font-size:13px;font-weight:650}
.auth-tab[aria-pressed=true]{background:var(--ink);color:#fff;border-color:var(--ink)}
.account-card form{margin-bottom:6px}
.account-card .pw-hint{font-weight:400;color:var(--muted);text-transform:none;letter-spacing:0}
.account-error{margin:10px 0;padding:10px 14px;background:#f7ece9;border:1px solid #e5cfc8;border-radius:8px;color:var(--warn);font-size:13px}
.account-note{margin-top:14px;font-size:12.5px;color:var(--muted);line-height:1.65}
.me-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:8px}
.me-grid .file-sub{display:block;margin-bottom:3px}
.me-grid strong{font-size:16px;overflow-wrap:anywhere}

/* batch C/D: AI tool pages */
.ai-layout{display:grid;grid-template-columns:1fr 1fr;gap:22px}
@media (max-width:900px){.ai-layout{grid-template-columns:1fr}}
.ai-col{min-width:0}
.ai-layout textarea{width:100%;padding:12px;border:1px solid #b9c8ac;border-radius:8px;background:#fff;color:var(--ink);font:14px/1.6 var(--font);resize:vertical}
.ai-layout textarea:focus{outline:2px solid #678b3e;outline-offset:1px}
#ai-auth{text-align:left;padding:8px 2px}
#ai-auth .account-note{margin:0 0 12px;font-size:14px;color:var(--muted)}
.ai-img-preview{display:flex;gap:12px;align-items:center;margin-top:12px;border:1px solid var(--line);border-radius:8px;padding:10px;background:#fff}
.ai-img-preview img{width:88px;height:66px;object-fit:contain;border-radius:5px;background:repeating-conic-gradient(#eef1e9 0 25%,#fff 0 50%) 0 0/14px 14px;border:1px solid var(--line)}
.ai-controls{border:1px solid var(--line);border-radius:10px;padding:14px 14px 2px;background:var(--paper);margin-top:14px}

/* batch: calculators */
.calc-card{border:1px solid var(--line);border-radius:10px;background:#fff;padding:18px;margin-bottom:16px}
.calc-card h2{font-size:17px;margin-bottom:12px}
.calc-row{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:end}
.calc-row.three{grid-template-columns:1fr 1fr 1fr auto}
@media (max-width:640px){.calc-row,.calc-row.three{grid-template-columns:1fr 1fr}}
.calc-row label{display:block;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.calc-row input,.calc-row select,.calc-row textarea{width:100%;padding:9px 10px;border:1px solid #b9c8ac;border-radius:7px;background:#fff;color:var(--ink)}
.calc-result{margin-top:12px;padding:12px 14px;border:1px solid #cfe0bd;background:var(--mint);border-radius:8px;font-size:16px;font-weight:700;min-height:46px}
.calc-result .formula{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:4px;font-family:Consolas,monospace}
.calc-result.bad{border-color:#e5cfc8;background:#f7ece9;color:var(--warn)}
.calc-table{width:100%;border-collapse:collapse;margin-top:10px;font-size:13px}
.calc-table th,.calc-table td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left}
.calc-table th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.calc-table td{font-weight:650}
.calc-note{margin-top:10px;font-size:12px;color:var(--muted);line-height:1.6}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-top:14px}
.stat-box{border:1px solid var(--line);border-radius:8px;background:#fff;padding:12px}
.stat-box strong{display:block;font-size:20px;letter-spacing:-.02em}
.stat-box span{display:block;font-size:11px;color:var(--muted);margin-top:2px}

/* tool-page feedback */
.feedback-box{margin-top:30px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:22px}
.feedback-box h2{font-size:19px}
.fb-rating{display:flex;gap:6px;margin:12px 0 4px}
.fb-rating button{border:1px solid var(--line);background:var(--paper);border-radius:7px;width:40px;height:36px;font-size:19px;line-height:1;color:#b8860b}
.fb-rating button:hover{border-color:#b8860b}
.fb-rating button[aria-pressed=true]{background:var(--lime)}
.fb-hp{position:absolute;left:-9999px;height:1px;width:1px;opacity:0}
.fb-disclosure{margin-top:12px}
.fb-list h3{font-size:15px;margin-top:18px}
.fb-empty{font-size:13px;color:var(--muted)}
.fb-item{border-top:1px solid var(--line);padding:10px 0}
.fb-item-top{display:flex;justify-content:space-between;gap:10px;font-size:11.5px;color:var(--muted)}
.fb-stars{color:#b8860b;letter-spacing:2px}
.fb-text{margin:5px 0 0;font-size:13.5px;line-height:1.6;overflow-wrap:anywhere}
