:root {
  --app-ink: #17202f;
  --app-muted: #758096;
  --app-line: #e8ebf2;
  --app-soft: #f5f7fb;
  --app-brand: #4766eb;
  --app-brand-dark: #3654cf;
  --app-shadow: 0 18px 54px rgba(38, 51, 83, 0.1);
  color: var(--app-ink);
  background: #f7f8fc;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 5% -10%, rgba(111, 135, 255, 0.15), transparent 25rem),
    radial-gradient(circle at 100% 5%, rgba(86, 203, 192, 0.1), transparent 22rem),
    #f7f8fc;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--app-muted);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app-header {
  display: flex;
  width: min(1440px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--app-ink);
  text-decoration: none;
}

.app-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #5a79fa, #405edc);
  box-shadow: 0 8px 16px rgba(65, 92, 217, 0.24);
}

.app-brand-mark svg {
  width: 22px;
  height: 22px;
}

.app-brand-copy {
  display: grid;
  gap: 2px;
}

.app-brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.app-brand-copy small {
  color: var(--app-muted);
  font-size: 11px;
}

.app-header-actions,
.app-view-switcher,
.app-avatar-button {
  display: flex;
  align-items: center;
}

.app-header-actions {
  gap: 18px;
}

.app-view-switcher {
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.app-view-button {
  padding: 7px 11px;
  border: 0;
  border-radius: 7px;
  color: var(--app-muted);
  background: transparent;
  font-size: 13px;
  transition: 0.2s ease;
}

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

.app-view-button.is-active {
  color: #2949ca;
  background: #edf1ff;
  font-weight: 700;
}

.app-avatar-button {
  max-width: 210px;
  gap: 8px;
  padding: 4px 7px 4px 4px;
  border: 1px solid transparent;
  border-radius: 24px;
  color: var(--app-ink);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.app-avatar-button:hover {
  border-color: var(--app-line);
  background: #fff;
}

.app-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #7190ff, #4c64d8);
  font-weight: 700;
  font-size: 14px;
}

.app-avatar svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.app-avatar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.app-main {
  width: min(1440px, calc(100% - 48px));
  flex: 1;
  margin: 0 auto;
  padding: 33px 0 45px;
}

.app-page-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.app-eyebrow {
  margin: 0 0 7px;
  color: var(--app-brand);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.app-page-heading h1 {
  margin: 0;
  color: #15203a;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.app-page-heading p:not(.app-eyebrow) {
  margin: 8px 0 0;
  color: var(--app-muted);
  font-size: 14px;
}

.app-primary-action,
.app-submit-button,
.app-secondary-button,
.app-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.app-primary-action,
.app-submit-button {
  color: #fff;
  background: var(--app-brand);
  box-shadow: 0 8px 18px rgba(67, 99, 232, 0.2);
}

.app-primary-action {
  padding: 11px 15px;
  white-space: nowrap;
  font-size: 13px;
}

.app-primary-action:hover,
.app-submit-button:hover {
  transform: translateY(-1px);
  background: var(--app-brand-dark);
  box-shadow: 0 10px 22px rgba(67, 99, 232, 0.26);
}

.app-primary-action svg,
.app-submit-button svg,
.app-secondary-button svg {
  width: 17px;
  height: 17px;
}

.app-module-stage {
  min-height: 360px;
}

.app-module-placeholder {
  display: grid;
  min-height: 360px;
  place-content: center;
  justify-items: center;
  gap: 13px;
  border: 1px dashed #d9dfec;
  border-radius: 18px;
  color: var(--app-muted);
  background: rgba(255, 255, 255, 0.62);
}

.app-module-placeholder p,
.app-module-placeholder strong {
  margin: 0;
}

.app-module-placeholder--error strong {
  color: #b33e51;
}

.app-placeholder-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #dde5ff;
  border-top-color: var(--app-brand);
  border-radius: 50%;
  animation: app-spin 0.8s linear infinite;
}

.app-footer {
  display: flex;
  width: min(1440px, calc(100% - 48px));
  margin: auto auto 24px;
  justify-content: center;
  color: #a1a9b8;
  font-size: 12px;
}

.app-footer-dot {
  padding: 0 8px;
}

.app-notice {
  display: flex;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 10px 13px;
  align-items: center;
  gap: 9px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 13px;
}

.app-notice p {
  flex: 1;
  margin: 0;
}

.app-notice svg {
  width: 17px;
  height: 17px;
}

.app-notice button {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
}

.app-notice--success {
  border-color: #b9ebdb;
  color: #197258;
  background: #edfbf6;
}

.app-notice--warning {
  border-color: #f3d9a6;
  color: #8a5c12;
  background: #fff9e9;
}

.app-modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(19, 29, 50, 0.34);
  backdrop-filter: blur(6px);
  animation: app-fade-in 0.18s ease;
}

