:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17243a;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #2769e8;
  --blue-dark: #1f56c7;
  --ink: #17243a;
  --muted: #758299;
  --line: #e5eaf2;
  --surface: #fff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -10%, #e5edff 0, transparent 520px), #f5f7fb;
}
button, input, textarea { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #81aaff;
  outline-offset: 3px;
}
.page-shell { width: min(100% - 32px, 620px); margin: 0 auto; padding: 30px 0 24px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 22px; color: #273c5d; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #5595ff, #2869e9); border-radius: 12px; box-shadow: 0 6px 14px #3478f62c; }
.brand-mark svg { width: 27px; height: 27px; }
.panel { background: var(--surface); border: 1px solid #e7ebf2; border-radius: 22px; padding: 34px 44px 27px; box-shadow: 0 18px 48px #2d49730c, 0 2px 8px #2d497308; }
.panel-heading { text-align: center; margin-bottom: 25px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #8290a6; font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #4e89f5; box-shadow: 0 0 0 4px #4e89f51a; }
h1 { margin: 13px 0 7px; font-size: clamp(25px, 5vw, 31px); line-height: 1.28; letter-spacing: -.035em; }
h1 span { color: var(--blue); }
#page-subtitle { margin: 0; color: #7f8ba0; font-size: 13px; }
.steps { width: min(100%, 330px); display: flex; align-items: center; justify-content: space-between; margin: 21px auto 0; color: #8491a6; font-size: 11px; }
.steps span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.steps i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #edf3ff; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 700; }
.steps b { width: 27px; height: 1px; background: #e3e9f2; }
.field { margin-top: 20px; }
.field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin-bottom: 8px; color: #34445d; font-size: 13px; font-weight: 650; }
.label-note { color: #99a3b2; font-size: 11px; font-weight: 400; }
input, textarea { display: block; width: 100%; border: 1px solid #dfe5ee; border-radius: 11px; background: #fff; color: #26364e; font-size: 14px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
input { height: 48px; padding: 0 14px; }
textarea { min-height: 116px; padding: 13px 42px 13px 14px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #adb7c5; }
input:focus, textarea:focus { border-color: #78a7ff; box-shadow: 0 0 0 4px #3478f614; }
.textarea-wrap { position: relative; }
.link-glyph { position: absolute; right: 14px; top: 12px; color: #9ba9bd; font-size: 20px; pointer-events: none; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin: 8px 1px 0; color: #9aa5b4; font-size: 10px; }
.inline-status { min-height: 15px; color: #8d99ab; font-size: 10px; }
.inline-status.is-done { color: #27845c; }
.input-with-status { position: relative; }
.input-with-status input { padding-right: 94px; }
.input-with-status .inline-status { position: absolute; top: 17px; right: 13px; }
.helper { margin: 7px 1px 0; color: #8a96a8; font-size: 11px; line-height: 1.65; }
.primary-button { width: 100%; min-height: 49px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; border: 0; border-radius: 11px; background: var(--blue); box-shadow: 0 7px 15px #2769e82b; color: #fff; font-size: 14px; font-weight: 650; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-button:hover { transform: translateY(-1px); background: var(--blue-dark); box-shadow: 0 9px 20px #2769e83a; }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.secondary-actions { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 13px; color: #9aa5b4; font-size: 11px; }
.restore-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid #e3e9f2; border-radius: 8px; background: #fff; color: #64748b; font-size: 11px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.restore-button:hover:not(:disabled) { color: var(--blue); border-color: #bfd2f5; background: #f7faff; }
.restore-button:disabled { opacity: .55; cursor: wait; }
.restore-icon { font-size: 14px; }
.notice { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #f0f2f6; color: #909bad; font-size: 11px; }
.notice-icon { width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid #b7c1ce; border-radius: 50%; font-size: 9px; font-weight: 700; }
.form-message { display: none; margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f5d9d5; border-radius: 9px; background: #fff7f5; color: #c65e54; font-size: 12px; line-height: 1.5; }
.form-message.visible { display: block; }
.card-info { margin: -3px 0 20px; padding: 15px 17px 14px; border: 1px solid #dfe9fb; border-radius: 14px; background: linear-gradient(120deg, #f4f8ff, #fbfdff); transition: opacity .2s; }
.card-info.is-loading { opacity: .62; }
.card-info.is-unavailable { border-color: #f0d5d1; background: #fff9f8; }
.card-info-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ticket-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: #e5efff; color: var(--blue); font-size: 12px; font-weight: 700; }
.card-title { color: #405573; font-size: 13px; font-weight: 700; white-space: nowrap; }
.card-code { overflow: hidden; color: #8592a6; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.change-code-button { flex: 0 0 auto; margin-left: auto; padding: 6px 10px; border: 1px solid #d7e1f0; border-radius: 999px; background: #fff; color: #56708f; font-size: 11px; cursor: pointer; }
.change-code-button:hover { border-color: #b9cbe3; color: var(--blue); }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #e9eff8; }
.card-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.card-item > span { color: #8b9ab0; font-size: 10px; }
.card-item strong { overflow-wrap: anywhere; color: #3f526e; font-size: 11px; line-height: 1.45; font-weight: 650; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 8px; border-radius: 20px; background: #e9f7ef; color: #27845c; font-size: 10px; font-weight: 650; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.expired { background: #fff0ed; color: #dd665a; }
.expired-note { margin: 13px 0 0; padding: 10px 11px; border-radius: 9px; background: #fff0ee; color: #c65e54; font-size: 12px; }
.result-box { margin-top: 16px; padding: 14px; border: 1px solid #dfebff; border-radius: 12px; background: #f6f9ff; color: #4b6385; font-size: 12px; line-height: 1.6; }
.result-box.success { border-color: #d6f1e2; background: #f1faf5; color: #38835e; }
.result-box.error { border-color: #ffded9; background: #fff5f3; color: #c46258; }
.progress-header { display: flex; justify-content: space-between; gap: 12px; color: #3d5577; }
.progress-header strong { font-size: 12px; }
.progress-header span { color: var(--blue); font-weight: 700; }
.progress-track { height: 7px; overflow: hidden; margin: 11px 0 8px; border-radius: 99px; background: #e4ebf7; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #77a7ff, #3478f6); transition: width .3s ease; }
.result-box small { display: block; margin-top: 5px; color: #8491a6; font-size: 10px; }
.download-list { display: grid; gap: 8px; margin-top: 12px; }
.download-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 10px 11px; border: 1px solid #e7edf5; border-radius: 10px; background: #fff; color: #31435e; }
.download-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.download-link { color: var(--blue); font-weight: 700; text-decoration: none; }
.download-copy { padding: 5px 7px; border: 0; border-radius: 6px; background: #f3f7fd; color: #66809f; font-size: 10px; cursor: pointer; }
.modal-backdrop { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: #17243a70; backdrop-filter: blur(3px); }
.modal-backdrop[hidden], .card-info[hidden], .expired-note[hidden], .result-box[hidden] { display: none; }
.modal { width: min(100%, 390px); padding: 27px; border: 1px solid #edf0f5; border-radius: 18px; background: #fff; text-align: center; box-shadow: 0 25px 80px #17243a30; }
.modal-symbol { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: #fff4e4; color: #df9b38; font-size: 20px; font-weight: 700; }
.modal h2 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0; color: #7e899a; font-size: 13px; line-height: 1.65; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions button { min-height: 43px; margin: 0; }
.secondary-button { flex: 1; border: 1px solid #e2e8f1; border-radius: 9px; background: #fff; color: #6f7d91; font-size: 13px; cursor: pointer; }
.modal-primary { flex: 1; }
.page-shell > footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 17px 0 0; color: #a0aaba; font-size: 10px; text-align: center; }
.footer-mark { color: #3ba47a; font-size: 8px; }

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 500px); padding-top: 20px; }
  .brand { margin-bottom: 16px; }
  .panel { padding: 27px 22px 22px; border-radius: 18px; }
  .panel-heading { margin-bottom: 22px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
  .card-state-item { grid-column: 1 / -1; }
}
@media (max-width: 390px) {
  .panel { padding: 23px 17px 19px; }
  .steps { gap: 5px; font-size: 10px; }
  .steps b { width: 14px; }
  .card-info { padding: 13px; }
  .card-code { max-width: 95px; }
  .download-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .download-actions { width: 100%; justify-content: space-between; }
  .secondary-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
