:root {
  --bg: #07080c;
  --bg-soft: #0b0d13;
  --panel: rgba(16, 18, 27, .88);
  --panel-strong: #121520;
  --line: rgba(222, 228, 255, .1);
  --line-strong: rgba(222, 228, 255, .2);
  --text: #f3f5ff;
  --muted: #9299ad;
  --cyan: #67e8f9;
  --cyan-deep: #22b8cf;
  --violet: #a78bfa;
  --violet-deep: #7c5ce0;
  --amber: #f5c76d;
  --red: #ff858f;
  --green: #6ee7b7;
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; color-scheme: dark; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 7% 5%, rgba(124, 92, 224, .16), transparent 31rem),
    radial-gradient(circle at 92% 42%, rgba(34, 184, 207, .1), transparent 32rem),
    linear-gradient(180deg, #090a10 0%, #07080c 58%, #08090d 100%);
}

button, input, textarea { font: inherit; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(167, 139, 250, .42);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #2a2145, #171b2a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 30px rgba(76, 54, 148, .24);
  font-weight: 900;
}
.brand strong { display: block; font-size: 1.04rem; letter-spacing: .025em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .59rem; letter-spacing: .17em; }

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 14, 21, .76);
  font-size: .78rem;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #646b7c; }
.system-pill[data-tone="ready"] .pulse-dot { background: var(--green); box-shadow: 0 0 14px rgba(110, 231, 183, .7); }
.system-pill[data-tone="warn"] .pulse-dot { background: var(--amber); box-shadow: 0 0 14px rgba(245, 199, 109, .65); }
.system-pill[data-tone="stop"] .pulse-dot { background: var(--red); box-shadow: 0 0 14px rgba(255, 133, 143, .65); }

