:root {
  --bg: #eef1fe;
  --card: #ffffff;
  --text: #15171c;
  --muted: #7d8497;
  --line: #e4e8f5;
  --brand: #4769e4;
  --brand-dark: #3a5fe2;
  --brand-soft: #edf1ff;
  --success: #18a86b;
  --danger: #e14b5a;
  --warning: #e9a21a;
  --shadow: 0 14px 38px rgba(57, 79, 165, 0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(71, 105, 228, 0.10), transparent 28rem),
    radial-gradient(circle at 88% 92%, rgba(137, 115, 238, 0.10), transparent 26rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--brand);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.page-content {
  min-height: 100vh;
  padding: 0 0 22px;
}

.reset-link {
  position: absolute;
  z-index: 5;
  top: 1px;
  left: 18px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-size: 15px;
  cursor: pointer;
}

.reset-link:hover {
  opacity: .72;
}

.brand-block {
  margin-top: 30px;
  margin-bottom: 48px;
  text-align: center;
}

.brand-icon img {
  display: block;
  width: 85px;
  height: 85px;
  margin: 15px auto 0;
  border-radius: 22px;
}

.help-text {
  display: inline-block;
  margin-top: 13px;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 400;
}

.help-text:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quick-tabs {
  display: flex;
  justify-content: space-between;
  margin: 0 22px 25px;
}

.quick-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 29.3%;
  height: 80px;
  padding: 42px 0 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.quick-tab:hover {
  transform: translateY(-2px);
}

.quick-tab.active {
  box-shadow: 0 6px 22px rgba(71, 105, 228, 0.12);
}

.quick-tab img {
  position: absolute;
  top: -17.5px;
  width: 50px;
  height: 50px;
  border-radius: 15px;
}

.quick-tab span {
  color: #000;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

.quick-tab.active span {
  color: var(--brand-dark);
}

.quick-tab.active::before {
  content: "";
  position: absolute;
  top: -4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px rgba(71, 105, 228, .22);
}

.tab-panel {
  animation: panel-in .22s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-flow {
  margin: 0 20px 27px;
}

.install-selected-button {
  margin-top: 4px;
}

.input-shell {
  position: relative;
  margin-bottom: 22px;
}

.input-shell input,
.more-options textarea {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: 0;
  background: var(--card);
  color: #333;
  font-size: 14px;
  box-shadow: 0 0 0 0 rgba(71, 105, 228, 0);
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none;
}

.input-shell input::placeholder,
.more-options textarea::placeholder {
  color: #a5a9b7;
}

.input-shell input:focus,
.more-options textarea:focus {
  border-color: rgba(71, 105, 228, .55);
  box-shadow: 0 0 0 3px rgba(71, 105, 228, .12);
}

.udid-shell input {
  padding-right: 112px;
}

.inline-action {
  position: absolute;
  top: 1px;
  right: 1px;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.inline-action:hover {
  background: var(--brand-soft);
}

.field-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 2px 12px;
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.sign-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sign-tool {
  display: flex;
  flex: 1 1 47%;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: 50px;
  padding: 5px 10px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  box-shadow: none;
  transition: box-shadow .18s ease, transform .18s ease;
}

.sign-tool:hover {
  transform: translateY(-1px);
}

.sign-tool.selected {
  box-shadow: 0 0 0 3px rgba(71, 105, 228, .20);
}

.tool-main {
  display: flex;
  min-width: 0;
  align-items: center;
  text-align: left;
}

.tool-main > img {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.tool-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin-left: 8px;
  line-height: 1.2;
}

.tool-copy strong {
  overflow: hidden;
  color: #101116;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-check {
  display: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: 4px;
}

.tool-check img {
  display: block;
  width: 20px;
  height: 20px;
}

.sign-tool.selected .tool-check {
  display: block;
}

.upload-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.upload-card {
  display: flex;
  min-height: 62px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed #cfd7ee;
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.upload-card:hover,
.upload-card.dragover,
.upload-card.has-file {
  border-color: var(--brand);
  background: #fbfcff;
  box-shadow: 0 0 0 3px rgba(71, 105, 228, .08);
}

.upload-icon {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.4px;
}

.upload-icon.p12 {
  background: #fff3e0;
  color: #c27600;
}

.upload-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  margin-left: 12px;
  line-height: 1.3;
}

.upload-copy strong {
  font-size: 13px;
  font-weight: 800;
}

.upload-copy em {
  margin-left: 4px;
  color: var(--brand);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.upload-copy em.optional {
  color: var(--muted);
}

.upload-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card.has-file .upload-copy small {
  color: var(--brand-dark);
}

.upload-arrow {
  margin-left: 8px;
  color: #aeb6cd;
  font-size: 24px;
  line-height: 1;
}

.password-shell {
  margin-top: -4px;
}

.more-options {
  margin: 0 0 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .54);
}

.more-options summary {
  padding: 11px 14px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.more-options summary::-webkit-details-marker {
  display: none;
}

.more-options summary::after {
  content: "＋";
  float: right;
  color: var(--muted);
}

.more-options[open] summary::after {
  content: "－";
}

.more-options .compact {
  margin: 0 10px 10px;
}

.more-options textarea {
  display: block;
  width: calc(100% - 20px);
  height: auto;
  min-height: 82px;
  margin: 0 10px 12px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}

.primary-button,
.secondary-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 18px rgba(71, 105, 228, .22);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(71, 105, 228, .28);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
}

.secondary-button {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 9px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.is-loading .button-spinner {
  display: inline-block;
}

.is-loading .button-text {
  opacity: .86;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice-line {
  display: flex;
  align-items: flex-start;
  margin-top: 18px;
}

.notice-line img {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 4px 0 0 1px;
}

.notice-line p {
  margin: 0 0 0 7px;
  color: #333;
  font-size: 13px;
  line-height: 1.6;
}

.success-card,
.section-card {
  margin: 0 20px 27px;
  padding: 24px 20px;
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.success-card {
  text-align: center;
}

.success-mark {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(24, 168, 107, .12);
  color: var(--success);
  font-size: 25px;
  font-weight: 800;
}

.success-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.success-card p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.success-card > strong {
  display: block;
  color: var(--brand-dark);
  font-size: 18px;
  letter-spacing: .4px;
}

.success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--brand);
}

.section-heading {
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.35;
}

.section-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.query-result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: #f7f8fd;
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-top strong {
  color: var(--brand-dark);
  font-size: 17px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf0f8;
  color: #5c6478;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pending { background: #fff5dd; color: #9c6500; }
.status-processing { background: #e9efff; color: var(--brand-dark); }
.status-completed { background: #e5f8ef; color: #0f8453; }
.status-rejected,
.status-cancelled { background: #ffe8eb; color: #bc2f42; }
.status-expired { background: #eef0f4; color: #6f7688; }

.result-meta {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #555d70;
  font-size: 12px;
}

.result-meta span {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.result-message {
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #333;
  font-size: 13px;
}

.guide-card {
  padding-bottom: 22px;
}

.guide-list {
  display: grid;
  gap: 18px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: flex;
  gap: 13px;
}

.guide-list li > span {
  display: flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.guide-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.guide-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.guide-tip {
  padding: 14px 15px;
  border-radius: 10px;
  background: #fff7e8;
  color: #7b5711;
}

.guide-tip strong {
  font-size: 13px;
}

.guide-tip p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.65;
}

.guide-help-link {
  margin: 18px 0 0;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 8px 20px 20px;
  color: #a0a5b5;
  font-size: 11px;
}

.site-footer a {
  color: #a0a5b5;
}

.site-footer a:hover {
  color: var(--brand);
}

.modal {
  width: min(92vw, 500px);
  max-height: min(84vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(28, 38, 85, .28);
}

.modal::backdrop {
  background: rgba(19, 25, 49, .56);
  backdrop-filter: blur(3px);
}

.modal-inner {
  display: flex;
  max-height: min(84vh, 720px);
  flex-direction: column;
  margin: 0;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-kicker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.icon-button {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f3f9;
  color: #697086;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  overflow-y: auto;
  padding: 18px 22px;
}

.modal-body section + section {
  margin-top: 18px;
}

.modal-body strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.modal-body p {
  margin: 0;
  color: #626a7e;
  font-size: 13px;
  line-height: 1.75;
}

.modal-actions {
  padding: 14px 22px 22px;
}

.process-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 27, 54, .58);
  backdrop-filter: blur(3px);
}

.process-card {
  width: min(92vw, 330px);
  padding: 28px 24px 22px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

.process-ring {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid #e9edfa;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.process-card strong {
  font-size: 17px;
}

.process-card p {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .22s ease;
}

.process-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #202435;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .22);
  animation: toast-in .2s ease both;
}

.toast.error {
  background: #a92f40;
}

.toast.success {
  background: #127b52;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


.card-verify-shell input {
  padding-right: 112px;
}

.inline-action.verify-card {
  min-width: 88px;
  padding: 0 13px;
}

.tool-unlock {
  margin: 0 0 22px;
  padding: 15px;
  border: 1px solid rgba(71, 105, 228, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.tool-unlock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.unlock-dot {
  display: flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(24, 168, 107, .12);
  color: var(--success);
  font-size: 16px;
  font-weight: 900;
}

.tool-unlock-head div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.tool-unlock-head strong {
  font-size: 14px;
}

.tool-unlock-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.app-download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-download-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border-radius: 11px;
  background: #fff;
}

.app-download-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.app-download-name img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.app-download-name span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.app-download-name strong {
  font-size: 13px;
}

.app-download-name small {
  color: var(--muted);
  font-size: 10px;
}

.app-download-button,
.app-import-button {
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.app-download-button {
  background: var(--brand);
  color: #fff;
}

.app-import-button {
  background: #e8f8f0;
  color: #0f8453;
}

.app-download-button:disabled,
.app-import-button:disabled {
  background: #eef0f6;
  color: #a2a8b8;
  cursor: not-allowed;
}

.certificate-install-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.certificate-install-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.4;
}

.certificate-install-row strong {
  font-size: 12px;
}

.certificate-install-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-install-button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 7px;
  background: #fff3e0;
  color: #a96900;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 370px) {
  .app-download-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 680px) {
  body {
    padding: 26px 0;
  }

  .app-shell {
    min-height: calc(100vh - 52px);
    overflow: hidden;
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(57, 79, 165, .14);
  }

  .page-content {
    min-height: calc(100vh - 52px);
    padding-top: 1px;
  }
}

@media (max-width: 370px) {
  .quick-tabs {
    margin-right: 16px;
    margin-left: 16px;
  }

  .quick-tab {
    height: 76px;
  }

  .quick-tab span {
    font-size: 14px;
  }

  .home-flow {
    margin-right: 16px;
    margin-left: 16px;
  }

  .sign-tools {
    gap: 8px;
  }

  .sign-tool {
    padding-right: 7px;
    padding-left: 7px;
  }

  .tool-copy small {
    display: none;
  }

  .success-card,
  .section-card {
    margin-right: 16px;
    margin-left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
