/* ==========================================================================
   工具页 · 导出 PDF 的按钮与弹窗样式
   ========================================================================== */

/* ---- 顶栏按钮 ---- */
.aqx-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 6px;
  height: 34px;
  box-sizing: border-box;
  margin-left: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #22c55e;
  color: #04170b;
  font-size: .78rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .14s ease-out;
}

.aqx-launch:active { background: #4ade80; transform: scale(.96); }

.aqx-launch svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 没有顶栏的页面：右上角悬浮 */
.aqx-launch.aqx-float {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9000;
  margin-left: 0;
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .8);
}

/* 顶栏里紧跟语言的场景，靠右对齐 */
.aq-topbar .aqx-launch { order: 99; }

/* ---- 遮罩 / 弹窗 ---- */
.aqx-mask {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 6, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.aqx-box {
  width: 100%;
  max-width: 320px;
  padding: 24px 22px;
  border-radius: 20px;
  background: #0d1512;
  border: 1px solid rgba(34, 197, 94, .3);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .95);
  color: #dbe4f3;
  text-align: center;
  box-sizing: border-box;
}

.aqx-spin {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(34, 197, 94, .25);
  border-top-color: #22c55e;
  animation: aqxSpin .9s linear infinite;
}

@keyframes aqxSpin { to { transform: rotate(360deg); } }

.aqx-text {
  margin: 0;
  font-size: .84rem;
  color: #cfe0d6;
  line-height: 1.6;
}

.aqx-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.aqx-icon.ok { background: rgba(34, 197, 94, .16); color: #4ade80; border: 1px solid rgba(34, 197, 94, .5); }
.aqx-icon.bad { background: rgba(248, 113, 113, .14); color: #f87171; border: 1px solid rgba(248, 113, 113, .45); }

.aqx-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #eaf7ef;
}

.aqx-desc {
  margin: 0 0 18px;
  font-size: .78rem;
  line-height: 1.65;
  color: #9db0a2;
  word-break: break-all;
}

.aqx-btn {
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-radius: 12px;
  background: #22c55e;
  color: #04170b;
  font-size: .84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.aqx-btn:active { background: #4ade80; }

/* ---- 手机 ---- */
@media (max-width: 640px) {
  .aqx-launch { padding: 7px 11px; font-size: .72rem; }
  .aqx-launch svg { width: 13px; height: 13px; }
  .aqx-box { max-width: 300px; padding: 20px 18px; }
}


/* ---- 截图期间：渐变文字退化成纯色（否则会被画成色块） ---- */
.aq-capturing h1,
.aq-capturing h1 span,
.aq-capturing h1 em,
.aq-capturing h2,
.aq-capturing h2 span,
.aq-capturing h3,
.aq-capturing em,
.aq-capturing strong {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #86efac !important;
  -webkit-text-fill-color: #86efac !important;
  text-shadow: none !important;
}


/* ---- 顶栏里的语言切换 ---- */
.aq-topbar .aqx-langbar,
.aq-topbar--made .aqx-langbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  height: 34px;
  box-sizing: border-box;
  gap: 2px;
  margin-left: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 3px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .10);
  border: 1px solid rgba(34, 197, 94, .30);
}

.aq-topbar .aqx-langbar .lang-option,
.aq-topbar--made .aqx-langbar .lang-option,
.aq-topbar .aqx-langbar button,
.aq-topbar--made .aqx-langbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  box-sizing: border-box;
  padding: 0 12px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9db0a2;
  font-size: .72rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, color .18s;
}

.aq-topbar .aqx-langbar .lang-option.active,
.aq-topbar--made .aqx-langbar .lang-option.active {
  background: #22c55e;
  color: #04170b;
}

/* 语言条进了顶栏后，导出按钮不再靠 auto 推开 */
.aq-topbar .aqx-launch,
.aq-topbar--made .aqx-launch {
  margin-left: 8px;
  order: 99;
}

@media (max-width: 640px) {
  .aq-topbar .aqx-langbar,
  .aq-topbar--made .aqx-langbar,
  .aq-topbar .aqx-launch,
  .aq-topbar--made .aqx-launch {
    height: 30px;
  }

  .aq-topbar .aqx-langbar .lang-option,
  .aq-topbar--made .aqx-langbar .lang-option {
    height: 22px;
    padding: 0 9px;
    font-size: .66rem;
  }

  .aqx-launch { padding: 0 12px; font-size: .72rem; }
}


/* 顶栏品牌字样不显示（用户要求删除） */
.aq-topbar .aq-name,
.aq-topbar--made .aq-name {
  display: none !important;
}

/* 隐藏后让语言条继续靠右 */
.aq-topbar .aqx-langbar,
.aq-topbar--made .aqx-langbar {
  margin-left: auto;
}


/* ==========================================================================
   三个操作按钮：各自一种明显颜色，一眼可分辨
     开始计算 → 绿 #22c55e
     重置     → 蓝 #3b82f6
     其它工具 → 橙 #f59e0b
   ========================================================================== */

