:root {
  color-scheme: light;
  --paper: #f5f0e9;
  --ink: #202020;
  --purple: #7024be;
  --electric: #bf7aff;
  --muted: #5d5262;
  --line: #d6cbd1;
  --control-line: #9c8e9b;
  --surface: #fffcf8;
  --error: #873722;
  --warm: #ede8df;
  --lilac: #ede6f5;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
a { color: inherit; text-decoration: none; }
a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: .25em; }
button, input, textarea { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
.skip { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 10px 14px; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
.shell { width: min(1220px, calc(100% - 72px)); margin-inline: auto; }
.site-header { min-height: 81px; display: flex; align-items: center; gap: clamp(16px, 3vw, 48px); border-bottom: 1px solid var(--line); }
.brand { margin-right: auto; display: inline-flex; flex: none; gap: 8px; align-items: center; font-size: 1.25rem; font-weight: 750; }
.brand img { width: 44px; height: 44px; }
.site-header nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); font-size: .9375rem; white-space: nowrap; }
.site-header nav a { display: flex; align-items: center; min-height: 44px; }
.accent, .text-link { color: var(--purple); }
.text-link { font-weight: 650; }
.button { border: 1px solid transparent; min-height: 44px; border-radius: 7px; padding: 10px 16px; font-weight: 700; line-height: 1.3; background: var(--purple); color: white; text-align: left; }
.button:not(:disabled):hover { background: #5f1da6; }
.button:disabled { opacity: 1; cursor: default; }
.header-release { width: 142px; flex: none; }
.hero-release { width: 152px; min-height: 47px; }

.hero { display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); gap: clamp(16px, 3.2vw, 48px); align-items: center; padding-block: 50px 62px; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); letter-spacing: -.047em; line-height: 1.16; font-weight: 800; }
.hero-subtitle { font-size: clamp(1.5rem, 2.7vw, 2.125rem); color: var(--purple); margin-top: 19px; font-weight: 750; }
.intro { color: var(--muted); line-height: 1.7; }
.hero .intro { margin-top: 20px; font-size: 1.125rem; }
.hero-actions { margin-top: 26px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px clamp(16px, 2vw, 28px); }
.hero-actions a { padding: 9px 0; }
.connection {
  container-type: inline-size;
  min-width: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: clamp(12px, 2.7vw, 40px);
  isolation: isolate;
  position: relative;
  scroll-margin-top: 18px;
}
.connection::before {
  content: "";
  position: absolute;
  inset: 8px 8% 8px 4%;
  z-index: -1;
  background: url("./rr-dark.svg") center / min(90%, 495px) auto no-repeat;
  filter: grayscale(1);
  opacity: .13;
}
.connection-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 16cqw auto; font-size: clamp(.75rem, 2.8cqw, 1rem); }
.side-labels { grid-column: 1 / -1; grid-row: 1; display: flex; justify-content: space-between; margin: 0 20% 12px 0; color: var(--electric); font-size: .875rem; font-weight: 720; }
.sender, .receiver { min-width: 0; border-radius: 11px; padding: clamp(10px, 3.5cqw, 20px); }
.sender { grid-column: 1 / 9; grid-row: 2 / 4; align-self: start; background: #303030; border: 1px solid #555; padding-bottom: clamp(19px, 5cqw, 30px); }
.sender-top, .receiver-top { border-bottom: 1px solid; font-size: .75rem; font-weight: 650; padding-bottom: 6px; margin-bottom: 9px; }
.sender-top { color: #e2d5ec; border-color: #57505b; display: flex; align-items: center; gap: 17px; }
.sender-top i { width: 6px; height: 6px; border-radius: 50%; background: var(--electric); box-shadow: 9px 0 #9786ad; }
.sender strong, .receiver strong { font-size: clamp(.875rem, 4cqw, 1.375rem); }
.sender p { color: #e2d5ec; margin-top: 3px; }
.waiting { margin-top: 12px; padding: 6px 10px; width: fit-content; border: 1px solid #605669; border-radius: 6px; font-weight: 650; background: #373239; }
.waiting::before { content: ""; display: inline-block; margin-right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--electric); }
.receiver { grid-column: 5 / 13; grid-row: 3; z-index: 1; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.receiver-top { color: var(--muted); border-color: var(--line); }
.receiver dl { margin-top: 8px; }
.receiver dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.receiver dl dt, .receiver dl dd { padding-block: 2px; }
.receiver dl dd { color: var(--muted); font-weight: 650; }
.receiver dl div:first-child dd { color: var(--purple); }
.example-actions { display: flex; justify-content: end; align-items: center; gap: clamp(8px, 3cqw, 20px); margin-top: 8px; color: var(--muted); }
.example-actions span:last-child { display: inline-block; padding: 6px 9px; background: var(--ink); color: var(--paper); font-weight: 650; border-radius: 5px; }
.connection figcaption { margin-top: clamp(10px, 4cqw, 28px); color: #e2d5ec; font-size: .8125rem; }

.scenarios { padding-block: 14px 30px; }
.scenarios h2 { font-size: clamp(1.75rem, 3.6vw, 2.7rem); }
.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 20px; }
.scenario-grid article { padding: 24px; border-radius: 12px; background: var(--warm); border: 1px solid #e4d7e3; }
.scenario-grid article:nth-child(2) { background: var(--lilac); }
.scenario-grid h3 { font-size: clamp(1.2rem, 2.45vw, 1.625rem); }
.scenario-grid p { margin-top: 9px; color: var(--muted); line-height: 1.55; }
.platforms { padding-block: 26px; border-block: 1px solid var(--line); }
.platforms h2 { font-size: clamp(1.45rem, 2.45vw, 2rem); }
.help { padding-block: 35px 48px; }
.help h2 { font-size: clamp(1.45rem, 2.45vw, 2rem); margin-bottom: 15px; }
.help details { border-bottom: 1px solid var(--line); }
.help details:first-of-type { border-top: 1px solid var(--line); }
.help summary { padding-block: 14px; font-weight: 670; }
.help summary::marker { color: var(--purple); }
.help details p { color: var(--muted); line-height: 1.7; max-width: 64ch; padding-bottom: 15px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 16px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; color: var(--muted); }
.site-footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: .9375rem; }
.site-footer a { display: flex; align-items: center; min-height: 44px; }
.site-footer img { display: block; width: 128px; height: auto; }

.ticket-main { padding-block: 42px 50px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 350px); gap: 12px 44px; align-items: start; justify-content: start; }
.ticket-main h1 { grid-column: 1 / -1; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.ticket-main > .intro, #ticket-form, .closed { grid-column: 1; }
.ticket-main > .intro { margin-bottom: 13px; }
.closed { padding-block: 18px; }
.closed h2 { font-size: 1.25rem; margin-bottom: 14px; }
.closed .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.ticket-status { grid-column: 2; grid-row: 2 / span 2; align-self: start; overflow-wrap: anywhere; }
.ticket-status[data-state] { display: grid; padding: 20px; gap: 10px; border-radius: 10px; }
.ticket-status[data-state="success"] { background: var(--ink); color: var(--paper); }
.ticket-status[data-state="success"] .text-link { color: var(--electric); }
.ticket-status[data-state="success"] :focus-visible { outline-color: var(--electric); }
.ticket-status[data-state="failure"] { background: #f6eae5; border: 1px solid #dfc7b9; color: var(--error); }
.ticket-status[data-state="pending"] { background: var(--lilac); }
.ticket-status button { justify-self: start; padding: 7px 0; background: none; border: 0; }
.ticket-status strong, .ticket-status p { display: block; margin-bottom: 7px; }
.ticket-status strong { font-size: 1.125rem; }
fieldset { display: grid; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field-label { display: block; font-weight: 700; font-size: .9375rem; }
.field label span, .field-label span { font-weight: 500; }
.field input:not([type=file]), .field textarea, .attachment-button { display: block; width: 100%; min-height: 44px; margin-top: 7px; padding: 10px 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--control-line); border-radius: 7px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { resize: vertical; min-height: 128px; }
.field [aria-invalid=true] { border-color: var(--error) !important; }
.field .attachment-button { background: var(--warm); color: var(--purple); text-align: left; font-weight: 650; }
.attachment-row { display: flex; gap: 5px 14px; flex-wrap: wrap; align-items: center; overflow-wrap: anywhere; margin-top: 6px; }
.attachment-row .text-link { background: none; border: 0; padding: 7px 0; }
.hint, .error { font-size: .875rem; line-height: 1.5; margin-top: 7px; color: var(--muted); }
.error { color: var(--error); font-weight: 600; }
.error:empty { display: none; }

@media (max-width: 800px) {
  .shell { width: calc(100% - 36px); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-block: 32px 34px; }
  .hero h1 { font-size: clamp(2.4rem, 9.5vw, 3.65rem); }
  .hero .intro { margin-top: 15px; font-size: 1rem; }
  .hero-subtitle { margin-top: 14px; }
  .hero-actions { margin-top: 19px; }
  .hero-release { width: 139px; }
  .connection { padding: clamp(13px, 4vw, 26px); }
  .scenario-grid { gap: 12px; }
  .scenario-grid article { padding: 16px; }
}

@media (max-width: 600px) {
  .site-header { min-height: 62px; gap: 12px; }
  .brand { font-size: 1rem; gap: 3px; }
  .brand img { width: 36px; height: 36px; }
  .site-header nav { gap: 12px; font-size: .875rem; }
  .site-header .cases-nav { display: none; }
  .ticket-link span { display: none; }
  .header-release { width: auto; min-height: 34px; padding-inline: 9px; font-size: .875rem; }
  .connection-grid { grid-template-rows: auto auto auto; }
  .sender { grid-column: 1 / 10; grid-row: 2; padding-bottom: 24px; }
  .receiver { grid-column: 5 / -1; margin-top: -14px; }
  .scenario-grid { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
  .scenario-grid article { padding: 13px; }
  .scenario-grid p { margin-top: 6px; }
  .site-footer { padding-top: 12px; }
  .site-footer img { width: 109px; }
  .site-footer nav { gap: 0 12px; font-size: .875rem; }
  .ticket-main { grid-template-columns: minmax(0, 1fr); padding-block: 32px 40px; }
  .ticket-status { grid-column: 1; grid-row: auto; }
  .ticket-status[data-state="failure"] { grid-row: 3; }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 28px); }
  .site-header, .site-header nav { gap: 9px; }
  .hero-actions { gap: 12px; font-size: .9375rem; }
  .hero-release { width: 118px; }
}
