@font-face { font-family: 'Asset'; src: url('fonts/Asset-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'WenYuanSerifSC'; src: url('fonts/文源宋体/Variable/WenYuanSerifSCVF.otf') format('opentype-variations'); font-weight: 200 900; font-display: swap; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: inherit; }
html, body { height: 100%; }
body { font-family: 'WenYuanSerifSC', serif; background: #fff; color: #111; display: flex; flex-direction: column; min-height: 100vh; font-size: 16px; line-height: 1.6; overflow-y: auto; -ms-overflow-style: none; scrollbar-width: none; }
body::-webkit-scrollbar { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #000; flex-wrap: wrap; gap: 12px; }
.brand { font-family: 'Asset', serif; font-size: 22px; font-weight: 400; letter-spacing: 0.5px; }
.tabs { display: flex; gap: 8px; }
.tab { background: #fff; color: #000; border: 1px solid #000; padding: 6px 16px; cursor: pointer; font-size: 14px; }
.tab:hover { background: #f0f0f0; }
.tab.active { background: #000; color: #fff; }
.container { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 20px; }
.panel { display: flex; flex-direction: column; gap: 20px; }
.panel.hidden, .hidden { display: none !important; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; }
.textarea { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid #000; resize: vertical; font-family: inherit; font-size: 14px; background: #fff; color: #111; }
.textarea:focus { outline: none; box-shadow: 0 0 0 1px #000; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.switch-row { display: flex; align-items: center; gap: 6px; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { appearance: none; width: 36px; height: 18px; background: #fff; border: 1px solid #000; position: relative; cursor: pointer; margin: 0; }
.switch input::before { content: ''; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; background: #fff; border: 1px solid #000; transition: transform 0.15s; }
.switch input:checked { background: #000; }
.switch input:checked::before { transform: translateX(18px); background: #fff; border-color: #fff; }
.switch-label { font-size: 13px; font-weight: 600; }
.help-icon { color: #999; cursor: pointer; transition: color 0.15s; flex-shrink: 0; }
.help-icon:hover { color: #000; }
.btn { background: #fff; color: #000; border: 1px solid #000; padding: 8px 20px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s; }
.btn:hover { background: #f0f0f0; }
.btn.primary { background: #000; color: #fff; border-color: #000; }
.btn.primary:hover { background: #222; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #fff; color: #999; border-color: #ccc; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; }
.result { width: 100%; border: 1px solid #000; padding: 12px; min-height: 60px; word-break: break-all; white-space: pre-wrap; color: #111; background: #fff; resize: vertical; font-size: 14px; }
.footer { padding: 16px 24px; border-top: 1px solid #000; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #555; flex-wrap: wrap; gap: 8px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal.show { display: flex; }
.modal-box { background: #fff; border: 1px solid #000; padding: 28px 24px; max-width: 380px; width: 90%; }
.modal-msg { word-break: break-word; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.invalid-char { display: inline-block; padding: 2px 8px; margin: 0 2px; background: #000; color: #fff; border: 1px solid #000; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%); background: #000; color: #fff; padding: 12px 24px; border: 1px solid #000; max-width: 90%; word-break: break-word; font-size: 14px; z-index: 200; opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; gap: 8px; }
  .brand { font-size: 18px; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .container { padding: 20px 14px; }
  .panel { gap: 16px; }
  .textarea { min-height: 100px; font-size: 16px; -webkit-appearance: none; border-radius: 0; }
  .result { font-size: 16px; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; padding: 10px 20px; font-size: 15px; }
  .switch input { width: 40px; height: 22px; }
  .switch input::before { top: 2px; left: 2px; width: 16px; height: 16px; }
  .switch input:checked::before { transform: translateX(18px); }
  .help-icon { width: 20px; height: 20px; }
  .modal-box { padding: 20px 16px; width: calc(100% - 32px); }
  .toast { bottom: 16px; left: 16px; right: 16px; transform: translateY(120%); max-width: none; }
  .toast.show { transform: translateY(0); }
  .footer { padding: 12px 16px; font-size: 11px; flex-direction: column; gap: 4px; text-align: center; }
}