.app-modal {
  position: relative;
  width: min(100%, 430px);
  padding: 31px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(16, 26, 53, 0.22);
  animation: app-modal-in 0.2s ease;
}

.app-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #8690a3;
  background: transparent;
}

.app-modal-close:hover {
  color: var(--app-ink);
  background: var(--app-soft);
}

.app-modal-close svg {
  width: 17px;
  height: 17px;
}

.app-modal-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 13px;
  color: #4969e9;
  background: #edf1ff;
}

.app-modal-icon svg {
  width: 23px;
  height: 23px;
}

.app-modal h2 {
  margin: 0;
  color: #17213a;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.app-modal-description {
  margin: 8px 0 21px;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.65;
}

.app-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 19px;
  padding: 3px;
  border-radius: 10px;
  background: var(--app-soft);
}

.app-auth-tabs button {
  padding: 8px;
  border: 0;
  border-radius: 7px;
  color: var(--app-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.app-auth-tabs button.is-active {
  color: #2949ca;
  background: #fff;
  box-shadow: 0 2px 7px rgba(36, 51, 91, 0.1);
}

.app-auth-form {
  display: grid;
  gap: 15px;
}

.app-auth-form label,
.app-redeem-form > label {
  display: grid;
  gap: 7px;
  color: #485267;
  font-size: 13px;
  font-weight: 700;
}

.app-auth-form input,
.app-redeem-input-row input {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  outline: none;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  color: var(--app-ink);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-auth-form input::placeholder,
.app-redeem-input-row input::placeholder {
  color: #b2bac7;
}

.app-auth-form input:focus,
.app-redeem-input-row input:focus {
  border-color: #7691fa;
  box-shadow: 0 0 0 3px rgba(85, 112, 239, 0.12);
}

.app-form-error {
  margin: -3px 0 0;
  color: #c34859;
  font-size: 12px;
}

.app-submit-button {
  min-height: 43px;
  padding: 0 16px;
  font-size: 14px;
}

.app-account-modal {
  padding-top: 35px;
}

.app-account-identity {
  display: flex;
  margin-bottom: 23px;
  align-items: center;
  gap: 13px;
}

.app-avatar--large {
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.app-account-identity .app-eyebrow {
  margin-bottom: 4px;
}

.app-account-identity h2 {
  font-size: 19px;
}

.app-role-chip {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 99px;
  color: #5570df;
  background: #edf1ff;
  font-size: 11px;
}

.app-account-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #e8ebf2;
  border-radius: 12px;
  background: #fbfcff;
}

.app-account-info div {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 13px;
}

.app-account-info div + div {
  border-left: 1px solid #e8ebf2;
}

.app-account-info span {
  color: var(--app-muted);
  font-size: 11px;
}

.app-account-info strong {
  overflow: hidden;
  color: #2a354c;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.app-redeem-form {
  display: grid;
  gap: 8px;
}

.app-redeem-input-row {
  display: flex;
  gap: 8px;
}

.app-redeem-input-row .app-submit-button {
  flex: 0 0 auto;
  min-width: 72px;
}

.app-secondary-button {
  width: 100%;
  min-height: 40px;
  margin-top: 19px;
  border: 1px solid #d9e0f6;
  color: #425dcc;
  background: #f7f8ff;
  font-size: 13px;
}

.app-secondary-button:hover {
  border-color: #c7d1fb;
  background: #eef1ff;
}

.app-text-button {
  width: 100%;
  min-height: 32px;
  margin-top: 9px;
  color: #8a94a8;
  background: transparent;
  font-size: 12px;
}

.app-danger-button:hover {
  color: #c24857;
}

.app-toast-region {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 25px;
  pointer-events: none;
}

.app-toast {
  display: flex;
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce2ee;
  border-radius: 11px;
  color: #334057;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 43, 73, 0.16);
  font-size: 13px;
  animation: app-toast-in 0.22s ease;
}

.app-toast--success svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #20a17c;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

@keyframes app-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes app-modal-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
}

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

@media (max-width: 720px) {
  .app-header,
  .app-main,
  .app-notice,
  .app-footer {
    width: min(100% - 28px, 1440px);
  }

  .app-header {
    min-height: 67px;
    gap: 10px;
  }

  .app-brand-copy small,
  .app-avatar-label {
    display: none;
  }

  .app-header-actions {
    gap: 8px;
  }

  .app-view-switcher {
    padding: 2px;
  }

  .app-view-button {
    padding: 7px 8px;
    font-size: 12px;
  }

  .app-avatar-button {
    padding: 2px;
  }

  .app-main {
    padding-top: 24px;
  }

  .app-page-heading {
    margin-bottom: 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .app-primary-action {
    width: 100%;
  }

  .app-footer {
    margin-bottom: 16px;
  }
}

@media (max-width: 420px) {
  .app-brand-copy strong {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-view-button {
    padding-right: 6px;
    padding-left: 6px;
  }

  .app-modal-backdrop {
    padding: 13px;
  }

  .app-modal {
    padding: 26px 21px 21px;
    border-radius: 17px;
  }
}

/* 2026 紧凑工具型界面 */
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(53, 197, 132, 0.09), transparent 24rem),
    #f4f6f8;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  width: 100%;
  min-height: 62px;
  padding: 0 max(18px, calc((100% - 1320px) / 2));
  border-bottom: 1px solid rgba(226, 230, 235, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 16px rgba(28, 39, 56, 0.04);
  backdrop-filter: blur(14px);
}

.app-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #18bd70, #0a9b58);
  box-shadow: 0 7px 16px rgba(11, 158, 88, 0.2);
}

.app-brand-mark svg {
  width: 20px;
  height: 20px;
}

.app-brand-copy strong {
  font-size: 15px;
}

.app-brand-copy small {
  font-size: 10px;
}

.app-header-actions {
  gap: 12px;
}

.app-view-switcher {
  background: #f5f7f8;
}

.app-view-button.is-active {
  color: #087746;
  background: #e7f8ef;
}

.app-avatar-button {
  min-height: 40px;
  border-color: #e7eaee;
  background: #fff;
}

.app-avatar {
  background: linear-gradient(145deg, #23c77b, #0b9455);
}

.app-main {
  width: min(1280px, calc(100% - 32px));
  padding: 18px 0 30px;
}

.app-main--admin {
  width: 100%;
  max-width: none;
  padding: 0;
}

.app-page-heading {
  margin-bottom: 13px;
  padding: 3px 2px;
  align-items: center;
}

.app-page-heading h1 {
  font-size: clamp(23px, 2.4vw, 31px);
}

.app-page-heading p:not(.app-eyebrow) {
  margin-top: 5px;
  font-size: 13px;
}

.app-eyebrow {
  margin-bottom: 4px;
  color: #079258;
  font-size: 10px;
}

.app-page-heading-side {
  display: flex;
  align-items: center;
  gap: 15px;
}

.app-page-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6e7888;
  font-size: 12px;
  white-space: nowrap;
}

.app-page-steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.app-page-steps b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #087746;
  background: #ddf7ea;
  font-size: 10px;
}

.app-page-steps i {
  width: 18px;
  height: 1px;
  background: #d9dee4;
}

.app-primary-action,
.app-submit-button {
  background: #08ae63;
  box-shadow: 0 7px 17px rgba(7, 159, 89, 0.18);
}

.app-primary-action:hover,
.app-submit-button:hover {
  background: #078c52;
  box-shadow: 0 9px 20px rgba(7, 145, 82, 0.24);
}

.app-footer {
  margin-bottom: 16px;
}

@media (max-width: 820px) {
  .app-page-heading-side {
    align-items: flex-end;
    flex-direction: column;
  }

  .app-page-steps {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-header {
    width: 100%;
    min-height: 58px;
    padding: 0 12px;
  }

  .app-main,
  .app-notice,
  .app-footer {
    width: min(100% - 20px, 1280px);
  }

  .app-main--admin {
    width: 100%;
  }

  .app-main {
    padding-top: 13px;
  }

  .app-page-heading {
    margin-bottom: 10px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .app-page-heading h1 {
    font-size: 21px;
  }

  .app-page-heading p:not(.app-eyebrow),
  .app-eyebrow {
    display: none;
  }

  .app-page-heading-side {
    margin-left: auto;
  }

  .app-primary-action {
    width: auto;
    padding: 9px 11px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .app-brand-copy strong {
    max-width: 122px;
    font-size: 13px;
  }

  .app-view-switcher {
    display: none;
  }

  .app-avatar-button {
    min-height: 36px;
    padding: 2px;
    border: 0;
  }

  .app-avatar {
    width: 34px;
    height: 34px;
  }

  .app-page-heading h1 {
    font-size: 19px;
  }
}

/* 用户端紧凑单屏操作台 */
.app-main:not(.app-main--admin) {
  width: min(1080px, calc(100% - 24px));
  padding-top: 10px;
}

.app-main:not(.app-main--admin) .app-page-heading {
  margin-bottom: 8px;
  padding-block: 0;
}

.app-main:not(.app-main--admin) .app-page-heading h1 {
  font-size: clamp(22px, 2vw, 27px);
}

.app-main:not(.app-main--admin) .app-page-heading p:not(.app-eyebrow) {
  margin-top: 3px;
  font-size: 12px;
}

@media (max-width: 720px) {
  .app-main:not(.app-main--admin) {
    width: min(100% - 16px, 1080px);
    padding-top: 8px;
  }

  .app-main:not(.app-main--admin) .app-page-heading {
    margin-bottom: 7px;
  }
}
