* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #f4f7fc; color: #0b1a33; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Microsoft YaHei', sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 3px solid #8ec7ff; outline-offset: 3px; }
.calculator-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; flex-shrink: 0; min-height: 66px; padding: 10px 28px; background: #fff; border-bottom: 1px solid #e7edf5; }
.calculator-plan { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; color: #16803d; background: #eaf8ef; font-size: .8rem; font-weight: 500; }
.calculator-plan strong { font-size: .85rem; font-style: italic; font-weight: 800; }
.calculator-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 1.325rem; font-weight: 700; line-height: 1.4; }
.calculator-title-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #006acd; font: 700 1.45rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.calculator-open-link { display: inline-flex; align-items: center; gap: 6px; justify-self: end; color: #69798d; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.calculator-open-link:hover { color: #006acd; }
.calculator-main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; padding: 32px 24px 16px; }
.calculator-wrapper { display: flex; flex: 1 0 auto; align-items: center; justify-content: center; width: 100%; min-width: 0; }
.obfuscator-card { width: 100%; max-width: 1200px; min-width: 0; padding: 26px; border: 1px solid #e5ebf3; border-radius: 24px; background: #fff; box-shadow: 0 12px 40px rgba(18,61,107,.06); }
.tool-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid #e7edf5; }
.section-kicker { display: block; margin-bottom: 7px; color: #8895a7; font-size: .75rem; }
.tool-intro h2 { margin: 0 0 8px; color: #315d8d; font-size: 1.4rem; }
.tool-intro p { margin: 0; color: #69798d; font-size: .85rem; line-height: 1.8; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dcece4; border-radius: 9px; color: #648977; font-size: .73rem; background: #f5faf7; white-space: nowrap; }
.local-badge span { color: #5eae81; font-size: .5rem; }
.tool-options, .strength-field { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tool-options { gap: 14px 24px; }
.tool-options label { display: inline-flex; align-items: center; gap: 7px; color: #536f8b; font-size: .8rem; cursor: pointer; }
.tool-options input { margin: 0; accent-color: #006acd; }
select { max-width: 100%; min-height: 36px; padding: 6px 26px 6px 10px; border: 1px solid #dce5f0; border-radius: 8px; color: #315d8d; background: #f8faff; font-size: .8rem; }
.option-hint { margin: 12px 0 24px; color: #8895a7; font-size: .75rem; line-height: 1.8; }
.editor-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.editor-panel { min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 30px; margin-bottom: 10px; }
.panel-heading h3 { margin: 0; color: #315d8d; font-size: .95rem; font-weight: 600; }
.text-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.text-actions button { padding: 4px 0; border: 0; color: #6f849d; background: transparent; font-size: .75rem; }
.text-actions button:hover { color: #006acd; }
textarea { display: block; width: 100%; min-height: 360px; max-height: 700px; padding: 16px; resize: vertical; border: 1px solid #dce5f0; border-radius: 16px; background: #f8faff; color: #0b1a33; font: .85rem/1.85 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
textarea[readonly] { background: #f4f7fc; }
textarea:focus, select:focus { outline: none; border-color: #006acd; box-shadow: 0 0 0 3px #e7f2ff; }
textarea::placeholder { color: #98a5b6; }
.editor-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; margin-top: 10px; color: #8895a7; font-size: .7rem; }
.output-label { color: #8895a7; font-size: .75rem; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.run-actions, .export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 20px; border: 1px solid #dce5f0; border-radius: 10px; font-size: .85rem; font-weight: 600; line-height: 1.5; }
.button.primary { color: #fff; background: #006acd; border-color: #006acd; box-shadow: 0 4px 14px rgba(0,106,205,.15); }
.button.primary:hover:not(:disabled) { background: #0059b3; }
.button.secondary { color: #536f8b; background: #fff; }
.button.secondary:hover:not(:disabled) { color: #006acd; background: #eef4fe; border-color: #bfd6ec; }
.shortcut-hint { color: #96a3b5; font-size: .7rem; }
.tool-status { min-height: 24px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #eef2f8; color: #69798d; font-size: .8rem; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.tool-status.is-error { color: #c63646; }
.calculator-tips { flex-shrink: 0; width: 100%; max-width: 1200px; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #e7edf5; color: #66758a; font-size: .8rem; line-height: 1.9; }
.calculator-tips h2 { margin: 0 0 12px; color: #69798d; font-size: .9rem; font-weight: 600; }
.tips-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tips-grid p { margin: 0; }
.tips-grid strong { display: block; margin-bottom: 5px; color: #536f8b; font-weight: 600; }
@media (max-width: 767.98px) {
    .calculator-header { padding: 8px 16px; gap: 10px; }
    .calculator-plan { padding: 5px 8px; font-size: .72rem; }
    .calculator-title { gap: 7px; font-size: 1.175rem; }
    .calculator-open-link { font-size: .8rem; }
    .calculator-main { padding: 24px 16px 16px; gap: 20px; }
    .obfuscator-card { padding: 20px; }
    .editor-layout, .tips-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    textarea { min-height: 280px; }
}
@media (max-width: 575.98px) {
    .calculator-header { grid-template-columns: minmax(0, 1fr) auto; }
    .calculator-title { grid-column: 1 / -1; grid-row: 1; }
    .calculator-plan { grid-column: 1; grid-row: 2; }
    .calculator-open-link { grid-column: 2; grid-row: 2; }
    .obfuscator-card { padding: 18px 16px; border-radius: 22px; }
    .tool-intro h2 { font-size: 1.25rem; }
    .tool-options { gap: 15px; }
    .strength-field { width: 100%; gap: 10px; }
    .shortcut-hint { display: none; }
    .tool-actions { align-items: stretch; }
    .export-actions { width: 100%; }
    .export-actions .button { flex: 1; }
}