.btn-primary,
.btn.btn-primary,
#btnCalc,
#calcBtn,
.calc-btn,
.btn-calc {
  background: #22d3ee !important;
  background-image: none !important;
  color: #04202a !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 28px -12px rgba(34, 211, 238, .95) !important;
}

.btn-primary:hover,
#btnCalc:hover,
#calcBtn:hover { background: #67e8f9 !important; }

#btnReset,
#resetBtn,
.btn-reset,
.btn.btn-reset,
.button-group .btn-secondary {
  background: #3b82f6 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(59, 130, 246, .9) !important;
}

#btnReset:hover,
#resetBtn:hover { background: #60a5fa !important; }

#btnMore,
#moreBtn,
.btn-more,
.btn.btn-more,
.btn-group a.btn-secondary,
.btn-group a {
  background: #f59e0b !important;
  background-image: none !important;
  color: #1a1206 !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(245, 158, 11, .9) !important;
}

#btnMore:hover,
#moreBtn:hover { background: #fbbf24 !important; }

/* 三个按钮等高的触感 */
.btn-group .btn,
.button-group .btn,
.btn-group > a,
.button-group > a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: .92rem;
  transition: background .18s, transform .12s;
}

.btn-group .btn:active,
.button-group .btn:active { transform: translateY(1px); }

/* 浅色主题页面：加深一档，白底上更清楚 */
.tool-quote .btn-primary,
.tool-susp .btn-primary { background: #0891b2 !important; color: #fff !important; }
.tool-quote #btnReset,
.tool-susp #btnReset { background: #2563eb !important; }
.tool-quote #btnMore,
.tool-susp #btnMore { background: #d97706 !important; color: #fff !important; }


/* ==========================================================================
   文字与输入：默认文字全白，可输入/可点击的位置用高亮色
   ========================================================================== */

/* 1. 默认文字：白色（只对深色主题页面，浅色页面沿用原配色） */
body:not(.tool-quote):not(.tool-susp),
body:not(.tool-quote):not(.tool-susp) :is(h1, h2, h3, h4, h5, h6, p, span, label, li, dt, dd, td, th, div) {
  color: #ffffff;
}

/* 说明类文字略降一档，避免和数值抢视觉 */
body:not(.tool-quote):not(.tool-susp) :is(.m-note, .field-hint, .sub, .diagram-cap, .tool-foot, .unit-hint, .stat-label) {
  color: #e9f1ec !important;
}

/* 2. 可输入的位置：琥珀色，一眼看出这里能改 */
input,
textarea,
select,
input[type="number"],
input[type="text"],
.big-box input,
.param-input,
.field input,
.field select,
.form-grid input,
.form-grid select {
  color: #fbbf24 !important;
  caret-color: #fbbf24 !important;
  font-weight: 700 !important;
}

input::placeholder,
textarea::placeholder {
  color: #8c9a90 !important;
  font-weight: 400 !important;
}

/* 输入框聚焦时更亮 */
input:focus,
textarea:focus,
select:focus {
  color: #fcd34d !important;
}

/* 3. 浅色主题页面：只调整输入框颜色，其余沿用页面原配色 */
.tool-quote input,
.tool-quote textarea,
.tool-quote select,
.tool-susp input,
.tool-susp textarea,
.tool-susp select {
  color: #b45309 !important;
  caret-color: #b45309 !important;
  font-weight: 700 !important;
}


/* 隐藏 header 外重复的动作条 */
.aq-w-md .tool-quote > .top-actions,
.aq-w-lg .tool-quote > .top-actions,
.aq-w-xl .tool-quote > .top-actions {
  display: none !important;
}

/* 深色摘要面板里的文字保持浅色 */
.tool-quote .col-side,
.tool-quote .col-side * {
  color: #f3efe6 !important;
}


/* 「其它工具」按钮（多为链接）：统一橙色，与重置区分 */
.button-group a,
.button-group a.btn,
.button-group a.btn-secondary,
.btn-group a,
.btn-group a.btn {
  background: #f59e0b !important;
  background-image: none !important;
  color: #1a1206 !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(245, 158, 11, .9) !important;
}


/* ==========================================================================
   弹窗在浅色主题下的配色（白底深字，避免白底白字/深底深字）
   ========================================================================== */
.aqx-box {
  background: #ffffff !important;
  border: 1px solid #e2e7e4 !important;
  box-shadow: 0 24px 60px -28px rgba(16, 24, 20, .35) !important;
}

.aqx-title {
  color: #16201a !important;
}

.aqx-text,
.aqx-desc {
  color: #4b554f !important;
}

.aqx-icon.ok {
  background: #e7f7ee !important;
  color: #16a34a !important;
  border: 1px solid #b9e6cb !important;
}

.aqx-icon.bad {
  background: #fdecec !important;
  color: #dc2626 !important;
  border: 1px solid #f5c2c2 !important;
}

.aqx-btn {
  background: #22c55e !important;
  color: #04240f !important;
  font-weight: 800 !important;
}

.aqx-btn:active {
  background: #4ade80 !important;
}

/* 遮罩也淡一点，浅色页面看着不突兀 */
.aqx-mask {
  background: rgba(20, 28, 24, .38) !important;
}

.aqx-spin {
  border-color: rgba(22, 163, 74, .2) !important;
  border-top-color: #16a34a !important;
}


/* 导出时页面底色统一纯白，去掉灰色背景 */
html.aq-capture-white,
html.aq-capture-white body {
  background: #ffffff !important;
  background-image: none !important;
}


/* 导出时清掉外层容器的边框/圆角/阴影，避免四角出现多余弧线 */
html.aq-capturing,
html.aq-capturing body,
html.aq-capturing :is(.container, .calculator-container, .page, .app, main, .workspace, .dashboard) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background-image: none !important;
}