.hero { max-width: 760px; padding: 52px 0 34px; }
.eyebrow { margin: 0 0 13px; color: var(--cyan); font-size: .66rem; font-weight: 800; letter-spacing: .19em; }
.hero h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 4.1rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 760; }
.hero h1 span {
  color: transparent;
  background: linear-gradient(95deg, var(--violet), #e0d8ff 48%, var(--cyan));
  background-clip: text;
  -webkit-background-clip: text;
}
.hero > p:last-child { max-width: 640px; margin: 18px 0 0; color: var(--muted); line-height: 1.7; font-size: .9rem; }

.account-bar {
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(13, 15, 23, .8);
  box-shadow: var(--shadow);
}
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.usage-box {
  min-width: 0;
  padding: 13px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 12, .5);
}
.usage-box span, .usage-box small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.usage-box span { color: var(--muted); font-size: .66rem; }
.usage-box strong { display: block; margin: 4px 0 2px; color: var(--cyan); font-size: 1.85rem; line-height: 1; letter-spacing: -.055em; }
.usage-box small { color: #666e82; font-size: .58rem; }
.usage-combo strong { color: #c8b8ff; }
.usage-payment strong { color: #8ceeff; }
.redeem-form { min-width: 0; }
label { display: block; margin-bottom: 8px; color: #c7cbda; font-size: .72rem; font-weight: 700; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }

input, textarea {
  width: 100%;
  border: 1px solid rgba(213, 220, 255, .13);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(5, 7, 12, .7);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input { min-height: 48px; padding: 0 14px; }
textarea { min-height: 130px; padding: 14px; resize: vertical; line-height: 1.55; word-break: break-all; }
input:focus, textarea:focus { border-color: rgba(103, 232, 249, .48); box-shadow: 0 0 0 4px rgba(103, 232, 249, .055); background: #080b12; }
input::placeholder, textarea::placeholder { color: #50576a; }

.button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 780;
  transition: transform .14s ease, opacity .14s ease, box-shadow .14s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .36; cursor: not-allowed; }
.button-quiet { color: #dbe0ef; border: 1px solid var(--line-strong); background: #171a24; }
.button-primary { color: #100b1f; background: linear-gradient(135deg, #c0adff, #8d70ef); box-shadow: 0 10px 28px rgba(124, 92, 224, .22); }
.button-secondary { color: #06191c; background: linear-gradient(135deg, #8cf1ff, #49ccdf); box-shadow: 0 10px 28px rgba(34, 184, 207, .18); }

.form-result { min-height: 18px; margin: 9px 0 -3px; color: var(--muted); font-size: .75rem; }
.form-result[data-tone="success"] { color: var(--green); }
.form-result[data-tone="error"] { color: var(--red); }
.latest-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 13px; }
.latest-link > span { margin-right: 2px; color: var(--muted); font-size: .66rem; }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid rgba(245, 199, 109, .22);
  border-radius: 13px;
  color: #ead29b;
  background: rgba(67, 51, 23, .26);
}
.notice-icon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .68rem; font-weight: 800; }
.notice p { margin: 0; font-size: .82rem; line-height: 1.55; }

.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.service-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
}
.service-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; opacity: .75; }
.service-extract { border-color: rgba(167, 139, 250, .2); }
.service-extract::before { background: linear-gradient(90deg, transparent, var(--violet), transparent); }
.service-payment { border-color: rgba(103, 232, 249, .18); }
.service-payment::before { background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.service-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.service-index { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-size: .68rem; font-weight: 850; }
.service-route { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .57rem; font-weight: 800; letter-spacing: .12em; }
.service-extract .service-route { color: #cbbcff; border-color: rgba(167,139,250,.22); background: rgba(124,92,224,.08); }
.service-payment .service-route { color: #9decf7; border-color: rgba(103,232,249,.2); background: rgba(34,184,207,.07); }
.service-card h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.025em; }
.service-copy { min-height: 50px; margin: 9px 0 16px; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.service-warning {
  margin: 0 0 18px;
  padding: 12px 13px;
  border: 1px solid rgba(245, 199, 109, .2);
  border-radius: 12px;
  background: rgba(80, 58, 20, .18);
}
.service-warning strong { display: block; color: #f2d594; font-size: .72rem; }
.service-warning p { margin: 5px 0 0; color: #b7a47a; font-size: .68rem; line-height: 1.55; }
.service-warning-payment { border-color: rgba(255, 133, 143, .18); background: rgba(78, 28, 35, .16); }
.service-warning-payment strong { color: #ffabb2; }
.service-warning-payment p { color: #b88f94; }

.mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.mode-picker legend { margin-bottom: 8px; color: #c7cbda; font-size: .72rem; font-weight: 700; }
.mode-picker label { position: relative; margin: 0; cursor: pointer; }
.mode-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.mode-picker label > span {
  display: block;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(5, 7, 12, .56);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.mode-picker label > span strong, .mode-picker label > span small { display: block; }
.mode-picker label > span strong { color: #d8dbea; font-size: .72rem; }
.mode-picker label > span small { margin-top: 4px; color: #6f7689; font-size: .61rem; line-height: 1.35; }
.mode-picker input:checked + span { border-color: rgba(167, 139, 250, .5); background: rgba(124, 92, 224, .12); box-shadow: 0 0 0 3px rgba(124, 92, 224, .055); }
.mode-picker input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.form-footer > span { color: #6f7689; font-size: .67rem; }

.tasks-section { margin: 48px 0 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 1.28rem; }
.section-heading .eyebrow { margin-bottom: 7px; }
.refresh-button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--muted); background: transparent; cursor: pointer; font-size: .71rem; }
.refresh-button:hover { color: var(--cyan); border-color: rgba(103,232,249,.25); }
.empty-state { min-height: 132px; display: grid; place-content: center; justify-items: center; gap: 7px; border: 1px dashed var(--line); border-radius: 17px; color: #555c6d; }
.empty-state span { color: var(--violet); font-size: 1.25rem; }
.empty-state p { margin: 0; font-size: .76rem; }
.task-list { display: grid; gap: 9px; }
.task-item {
  display: grid;
  grid-template-columns: 1.2fr 1fr 150px;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 15, 22, .74);
}
.task-title-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.task-title-line strong { overflow: hidden; text-overflow: ellipsis; font-size: .82rem; letter-spacing: .02em; }
.service-tag { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; color: #d4c9ff; background: rgba(124,92,224,.13); font-size: .61rem; font-weight: 800; }
.task-code small, .task-progress small { color: var(--muted); font-size: .65rem; }
.task-code > small { display: block; margin-top: 6px; }
.task-code > .task-email { color: #c7d2fe; overflow-wrap: anywhere; }
.task-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.task-action {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(167, 139, 250, .24);
  border-radius: 8px;
  color: #d6cbff;
  background: rgba(124, 92, 224, .09);
  cursor: pointer;
  text-decoration: none;
  font-size: .62rem;
  font-weight: 780;
}
.task-action:hover { color: #fff; border-color: rgba(167, 139, 250, .5); }
.progress-track { height: 4px; margin: 7px 0 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet-deep), var(--cyan-deep)); transition: width .3s ease; }
.task-state { justify-self: end; padding: 7px 10px; border-radius: 999px; color: var(--green); background: rgba(110,231,183,.08); font-size: .66rem; font-weight: 750; text-align: center; }
.task-state[data-tone="error"] { color: var(--red); background: rgba(255,133,143,.08); }
.task-state[data-tone="waiting"] { color: var(--amber); background: rgba(245,199,109,.08); }

.plus-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 42px; padding: 21px 23px; border: 1px solid rgba(167,139,250,.28); border-radius: 18px; color: var(--text); background: linear-gradient(115deg, rgba(124,92,224,.14), rgba(34,139,163,.11)); text-decoration: none; }
.plus-entry span { display: grid; gap: 5px; }
.plus-entry strong { font-size: 1rem; }
.plus-entry small { color: var(--muted); }
.plus-entry b { color: var(--cyan); white-space: nowrap; }
.plus-entry:hover { border-color: rgba(103,232,249,.48); transform: translateY(-1px); }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 23px 0 38px; border-top: 1px solid var(--line); color: #555c6d; font-size: .64rem; }

@media (max-width: 860px) {
  .shell { width: min(100% - 28px, 720px); }
  .hero { padding-top: 44px; }
  .account-bar { grid-template-columns: 1fr; gap: 18px; }
  .services { grid-template-columns: 1fr; }
  .service-copy { min-height: auto; }
  .task-item { grid-template-columns: 1fr auto; }
  .task-progress { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 520px) {
  .shell { width: calc(100% - 22px); }
  .topbar { min-height: 72px; }
  .brand small { display: none; }
  .system-pill { padding: 0 10px; font-size: .71rem; }
  .hero { padding: 34px 0 28px; }
  .hero h1 { font-size: 2.25rem; }
  .hero > p:last-child { font-size: .84rem; }
  .account-bar { padding: 18px; }
  .usage-grid { grid-template-columns: 1fr; }
  .usage-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
  .usage-box strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .field-row { grid-template-columns: 1fr; }
  .service-card { padding: 21px; }
  .mode-picker { grid-template-columns: 1fr; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .task-item { grid-template-columns: 1fr; gap: 10px; }
  .task-progress { grid-column: auto; grid-row: auto; }
  .task-state { justify-self: start; }
  .plus-entry { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
