:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #111418;
  color: #edf1f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #111418;
}

.topbar {
  min-height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #2b3138;
  background: #171b20;
}

.topbar div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar strong { font-size: 20px; }
.topbar span { color: #9da8b4; font-size: 14px; }

button {
  min-height: 40px;
  border: 1px solid #3e4853;
  border-radius: 6px;
  background: #222830;
  color: #f4f7fa;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.registry-shell {
  width: min(100% - 32px, 600px);
  margin: 48px auto;
}

.status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-block: 1px solid #2b3138;
  margin-bottom: 36px;
}

.status div {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status div + div { border-left: 1px solid #2b3138; }
.status span { color: #9da8b4; }
.status strong { font-size: 22px; color: #54c39b; }

.registration { padding: 0 4px; }
.heading h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: 0; }
.heading p, .notice { color: #9da8b4; line-height: 1.6; }

form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

label { margin-top: 8px; font-size: 14px; color: #c8d0d8; }

input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #3a424c;
  border-radius: 5px;
  background: #181d23;
  color: #f5f7f9;
  font: inherit;
  outline: none;
}

input:focus { border-color: #54c39b; box-shadow: 0 0 0 2px rgba(84, 195, 155, 0.16); }

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

button { padding: 0 14px; }
button:hover { border-color: #697787; background: #29313a; }
button:disabled { opacity: .55; cursor: wait; }

.primary {
  margin-top: 14px;
  border-color: #48a987;
  background: #31856a;
}

.primary:hover { background: #399579; border-color: #66c7a5; }
.message { min-height: 24px; margin: 4px 0 0; color: #ef8b8b; }
.message.success { color: #65d0aa; }
.notice { margin-top: 34px; font-size: 13px; }

.hidden { display: none !important; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  flex: 0 0 auto;
  min-height: 38px;
  border-color: #3e4853;
}

.tab.active {
  border-color: #48a987;
  background: #243a31;
  color: #b9f1dc;
}

.panel { padding: 0 4px; }

.portal-login, .portal-account { display: grid; gap: 18px; }

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-head h1 { margin: 0 0 4px; font-size: 24px; }
.account-head p { margin: 0; color: #9da8b4; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #2b3138;
  border-radius: 6px;
  overflow: hidden;
}

.summary-grid div {
  padding: 14px 12px;
  display: grid;
  gap: 6px;
}

.summary-grid div + div { border-left: 1px solid #2b3138; }
.summary-grid span { color: #9da8b4; font-size: 13px; }
.summary-grid strong { font-size: 17px; }

.redeem-form { margin-top: 2px; }

textarea {
  width: 100%;
  min-height: 130px;
  padding: 10px 12px;
  border: 1px solid #3a424c;
  border-radius: 5px;
  background: #181d23;
  color: #f5f7f9;
  font: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

textarea:focus { border-color: #54c39b; box-shadow: 0 0 0 2px rgba(84, 195, 155, 0.16); }

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.history-head h2 { margin: 0; font-size: 18px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid #2b3138;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #232930;
  text-align: left;
  white-space: nowrap;
}

th { color: #9da8b4; font-weight: 600; background: #171b20; }
td { color: #eef2f5; }
tr:last-child td { border-bottom: 0; }
code { color: #c6e8db; }
.status-success { color: #65d0aa; }
.empty { color: #9da8b4; text-align: center; padding: 24px 12px; }

small { color: #9da8b4; line-height: 1.6; }
.field-stack { display: grid; gap: 10px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; color: #f0b4a3; }
.check-row input { width: 18px; min-height: 18px; flex-shrink: 0; margin-top: 3px; }
.binding-preview { padding: 16px; border: 1px solid #3a424c; border-radius: 6px; line-height: 1.7; overflow-wrap: anywhere; }
.binding-preview p { margin: 4px 0 12px; }
.binding-preview ul { padding-left: 22px; }
.binding-preview details { margin-top: 12px; color: #aeb9c5; }
.password-settings { padding: 16px; border: 1px solid #3a424c; border-radius: 6px; }
summary { cursor: pointer; }
.account-head h1 { overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .topbar { align-items: flex-start; padding: 16px; }
  .topbar div { flex-direction: column; gap: 2px; }
  .registry-shell { margin-top: 28px; }
  .status div { padding: 14px 12px; }
  .code-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid div:nth-child(3) { border-left: 0; border-top: 1px solid #2b3138; }
  .summary-grid div:nth-child(4) { border-top: 1px solid #2b3138; }
  .account-head { flex-direction: column; }
}
