:root {
  --bg: #eef5ff;
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --text: #132238;
  --muted: #5f7087;
  --line: #d9e4f1;
  --brand: #1f78ff;
  --brand-dark: #1359c8;
  --brand-soft: #e7f1ff;
  --accent: #ff8a1f;
  --accent-soft: #fff1e2;
  --green: #1ecf8f;
  --shadow: 0 20px 44px rgba(19, 34, 56, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI Variable", "Bahnschrift", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(31, 120, 255, 0.08), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 138, 31, 0.08), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { width: min(1160px, calc(100% - 16px)); margin: 0 auto; }

.site-header {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(31, 120, 255, 0.14);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--brand-dark);
}

.site-logo img { width: 40px; height: 40px; object-fit: contain; }
.site-logo span { font-size: 24px; letter-spacing: .03em; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.header-link, .header-button, .user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}
.header-link { color: var(--muted); }
.header-button.ghost { border: 1px solid var(--line); background: rgba(255,255,255,.88); }
.header-button.primary, .primary-btn {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
}
.user-pill {
  background: linear-gradient(180deg, #f7fbff 0%, #e8f2ff 100%);
  border: 1px solid rgba(31, 120, 255, 0.14);
  color: var(--brand-dark);
}

.page { padding: 20px 0 40px; }

.hero-box, .section-box, .summary-box, .empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-box {
  display: grid;
  gap: 16px;
  padding: 24px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(31, 120, 255, 0.12), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 138, 31, 0.12), transparent 22%),
    linear-gradient(145deg, #f7fbff 0%, #ffffff 38%, #ffffff 100%);
}

.compact-hero {
  margin-bottom: 14px;
  padding: 20px 24px;
}

.kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-box h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.06;
}

.hero-box p:last-child,
.section-subtitle {
  color: var(--muted);
}

.section-box { padding: 22px; margin-top: 18px; }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 { margin-bottom: 6px; font-size: 24px; }

.summary-grid, .meta-grid, .gallery-grid, .history-list, .vps-list {
  display: grid;
  gap: 14px;
}

.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-card, .meta-card, .history-item, .vps-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
}

.summary-card strong, .meta-card strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-dark);
  font-size: 22px;
}

.summary-card span, .meta-card span, .history-item span, .vps-item span {
  color: var(--muted);
  font-size: 13px;
}

.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.preview-card {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.preview-card img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meta-card strong { font-size: 16px; color: var(--text); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th { background: #fafbfd; font-size: 13px; color: var(--muted); }

.gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.price-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, #102948 0%, #1d4678 100%);
  color: #fff;
}

.price-banner strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 40px);
  color: #ffd088;
}

.note-box {
  padding: 16px;
  border: 1px solid #ffd9ad;
  border-radius: 16px;
  background: var(--accent-soft);
  color: #9a4e00;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.flash-item.success {
  border-color: #b7f0dc;
  background: #effdf7;
  color: #11654a;
}

.flash-item.error,
.flash-item.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.topup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

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

.form-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-field select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #9a4e00;
  font-size: 13px;
  font-weight: 800;
}

.status-chip[data-status="paid"] {
  background: #ecfdf3;
  color: #166534;
}

.status-chip[data-status="expired"] {
  background: #fef2f2;
  color: #b91c1c;
}

.deposit-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.deposit-layout-priority {
  align-items: stretch;
}

.deposit-side-primary {
  gap: 12px;
}

.deposit-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-hero {
  background:
    radial-gradient(circle at top right, rgba(31, 120, 255, 0.14), transparent 28%),
    radial-gradient(circle at top left, rgba(30, 207, 143, 0.14), transparent 22%),
    linear-gradient(145deg, #f5fffb 0%, #ffffff 38%, #ffffff 100%);
}

.pricing-board {
  display: grid;
  gap: 12px;
}

.pricing-row {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(96px, 120px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #132946 0%, #1f4270 100%);
  color: #f8fafc;
}

.pricing-row strong {
  color: #87f1c6;
  font-size: 20px;
}

.pricing-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffd088;
  font-size: 18px;
  font-weight: 800;
}

.pricing-row p {
  color: rgba(248, 250, 252, 0.84);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.feature-card p {
  color: var(--muted);
}

.buy-key-form {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(260px, 1fr);
  gap: 12px;
}

.buy-key-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.balance-note {
  color: var(--muted);
}

.balance-note strong {
  color: var(--brand-dark);
}

.license-status {
  margin-top: 16px;
}

.license-status h3 {
  margin-bottom: 12px;
}

.license-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.license-badge.active {
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.license-badge.expired {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.renew-inline-form {
  margin-top: 10px;
}

.license-line-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.license-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.license-line-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.license-line-name {
  font-weight: 800;
  color: var(--text);
}

.license-line-expire {
  color: var(--muted);
  font-size: 13px;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
}

.confirm-modal-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.confirm-modal-dialog h3 {
  margin-bottom: 10px;
  font-size: 24px;
}

.confirm-modal-dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.emphasis-box {
  border-width: 2px;
  border-color: #9fc4ff;
  background: linear-gradient(180deg, #eef6ff 0%, #ffffff 100%);
}

.emphasis-box strong {
  font-size: 24px;
  color: var(--brand-dark);
  word-break: break-word;
}

.secondary-section {
  margin-top: 14px;
}

.qr-card {
  padding: 16px;
}

.qr-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
  object-fit: contain;
}

@media (min-width: 1200px) {
  .deposit-layout {
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
  }
}

.deposit-side {
  display: grid;
  gap: 14px;
}

.copy-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.copy-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.copy-box strong {
  font-size: 20px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  text-align: center;
}

.empty-state h3 { margin-bottom: 8px; font-size: 28px; }

.site-footer {
  margin-top: 24px;
  padding: 34px 0;
  background:
    radial-gradient(circle at top left, rgba(66, 153, 225, 0.18), transparent 24%),
    linear-gradient(180deg, #132946 0%, #0f1f36 100%);
  color: #eef5ff;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}

.footer-brand img { width: 70px; height: 70px; margin-bottom: 12px; object-fit: contain; }
.footer-brand h2, .footer-column h3 { margin-bottom: 10px; }
.footer-brand p, .footer-column li { color: #c9d7ea; line-height: 1.55; }
.footer-column ul { list-style: none; display: grid; gap: 8px; }

@media (max-width: 900px) {
  .summary-grid, .meta-grid, .gallery-grid, .footer-inner, .deposit-layout, .deposit-summary-grid, .feature-grid, .pricing-row { grid-template-columns: 1fr; }
  .pricing-row span { justify-self: start; }
  .buy-key-form { grid-template-columns: 1fr; }
  .license-line-item { flex-direction: column; align-items: stretch; }
  .license-line-main { align-items: flex-start; }
  .renew-inline-form { margin-top: 0; }
  .confirm-modal-dialog { padding: 18px; }
  .confirm-modal-actions { flex-direction: column; }
  .confirm-modal-actions > * { width: 100%; }
}

@media (max-width: 768px) {
  .site-logo span { font-size: 18px; }
  .header-link { display: none; }
  .hero-box, .section-box { padding: 18px; }
  .price-banner, .header-inner, .section-head { display: grid; }
  .header-actions { justify-content: flex-start; }
  .cta-row { flex-direction: column; }
  .cta-row > * { width: 100%; }
  .topup-form { grid-template-columns: 1fr; }
}
