:root {
  --bg: #06080c;
  --surface: #0c1119;
  --surface-2: #111823;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #eef2f8;
  --muted: #7f8b9d;
  --muted-2: #5d6879;
  --lime: #c9f65a;
  --up: #34e5a2;
  --flat: #f4c566;
  --blue: #7aa7ff;
  --down: #ff5f7e;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 560px at 80% -10%, rgba(201, 246, 90, 0.08), transparent 62%),
    radial-gradient(700px 460px at 6% 12%, rgba(70, 111, 255, 0.07), transparent 62%),
    linear-gradient(180deg, #070a10 0%, #06080c 60%, #05070a 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(201, 246, 90, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(201, 246, 90, 0.35);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 246, 90, 0.24), transparent 65%),
    #0d1310;
  color: var(--lime);
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.brand-name span {
  color: var(--lime);
}

.brand-cn {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.34em;
}

.portal-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
}

.portal-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-note {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.auth-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-language {
  height: 30px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #0e141d;
  color: var(--muted);
  font-size: 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%237f8b9d' stroke-width='1.3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color-scheme: dark;
}

.auth-language option,
.security-row select option {
  background: #0e141d;
  color: #dbe4ef;
}

.auth-language option:checked,
.security-row select option:checked {
  background: #213225;
  color: #c9f65a;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 230px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-soft, #c6cfdd);
  font-size: 10px;
}

.account-chip::before {
  content: "@";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(201, 246, 90, 0.1);
  color: var(--lime);
  font-family: var(--mono);
}

.account-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-badge {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid rgba(244, 197, 102, 0.28);
  border-radius: 5px;
  background: rgba(244, 197, 102, 0.08);
  color: var(--flat);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.admin-badge[hidden] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.16s ease, background 0.16s ease, filter 0.16s ease;
}

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

.btn-primary {
  background: linear-gradient(180deg, #d8ff79, var(--lime) 45%, #aede45);
  color: #10160a;
  box-shadow: 0 14px 34px -18px rgba(201, 246, 90, 0.6);
}

.btn-primary:disabled {
  cursor: wait;
  filter: grayscale(0.35) brightness(0.75);
  transform: none;
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft, #c6cfdd);
}

.btn-ghost:hover {
  border-color: rgba(201, 246, 90, 0.35);
  color: var(--lime);
}

.admin-task-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  background: #ff3b5c;
  box-shadow:
    0 0 0 2px rgba(7, 10, 16, 0.92),
    0 0 14px rgba(255, 59, 92, 0.32);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.admin-task-badge[hidden] {
  display: none !important;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 10px;
}

.eyebrow {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.grad-text {
  background: linear-gradient(100deg, #f4ffd6, var(--lime) 48%, #8ecf42);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 70px;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: 36px 0 64px;
}

.auth-hero h1 {
  margin: 16px 0 0;
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-hero > p {
  max-width: 480px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.auth-features {
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft, #c6cfdd);
  font-size: 11px;
}

.auth-features li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 229, 162, 0.1);
  color: var(--up);
  font-size: 9px;
}

.auth-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(450px 220px at 50% 0%, rgba(201, 246, 90, 0.06), transparent 65%),
    linear-gradient(165deg, #0e151f, #090d13);
  box-shadow: 0 40px 100px -50px rgba(0, 0, 0, 0.95);
}

.auth-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.auth-tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.auth-body {
  margin-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.field label {
  color: var(--muted);
  font-size: 10px;
}

.field input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus {
  border-color: rgba(201, 246, 90, 0.45);
  box-shadow: 0 0 0 3px rgba(201, 246, 90, 0.05);
}

.auth-form .btn {
  width: 100%;
  margin-top: 18px;
}

.security-section {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-label {
  color: var(--muted);
  font-size: 10px;
}

.security-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 6px;
}

.security-row select,
.security-row input {
  min-width: 0;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft, #c6cfdd);
  font-size: 10px;
}

.security-row select:focus,
.security-row input:focus {
  border-color: rgba(201, 246, 90, 0.4);
}

html[dir="rtl"] .auth-form input[type="email"],
html[dir="rtl"] .auth-form input[type="password"],
html[dir="rtl"] .auth-form input[inputmode="numeric"] {
  direction: ltr;
  text-align: left;
}

.security-hint {
  margin: 0;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.5;
}

.password-rule {
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.55;
}

.password-rule.invalid {
  color: #ff8ca6;
}

.password-rule.valid {
  color: #75e7b6;
}

.invite-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid rgba(201, 246, 90, 0.24);
  border-radius: 18px;
  background: #0d141b;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
}

.invite-dialog::backdrop {
  background: rgba(4, 8, 12, 0.78);
  backdrop-filter: blur(5px);
}

.invite-dialog h2 {
  margin: 0;
  font-size: 22px;
}

.invite-dialog p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.invite-dialog input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.18em;
}

.invite-dialog input:focus {
  border-color: rgba(201, 246, 90, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 246, 90, 0.08);
}

.invite-actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.invite-actions .btn {
  flex: 1;
}

.recovery-account {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 10px;
  word-break: break-all;
}

.field input.invalid {
  border-color: rgba(255, 95, 126, 0.6);
  background: rgba(255, 95, 126, 0.04);
}

.form-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.form-row a,
.switch-line a {
  color: var(--muted);
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-row a:hover,
.switch-line a:hover {
  color: var(--lime);
}

.switch-line {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.text-btn {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover {
  color: var(--lime);
}

.form-msg {
  min-height: 18px;
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.5;
}

.form-msg.error {
  color: #ff9caf;
}

.form-msg.success {
  color: #9fe7c9;
}

.demo-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 10px 12px;
  border: 1px dashed rgba(201, 246, 90, 0.3);
  border-radius: 9px;
  background: rgba(201, 246, 90, 0.05);
}

.demo-code span {
  color: var(--muted);
  font-size: 9px;
}

.demo-code strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.auth-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}

.logged-in {
  padding: 12px 0 2px;
  text-align: center;
}

.logged-in h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.logged-in p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 10px;
}

.recovery-steps {
  display: grid;
  gap: 9px;
}

.recovery-mail {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.recovery-mail strong {
  color: var(--text-soft, #c6cfdd);
  font-family: var(--mono);
  font-weight: 500;
  word-break: break-all;
}

.token-box {
  margin-top: 0;
}

.token-box strong {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: right;
  word-break: break-all;
}

.recovery-timer {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}

.recovery-timer.expired {
  color: var(--down);
}

.success-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border: 1px solid rgba(52, 229, 162, 0.4);
  border-radius: 50%;
  background: rgba(52, 229, 162, 0.08);
  color: var(--up);
  font-size: 22px;
}

.portal-footer {
  position: relative;
  z-index: 1;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
  font-size: 9px;
  text-align: center;
}

.portal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.portal-head {
  margin-bottom: 28px;
}

.portal-head h1 {
  margin: 10px 0 6px;
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.portal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-head p strong {
  color: var(--text-soft, #c6cfdd);
  font-family: var(--mono);
  font-weight: 500;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(360px 180px at 100% 0%, rgba(201, 246, 90, 0.06), transparent 65%),
    linear-gradient(160deg, #0f1620, #090d13);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 246, 90, 0.3);
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--lime);
}

.entry-icon svg {
  width: 22px;
  height: 22px;
}

.entry-card h2 {
  margin: 20px 0 6px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.market-invite-hint {
  display: inline-flex;
  align-self: flex-start;
  margin: 1px 0 14px;
  padding: 4px 9px;
  border: 1px solid rgba(244, 197, 102, 0.32);
  border-radius: 6px;
  background: rgba(244, 197, 102, 0.12);
  color: #f4cf82;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted-2);
  font-size: 10px;
}

.entry-meta strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
}

.entry-arrow {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 16px;
}

.portal-note {
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.7;
}

.sub-shell {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.sub-shell h1 {
  margin: 10px 0 6px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sub-shell > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.sub-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(450px 220px at 50% 0%, rgba(201, 246, 90, 0.05), transparent 65%),
    linear-gradient(165deg, #0e151f, #090d13);
  box-shadow: 0 40px 100px -50px rgba(0, 0, 0, 0.95);
}

.code-form {
  display: flex;
  gap: 10px;
}

.code-input {
  flex: 1;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.28em;
  text-align: center;
}

.code-input:focus {
  border-color: rgba(201, 246, 90, 0.45);
}

.code-input::placeholder {
  color: var(--muted-2);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.code-form .btn {
  height: 52px;
  flex-shrink: 0;
}

.demo-hint {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10px;
}

.demo-hint summary {
  cursor: pointer;
  color: var(--muted);
}

.demo-hint span {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(201, 246, 90, 0.08);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.unlock-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.url-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.url-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.url-head span {
  color: var(--text-soft, #c6cfdd);
  font-size: 17px;
  font-weight: 600;
}

.copy-btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.copy-btn:hover {
  color: var(--lime);
  border-color: rgba(201, 246, 90, 0.35);
}

.url-card code {
  display: block;
  margin-top: 12px;
  color: #aeb9c9;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-all;
}

.sub-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.sub-shell .form-msg {
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 520px;
    padding-top: 16px;
  }

  .auth-hero h1 {
    font-size: 42px;
  }

  .auth-features {
    display: none;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-top,
  .auth-shell,
  .portal-main,
  .sub-shell {
    width: calc(100% - 32px);
  }

  .portal-top {
    height: auto;
    min-height: 64px;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-cn,
  .top-note {
    display: none;
  }

  .auth-language {
    max-width: 112px;
    font-size: 9px;
  }

  .brand-name {
    font-size: 13px;
  }

  .auth-hero h1,
  .portal-head h1,
  .sub-shell h1 {
    font-size: 36px;
  }

  .auth-card,
  .sub-card {
    padding: 22px;
    border-radius: 18px;
  }

  .sub-shell > p,
  .sub-note,
  .sub-shell .form-msg {
    font-size: 14px;
  }

  .url-card {
    padding: 18px;
  }

  .url-head span {
    font-size: 16px;
  }

  .url-card code {
    font-size: 13px;
  }

  .entry-card {
    min-height: 220px;
    padding: 20px;
  }

  .code-form {
    flex-direction: column;
  }

  .security-row {
    grid-template-columns: 1fr;
  }

  .code-form .btn {
    width: 100%;
  }

  .account-chip {
    max-width: 120px;
  }

  .portal-top-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .account-chip span {
    font-size: 9px;
  }
}