html.aq-capturing :is(.container, .calculator-container, .page, .app, main, .workspace, .dashboard)::before,
html.aq-capturing :is(.container, .calculator-container, .page, .app, main, .workspace, .dashboard)::after,
html.aq-capturing body::before,
html.aq-capturing body::after {
  display: none !important;
  content: none !important;
}


/* ==========================================================================
   导出时文字加深：html2canvas 会把细字画得很淡，这里统一压到近黑
   ========================================================================== */
html.aq-capturing body,
html.aq-capturing body :is(h1, h2, h3, h4, h5, h6, p, span, label, li, td, th, dt, dd, strong, b, em, summary) {
  color: #101613 !important;
  -webkit-text-fill-color: #101613 !important;
  -webkit-font-smoothing: antialiased;
  text-shadow: none !important;
}

/* 说明文字略浅一点，但仍要能看清 */
html.aq-capturing body :is(.m-note, .field-hint, .sub, .diagram-cap, .unit-hint, .stat-label) {
  color: #3f4a43 !important;
  -webkit-text-fill-color: #3f4a43 !important;
}

/* 数值保持深青 */
html.aq-capturing body :is(
  .m-value, .rec-num, .rec-ratio, .crate-value, .stat-value,
  .kwh-number, .result-value, .metric-value, .rp-main strong,
  .ratio-preview strong, .big-number
) {
  color: #0b6b7d !important;
  -webkit-text-fill-color: #0b6b7d !important;
  font-weight: 800 !important;
}

/* 输入值保持纯黑 */
html.aq-capturing body :is(input, textarea, select) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-weight: 800 !important;
}


/* 导出时标题去渐变（否则白底上仍是浅绿，看着发虚） */
html.aq-capturing body :is(h1, h2, h3) {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #0f1712 !important;
  -webkit-text-fill-color: #0f1712 !important;
}

/* 导出时输入数字用正文字体并加粗，避免细体发虚 */
html.aq-capturing body :is(input, select, textarea) {
  font-family: inherit !important;
  font-weight: 800 !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  letter-spacing: 0 !important;
}


/* 各页「其它工具」按钮的其它 id / class 写法，统一橙色 */
#otherToolsBtn,
#moreToolsBtn,
#btnOther,
#btnTools,
.other-tools-btn,
.btn-other {
  background: #f59e0b !important;
  background-image: none !important;
  color: #1a1206 !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(245, 158, 11, .9) !important;
}

#otherToolsBtn span,
.btn-other span {
  color: inherit !important;
}

/* 「重置」按钮的其它 id 写法 */
#resetBtn,
.btn-reset {
  background: #3b82f6 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(59, 130, 246, .9) !important;
}

#resetBtn span,
.btn-reset span {
  color: inherit !important;
}


/* 「其它工具」：用高权重压过通用次按钮样式 */
body .button-group #otherToolsBtn,
body .button-group #moreBtn,
body .button-group #btnMore,
body .btn-group #otherToolsBtn,
body #otherToolsBtn,
body #moreBtn {
  background: #f59e0b !important;
  background-image: none !important;
  color: #1a1206 !important;
  border: 0 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 26px -12px rgba(245, 158, 11, .9) !important;
}

body .button-group #otherToolsBtn span,
body .button-group #moreBtn span {
  color: inherit !important;
}


/* ==========================================================================
   所有工具：输入框 / 下拉框 里的值一律居中
   ========================================================================== */
body[class*="tool-"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  select
) {
  text-align: center !important;
}

body[class*="tool-"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
  textarea
)::placeholder {
  text-align: center !important;
}

body[class*="tool-"] select {
  text-align-last: center !important;
  padding-left: 34px !important;
  padding-right: 34px !important;
}


/* 导出期间：禁止选中、禁止滚动条跳动 */
html.aq-exporting,
html.aq-exporting body {
  overflow: hidden !important;
  touch-action: none !important;
  cursor: progress !important;
}

html.aq-exporting .aqx-mask {
  cursor: progress;
}

/* 弹窗出现时禁止背景滚动 */
body:has(.aqx-mask) {
  overflow: hidden;
}


/* 导出进度条 */
.aqx-loading { padding: 26px 24px 22px; }

.aqx-bar {
  margin-top: 16px;
  height: 6px;
  border-radius: 999px;
  background: #e8efea;
  overflow: hidden;
}

.aqx-bar i {
  display: block;
  height: 100%;
  width: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #22c55e);
  transition: width .35s ease;
}

.aqx-spin {
  margin-bottom: 10px;
}
