:root {
  color-scheme: light;
  --porcelain: #eef4f8;
  --ink: #17324d;
  --teal: #087e82;
  --muted: #526e84;
  --bluegray: #698397;
  --paper: #ffffff;
  --line: #d8e3eb;
  --wash: #e7f2f3;
  --danger: #a33f37;
  --display: Baskerville, Palatino, "Palatino Linotype", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --mono: Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 83% 2%, #dcebf0 0, transparent 42%), linear-gradient(135deg, #f7fafc 0, var(--porcelain) 62%, #e8f0f5 100%); font-family: var(--body); font-size: 14px; line-height: 1.7; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button, input, textarea, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
button { color: var(--ink); }
button, a, input, textarea { touch-action: manipulation; }
button, input, textarea { border-radius: 6px; }
p, h1, h2 { margin: 0; }
[hidden] { display: none !important; }
.workbench { max-width: 1232px; padding: 0 48px; margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 31px 0 26px; border-bottom: 1px solid var(--line); gap: 20px; }
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 14px; font: 600 25px/1.1 var(--display); letter-spacing: .13em; }
.brand-note { display: block; font: 9px/1.5 var(--mono); letter-spacing: .15em; margin-top: 8px; color: var(--muted); }
.envelope { width: 43px; height: 32px; border: 1px solid var(--ink); border-radius: 2px; position: relative; overflow: hidden; background: var(--paper); }
.envelope::before { content: ""; position: absolute; width: 31px; height: 31px; left: 5px; top: -19px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg); background: var(--porcelain); }
.envelope::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); top: 10px; left: 16px; box-shadow: 0 0 0 3px var(--paper); }
.local-badge { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.local-badge > span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.introduction { display: flex; justify-content: space-between; align-items: flex-end; padding: 38px 0 29px; gap: 32px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; color: var(--teal); margin-bottom: 12px; }
h1 { font: 500 40px/1.45 var(--display); letter-spacing: .035em; }
.intro-note { color: var(--muted); font-size: 12px; line-height: 2; padding-bottom: 7px; max-width: 340px; }
.scope-note { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; border-left: 3px solid var(--teal); background: #e3edf2; padding: 12px 17px; margin-bottom: 24px; font-size: 12px; color: #405c72; }
.scope-note p { flex: 1 1 75%; }
.scope-note a { color: var(--teal); min-height: 32px; padding-block: 5px; }
.scope-note strong { font-weight: 600; }
.note-tag { color: var(--teal); white-space: nowrap; font-weight: 600; }
.key-panel { background: #f8fbfd; border: 1px solid var(--line); padding: 20px 24px 18px; border-radius: 9px; }
.key-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 11px; }
h2 { font-size: 16px; font-weight: 600; }
.key-heading > span { font-size: 11px; color: var(--muted); }
.key-controls { display: flex; gap: 14px; }
.key-field { display: flex; flex: 1; min-width: 0; position: relative; }
.key-field input { width: 100%; min-width: 0; border: 1px solid #b7cbd9; background: var(--paper); padding: 10px 64px 10px 13px; font: 13px/1.8 var(--mono); color: var(--ink); height: 44px; }
.key-field input::placeholder { font-family: var(--body); font-size: 12px; color: var(--bluegray); }
.reveal-button { position: absolute; right: 5px; top: 5px; border: none; background: transparent; color: var(--muted); padding: 5px 10px; font-size: 12px; height: 34px; }
.key-actions { display: flex; gap: 8px; }
.button { border: 1px solid transparent; padding: 10px 17px; min-height: 44px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.button-secondary { background: var(--paper); border-color: #b7cbd9; }
.button-secondary:hover:not(:disabled) { background: var(--porcelain); border-color: var(--bluegray); }
.button-quiet { background: #e7eef3; }
.button-quiet:hover:not(:disabled) { background: #d9e6ee; }
.field-help { font-size: 11px; color: var(--muted); margin-top: 9px; }
.workspace-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 27px 0 17px; gap: 20px; }
.mode-switch { display: inline-flex; background: #dfe9f0; padding: 4px; border-radius: 7px; gap: 4px; }
.mode-switch button { border: 0; background: transparent; padding: 8px 24px; font-size: 13px; min-height: 40px; }
.mode-switch button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 2px 5px #17324d0c; font-weight: 600; color: var(--teal); }
.text-button { background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 8px 6px; min-height: 40px; }
.text-button:hover:not(:disabled) { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-panel { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 26px #17324d04; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 21px 23px 17px; }
.section-caption { display: block; font: 10px/1.8 var(--mono); letter-spacing: .09em; color: var(--muted); margin-bottom: 5px; }
.editor-panel textarea { resize: vertical; min-height: 185px; width: 100%; padding: 7px 23px 14px; border: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.95; border-radius: 0; }
.editor-panel textarea:focus-visible { outline-offset: -3px; }
.editor-panel textarea::placeholder { color: var(--bluegray); opacity: 1; }
.editor-foot { padding: 0 23px 16px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
#input-count { font-family: var(--mono); white-space: nowrap; }
.format-options { border: 0; border-top: 1px solid #e8eef3; margin: 0 23px; padding: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.format-options legend { float: left; width: 100%; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.format-choice { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; padding: 6px 0; }
.format-choice input { margin: 4px 0 0; accent-color: var(--teal); width: 14px; height: 14px; flex-shrink: 0; }
.format-choice strong { font-size: 12px; font-weight: 500; display: block; }
.format-choice small { font-size: 10px; color: var(--muted); display: block; }
.format-choice:first-of-type { grid-column: 1 / -1; }
#decrypt-options { margin: 0 23px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
#decrypt-format { display: block; width: 100%; min-height: 44px; margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font: inherit; }
.submit-row { display: flex; align-items: center; gap: 13px; padding: 18px 23px 22px; margin-top: auto; }
.button-primary { background: var(--teal); color: var(--paper); display: inline-flex; align-items: center; justify-content: space-between; gap: 27px; padding-inline: 18px; }
.button-primary:hover:not(:disabled) { background: #06676b; }
.button-primary > span:last-child { font-size: 19px; line-height: 1; font-weight: 400; }
#action-note { color: var(--muted); font-size: 10px; }
.result-panel { background: linear-gradient(150deg, #f8fcfd 0, #f3f9fa 100%); border-color: #ccdee3; }
.result-badge { color: var(--muted); font-size: 10px; background: #e7eff3; border-radius: 4px; padding: 4px 8px; white-space: nowrap; }
.result-badge[data-state="ready"] { background: #def0ed; color: #09696c; }
.result-body { flex: 1; display: flex; }
.result-panel textarea { min-height: 270px; font-family: var(--mono), var(--body); font-size: 12px; overflow-wrap: anywhere; flex: 1; }
.result-panel textarea::placeholder { font-family: var(--body); font-size: 13px; line-height: 2; }
.result-footer { border-top: 1px dashed #ccdee3; padding: 17px 23px 21px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.result-footer p { color: var(--muted); font-size: 10px; }
.result-actions { display: flex; align-items: center; gap: 9px; }
.status { font-size: 12px; min-height: 26px; margin-top: 12px; color: var(--teal); }
.status[data-state="error"] { color: var(--danger); }
.page-footer { margin: 24px 0 30px; border-top: 1px solid var(--line); padding-top: 19px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.page-footer strong { font-weight: 500; color: var(--ink); }
.footer-mark { display: block; margin-top: 13px; color: var(--muted); font: 10px/1.7 var(--mono), var(--body); letter-spacing: .03em; }
.footer-mark > span { margin: 0 8px; color: #93a7b7; }
.noscript-note { color: var(--danger); margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: no-preference) {
  .introduction { animation: arrive .5s ease-out both; }
  .workspace-grid { animation: arrive .6s .08s ease-out both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 950px) {
  .workbench { padding-inline: 28px; }
  .introduction { gap: 24px; }
  h1 { font-size: 34px; }
  .intro-note { max-width: 260px; }
  .desktop-break { display: none; }
  .panel-heading, .result-footer { padding-inline: 18px; }
  .editor-panel textarea { padding-inline: 18px; }
  .editor-foot { padding-inline: 18px; }
  .format-options { margin-inline: 18px; grid-template-columns: 1fr; gap: 2px; }
  .submit-row { padding-inline: 18px; gap: 10px; }
  #action-note { max-width: 90px; }
  .result-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 680px) {
  .workbench { padding-inline: 20px; }
  .masthead { padding: 23px 0 21px; gap: 12px; }
  .brand { font-size: 23px; gap: 10px; }
  .brand-note { font-size: 7px; letter-spacing: .1em; }
  .envelope { transform: scale(.88); transform-origin: left center; margin-right: -4px; }
  .local-badge { font-size: 10px; gap: 6px; }
  .introduction { display: block; padding: 28px 0 23px; }
  h1 { font-size: 32px; }
  .intro-note { max-width: none; margin-top: 17px; font-size: 11px; }
  .scope-note { padding: 11px 13px; gap: 9px; font-size: 11px; margin-bottom: 20px; }
  .key-panel { padding: 17px 16px; }
  .key-heading { gap: 10px; }
  .key-heading > span { font-size: 10px; }
  .key-controls { flex-direction: column; gap: 9px; }
  .key-actions { justify-content: flex-end; }
  .key-actions .button { min-height: 40px; padding-block: 8px; }
  .field-help { font-size: 10px; margin-top: 10px; }
  .workspace-toolbar { margin-top: 23px; }
  .mode-switch button { padding-inline: 19px; font-size: 12px; }
  .workspace-grid { grid-template-columns: 1fr; gap: 16px; }
  .format-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  #action-note { max-width: none; }
  .result-footer { flex-direction: row; align-items: center; }
  .result-panel textarea { min-height: 210px; }
  .page-footer { margin-top: 21px; }
}
@media (max-width: 370px) {
  .workbench { padding-inline: 14px; }
  .local-badge { max-width: 85px; white-space: normal; font-size: 9px; }
  .local-badge > span { flex-shrink: 0; }
  h1 { font-size: 29px; }
  .format-options { grid-template-columns: 1fr; }
  .submit-row { gap: 8px; }
}
