:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #f4f5fa;
  background: #0b0f19;
  --muted: #a9b2c6;
  --lime: #b6f082;
  --yellow: #ffdc84;
  --border: #5564824d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(#aabcf10b 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, #aabcf10b 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(ellipse at 15% 1%, #253653a8, transparent 53%),
    linear-gradient(152deg, #0b0f19 15%, #131b2e 100%);
}
button, textarea { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.shell {
  width: calc(100% - 28px);
  max-width: 660px;
  padding: 28px 0 20px;
  padding-top: calc(28px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  margin: auto;
}
.hero { margin-bottom: 20px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d7e0ec;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
}
.brand-icon { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #b6f08259; border-radius: 8px; background: #b6f08212; color: var(--lime); }
.brand-icon svg { width: 15px; height: 15px; }
.brand-divider { display: inline-block; height: 10px; width: 1px; background: #61728b; margin: 0 7px; vertical-align: -1px; }
h1 { margin: 9px 0 0; font-size: clamp(27px, 8.1vw, 52px); font-weight: 850; line-height: 1.15; letter-spacing: -.045em; }
h1 span { display: inline-block; color: var(--lime); font-weight: 820; font-style: italic; font-size: .68em; letter-spacing: -.03em; transform: translateY(-.05em); }
.subtitle { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(154deg, #202a40e8, #161e30ed 76%);
  box-shadow: inset 0 1px 0 #ffffff12, 0 16px 45px #03061150;
}
.console { padding: 13px 13px 17px; }
.chat {
  overflow: hidden;
  border: 1px solid #52627e5c;
  border-radius: 13px;
  background: radial-gradient(ellipse at top left, #1a2739, #101725 75%);
}
.chat-top, .chat-title, .status { display: flex; align-items: center; }
.chat-top { justify-content: space-between; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #65718f37; background: #3f4c661c; }
.chat-title { gap: 5px; font-size: 12px; font-weight: 750; color: #e3e9f4; }
.chat-title svg { width: 18px; height: 18px; color: var(--lime); }
.status { gap: 5px; font-size: 10px; color: #c6dbb9; white-space: nowrap; }
.status i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 9px #b6f08282; }
.status[data-state="scan"] { color: #ffd68a; }
.status[data-state="scan"] i { background: #ffb86b; box-shadow: 0 0 9px #ffb86b80; animation: blink .38s ease-in-out alternate infinite; }
.status[data-state="offline"] { color: #d1c3ee; }
.status[data-state="offline"] i { background: #c8b4ef; box-shadow: none; }
.message { display: flex; align-items: flex-start; gap: 11px; padding: 12px 11px 13px; min-height: 93px; max-height: 154px; overflow-y: auto; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; box-shadow: 0 4px 10px #0005; border-radius: 9px; }
.message-copy { min-width: 0; }
.boss-name { color: #b9c6db; font-size: 11px; font-weight: 650; margin: 0 0 5px; }
.bubble {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid #d6ffb270;
  border-radius: 3px 9px 9px 9px;
  background: #b6f082;
  color: #15241b;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble::before { content: ""; position: absolute; left: -6px; top: 9px; border-width: 4px 6px 4px 0; border-style: solid; border-color: transparent #b6f082 transparent transparent; }
.bubble[data-empty="true"] { color: #436447; }
.connection-progress { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 11px; border-top: 1px solid #ffb86b34; background: #ffb86b0c; color: #ffda99; font-size: 11px; line-height: 1.4; }
.connection-spinner { width: 11px; height: 11px; flex: 0 0 11px; border: 1px solid #ffda9950; border-top-color: #ffda99; border-radius: 50%; animation: spin .7s linear infinite; }
.input-head { margin-top: 7px; min-height: 35px; }
.input-head, .dialog-head { display: flex; justify-content: space-between; align-items: center; }
.input-head label { font-size: 13px; font-weight: 750; }
.input-count { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); margin-left: auto; margin-right: 9px; }
.input-count[data-full="true"] { color: var(--yellow); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 36px; min-width: 47px; padding: 3px 5px; border: 0; border-radius: 7px; background: transparent; color: #c9d3e7; font-size: 12px; }
.text-button:active { background: #303c54; }
.text-button svg { width: 15px; height: 15px; }
textarea {
  display: block;
  width: 100%;
  min-height: 67px;
  padding: 9px 10px;
  border: 1px solid #60708b69;
  border-radius: 9px;
  background: #0c1321a8;
  color: #f7f8fe;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}
textarea::placeholder { color: #a0acc3; }
.input-error { margin: 6px 0 0; color: #ffadab; font-size: 12px; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 9px 0 11px; }
.shortcuts button {
  padding: 4px;
  min-height: 34px;
  border: 1px solid #65769553;
  border-radius: 8px;
  background: #a4bffc0d;
  color: #e1e8f8;
  font-size: 12px;
  transition: background .15s, border-color .15s;
}
.shortcuts button:active, .shortcuts button[aria-pressed="true"] { background: #b6f08221; border-color: #b6f08270; color: #ddffc4; }
.shortcuts button:disabled { cursor: wait; }
.primary, .secondary { width: 100%; min-height: 45px; border-radius: 9px; font-weight: 800; }
.primary {
  border: 1px solid #ff9871;
  color: #fff;
  background: linear-gradient(112deg, #c32d27, #c94919 72%, #ce4d17);
  box-shadow: 0 6px 0 #991b1b, inset 0 1px 0 #ffe1ad5c;
  text-shadow: 0 1px 1px #691b10;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.primary:active { transform: translateY(5px); box-shadow: 0 1px 0 #991b1b, inset 0 1px 0 #ffe1ad5c; }
.primary.pressed { animation: press .22s ease-out; }
.primary:disabled { cursor: wait; filter: saturate(.8); }
.result { position: relative; padding: 15px 13px 13px; margin-top: 13px; --stamp-color: #ff796e; }
.result[data-clean="true"] { --stamp-color: #a9eb83; }
.result-title { margin: 0 0 13px; font-size: 19px; letter-spacing: .015em; }
.stamp {
  position: absolute;
  z-index: 1;
  top: 15px;
  right: 14px;
  max-width: 50%;
  padding: 5px 7px;
  border: 2px dashed currentColor;
  border-radius: 5px;
  outline: 1px solid currentColor;
  outline-offset: 2px;
  color: var(--stamp-color);
  background: repeating-linear-gradient(132deg, #ff9d8a0b 0 1px, transparent 1px 4px);
  font-size: clamp(15px, 4.4vw, 23px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  opacity: .86;
  transform: rotate(-12deg);
  pointer-events: none;
}
.result.impact { animation: shake .38s .08s both; }
.result.impact .stamp { animation: stamp .36s cubic-bezier(.2,.7,.25,1.15) both; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 20px; font-size: 12px; color: #ced9ed; font-weight: 700; }
.meter-head output { font-size: 18px; color: var(--stamp-color); font-weight: 850; }
.meter { height: 7px; margin: 6px 0 14px; border-radius: 12px; background: #101725; overflow: hidden; }
.meter-fill { width: 0; height: 100%; border-radius: 12px; background: linear-gradient(90deg,#ffac5e,#f64e55); transition: width .6s cubic-bezier(.18,.8,.18,1); }
.result-block h3, .advice h3 { margin: 0; color: #cbdaef; font-size: 12px; line-height: 1.45; }
.truth { margin: 6px 0 12px; color: var(--yellow); font-size: clamp(19px, 5.4vw, 26px); font-weight: 800; line-height: 1.43; overflow-wrap: anywhere; }
.advice { padding: 10px; border-left: 2px solid #b6f08291; border-radius: 5px 9px 9px 5px; background: #a8cad113; }
.advice h3 { color: #d7efc9; }
.advice p { margin: 4px 0 0; color: #edf1fb; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.secondary { margin-top: 10px; border: 1px solid #7d8ba566; color: #e7edfa; background: #b0c8fc12; font-size: 13px; }
.secondary span { color: var(--lime); margin-left: 3px; }
.secondary:active { background: #b0c8fc2b; }
.secondary:disabled { opacity: .7; cursor: wait; }
footer { margin: 17px 2px 0; text-align: center; color: #b3bed0; font-size: 10px; line-height: 1.6; }
footer span { display: block; color: #a3aec5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.modal { position: fixed; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; background: #050913df; }
.poster-dialog { width: min(100%, 450px); max-height: 100%; overflow: auto; padding: 10px; border: 1px solid #6478988a; border-radius: 15px; background: #172238; }
.dialog-head h2 { margin: 0; font-size: 15px; }
.poster-dialog img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 118px); max-height: calc(100dvh - 118px); margin: 5px auto; border-radius: 6px; }
.poster-dialog p { margin: 6px 0 1px; text-align: center; color: #d2dded; font-size: 12px; line-height: 1.4; }
body.modal-open { overflow: hidden; }
@keyframes blink { to { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes press { 45% { transform: translateY(5px); box-shadow: 0 1px 0 #991b1b; } }
@keyframes stamp {
  0% { opacity: 0; transform: translate(9px,-17px) scale(1.7) rotate(-19deg); }
  51% { opacity: 1; transform: translateY(1px) scale(.93) rotate(-12deg); }
  75% { transform: scale(1.04) rotate(-12deg); }
}
@keyframes shake {
  22%, 62% { transform: translateX(-2px); }
  42%, 78% { transform: translateX(2px); }
}
@media (min-width: 520px) {
  .shell { padding-top: 39px; }
  .console, .result { padding: 17px 17px 20px; }
  .chat-top { padding-inline: 13px; }
  .message { padding: 14px; }
  .avatar { width: 44px; height: 44px; flex-basis: 44px; }
  .shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stamp { right: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
