:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --danger: #b42318;
  --ok: #047857;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  min-height: 64px;
  background: #101828;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 3px solid var(--brand);
}

.topbar strong {
  display: block;
  font-size: 20px;
}

.topbar span {
  color: #cbd5e1;
  font-size: 13px;
}

.admin-link {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 8px 14px;
  border-radius: 6px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.main-section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.main-section-head span {
  width: fit-content;
  border: 1px solid #cfe0db;
  border-radius: 999px;
  padding: 4px 10px;
  color: #2c6658;
  background: #eef7f4;
  font-size: 12px;
  font-weight: 800;
}

.main-section-head h1 {
  margin: 0;
  font-size: 28px;
}

.main-section-head p {
  margin: 0;
  color: var(--muted);
}

.admin-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.section-title h1,
.admin-head h1,
.login h1 {
  margin: 0;
  font-size: 26px;
}

.section-title p,
.admin-head p {
  color: var(--muted);
  margin: 8px 0 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  overflow: hidden;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.card.selected {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  border-color: var(--brand);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  display: grid;
  grid-template-rows: auto auto minmax(48px, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.price {
  color: var(--brand);
  font-weight: 800;
  font-size: 22px;
}

.product-card-head {
  display: grid;
  gap: 6px;
}

.order-count {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f6f3;
  color: #24584c;
  font-size: 12px;
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.purchase-count {
  flex: 0 0 auto;
  color: #24584c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.detail-count {
  margin-top: 8px;
}

.desc {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.55;
  min-height: 48px;
  margin: 0;
  overflow: hidden;
  word-break: break-word;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin: 0 0 13px;
  color: #344054;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: #98a2b3;
}

button.clicked {
  transform: translateY(1px);
  box-shadow: inset 0 0 0 999px rgba(15, 118, 110, 0.08);
}

.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  width: 100%;
}

.primary:hover {
  background: var(--brand-dark);
}

.paybox,
.result {
  background: #f8fafc;
  border: 1px dashed #b6c2cf;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.paybox span {
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.pay-amount strong {
  color: var(--accent);
  font-size: 26px;
}

.inner-label {
  margin-top: 12px;
}

.payment-upload {
  margin-top: 14px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
}

.address-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.copy-row code,
.address-copy-row code {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

.compact-paybox code {
  display: block;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

.user-receive-box {
  background: #f7faf8;
  border: 1px solid #cbd8d3;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.user-receive-box strong {
  display: block;
  margin-bottom: 10px;
  color: #274941;
}

.receive-grid {
  display: grid;
  gap: 10px;
}

.network-list {
  display: grid;
  gap: 8px;
  margin-bottom: 13px;
}

.query-panel {
  margin-bottom: 20px;
}

.front-page .query-panel {
  display: none;
}

.notice-box {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.notice-head h2 {
  margin: 0;
}

.notice-head span {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.notice-scroll {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.7;
  padding-right: 6px;
}

.attention-panel {
  margin-bottom: 0;
}

.attention-panel.hidden {
  display: none;
}

.attention-panel .side-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.attention-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.compact:empty {
  display: none;
}

code {
  display: block;
  word-break: break-all;
  white-space: pre-wrap;
  color: #0f172a;
}

.message {
  min-height: 20px;
  color: var(--muted);
  margin: 10px 0 0;
}

.message.ok {
  color: var(--ok);
}

.message.bad {
  color: var(--danger);
}

.query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  gap: 8px;
}

.auth-layout {
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 24px;
  display: block;
}

.auth-card h1 {
  margin: 0 0 16px;
  font-size: 24px;
}

.auth-notice {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #cfe0db;
  border-radius: 8px;
  background: #f4faf7;
  color: #31564d;
  line-height: 1.55;
}

.invite-notice {
  border-color: #d8c28a;
  background: #fff8e7;
  color: #785a18;
}

.link-button {
  width: auto;
  min-height: auto;
  display: block;
  margin: 12px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
}

.link-button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.user-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-icon-btn {
  width: 40px;
  min-height: 40px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(218, 226, 223, 0.26);
  color: #fff;
  font-size: 18px;
}

.top-action-btn {
  font-size: 16px;
}

.support-action-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(218, 226, 223, 0.26);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.support-action-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.user-menu {
  position: absolute;
  right: 0;
  top: 48px;
  z-index: 20;
  width: 190px;
  background: #ffffff;
  color: #17211f;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(20, 36, 32, 0.16);
  padding: 10px;
}

.user-menu strong {
  display: block;
  padding: 6px 8px 3px;
}

.user-level {
  display: block;
  padding: 0 8px 10px;
  color: #65736f;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.user-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  margin-bottom: 12px;
}

.user-menu button {
  width: 100%;
  text-align: left;
  border-color: transparent;
  background: transparent;
}

.user-menu button:hover {
  background: #f3f6f5;
}

.side-summary p {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0;
}

.side-summary button {
  width: 100%;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
}

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

#productsView .admin-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(560px, 1.4fr);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.login {
  max-width: 420px;
  margin: 80px auto;
}

.hidden {
  display: none !important;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkline input {
  width: auto;
}

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

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

.setting-group {
  margin-bottom: 0;
}

.attention-setting-group {
  grid-column: 1 / -1;
}

.setting-save-panel {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.setting-save-btn {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .inline-fields {
    grid-template-columns: 1fr;
  }
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.8fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
}

.order-row {
  grid-template-columns: 1fr 1fr 1fr 180px;
}

.user-row {
  grid-template-columns: 1fr 1.1fr 1fr 0.7fr;
}

.product-admin-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(220px, auto);
  gap: 12px 18px;
  align-items: center;
}

.admin-list-card {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.admin-list-card:first-child {
  border-top: 0;
}

.product-admin-info {
  min-width: 0;
}

.product-admin-info strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.product-admin-desc {
  display: -webkit-box;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  line-height: 1.55;
  word-break: break-word;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.product-admin-meta,
.agent-admin-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.product-admin-meta > div,
.agent-admin-meta > div {
  min-width: 0;
}

.product-admin-actions,
.agent-admin-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.agent-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, auto);
  gap: 12px 18px;
  align-items: center;
}

.agent-admin-info {
  min-width: 0;
}

.agent-admin-info strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.agent-admin-info .muted {
  margin-top: 4px;
  word-break: break-word;
}

.agent-row code {
  margin-top: 6px;
  font-size: 12px;
  max-width: 100%;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e6f4f1;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

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

.danger {
  color: var(--danger);
}

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

.thumb {
  max-width: 120px;
  max-height: 90px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
  margin-top: 8px;
}

.admin-page {
  background: #f4f6f5;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: #14211e;
  color: #f4faf7;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-block {
  padding: 6px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-block strong {
  display: block;
  font-size: 18px;
}

.brand-block span {
  display: block;
  color: #aebfba;
  font-size: 13px;
  margin-top: 5px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-btn,
.agent-nav,
.side-link,
.side-logout {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  text-align: left;
  padding: 0 12px;
}

.nav-btn,
.agent-nav {
  background: transparent;
  border-color: transparent;
  color: #d8e3df;
}

.nav-btn:hover,
.nav-btn.active,
.agent-nav:hover,
.agent-nav.active {
  background: #223832;
  border-color: #31564d;
  color: #ffffff;
}

.side-link {
  display: flex;
  align-items: center;
  margin-top: auto;
  color: #d8e3df;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.side-logout {
  background: #ffffff;
  color: #14211e;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.metric-card {
  margin-bottom: 0;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 28px;
}

.admin-view-head h1 {
  margin: 0;
  font-size: 26px;
}

.admin-view-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.editable-network-list {
  gap: 14px;
}

.network-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.network-row label {
  margin: 0;
}

.add-network {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  margin: 12px 0;
}

.order-admin-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.order-admin-toolbar h2 {
  margin: 0;
}

.order-search-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.order-search-mini input,
.order-search-mini button {
  min-height: 34px;
  font-size: 14px;
}

.order-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.order-tab {
  min-height: 34px;
  padding: 0 12px;
  background: #f5f8f7;
}

.order-tab.active {
  background: #e6f4f1;
  border-color: #8bbeb2;
  color: var(--brand-dark);
  font-weight: 700;
}

.order-tab span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 4px;
  border-radius: 999px;
  background: #d8ebe6;
  font-size: 12px;
}

.order-summary-row,
.user-row {
  cursor: pointer;
}

.order-summary-row:hover,
.user-row:hover {
  background: #f7faf8;
}

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

.mini-btn {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.detail-modal {
  width: min(820px, 100%);
  max-height: 86vh;
  overflow: auto;
  position: relative;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
}

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

.detail-grid > div,
.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.detail-grid strong,
.detail-block strong {
  display: block;
  margin-top: 4px;
}

.detail-block {
  margin-bottom: 12px;
}

.detail-block p {
  white-space: pre-wrap;
  line-height: 1.65;
  margin: 8px 0 0;
}

.detail-img {
  max-width: 100%;
  max-height: 360px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.product-detail-modal {
  width: min(1120px, 100%);
  position: relative;
}

.product-detail-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  padding-bottom: 14px;
}

.product-detail-modal #productModalClose {
  flex: 0 0 auto;
  min-width: 72px;
  background: #ffffff;
}

.product-detail-modal .modal-head h2 {
  padding-right: 12px;
}

.checkout-detail-stage {
  display: grid;
  gap: 14px;
}

.checkout-stage-title {
  order: -10;
  margin: 0;
  color: #0f2320;
  font-size: 30px;
}

.checkout-product-confirm {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}

.product-detail-desc {
  margin-bottom: 0;
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.step-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f7;
  color: var(--muted);
  font-weight: 700;
}

.step-badge span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #dce7e3;
  color: #28453e;
  font-size: 12px;
}

.step-badge.active {
  border-color: #8bbeb2;
  background: #e7f3ef;
  color: var(--brand-dark);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.checkout-layout:not(.hidden) {
  display: block;
}

.checkout-layout .order-panel-in-modal {
  width: 100%;
}

.product-detail-image {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #1f332f, #4a7569);
  color: #e7efec;
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
  margin-bottom: 0;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.product-params {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.product-params h3 {
  margin: 0 0 10px;
}

.param-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.param-row:first-of-type {
  border-top: 0;
}

.param-row span {
  color: var(--muted);
}

.param-row strong {
  word-break: break-word;
}

.order-panel-in-modal {
  margin-bottom: 0;
}

.checkout-step-panel h2 {
  margin-top: 0;
}

.checkout-summary {
  position: relative;
  display: grid;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: #f8faf9;
  padding: 14px 14px 28px;
  margin-bottom: 0;
}

.checkout-summary span,
.checkout-summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.checkout-summary strong {
  color: #1c302c;
  font-size: 18px;
}

.checkout-purchase-count {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: #24584c;
  font-size: 11px;
  font-weight: 800;
}

.checkout-actions {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.compact-paybox {
  margin-top: 0;
}

.order-center-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.order-card p {
  margin: 6px 0;
  color: #33443f;
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.status-timeline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.status-timeline > div {
  display: grid;
  grid-template-columns: 170px 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.status-timeline > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.status-timeline span,
.status-timeline em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.status-timeline strong {
  color: var(--brand-dark);
}

.product-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px dashed #c9d6d1;
  border-radius: 8px;
  padding: 8px;
  background: #f8faf9;
}

.product-thumb {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f1;
}

.detail-actions {
  justify-content: flex-start;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 20, 0.42);
  padding: 18px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid #d5dfdb;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(18, 32, 28, 0.22);
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.modal-text {
  color: #32423e;
  line-height: 1.75;
  white-space: pre-wrap;
  margin-bottom: 18px;
}

.order-tip-float {
  position: fixed;
  right: 16px;
  bottom: 86px;
  z-index: 45;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.24), 0 0 0 4px rgba(34, 197, 94, 0.14);
  font-weight: 800;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.order-tip-float span {
  pointer-events: none;
  line-height: 1;
  font-size: 13px;
  text-shadow: 0 1px 1px rgba(8, 54, 26, 0.28);
}

.order-tip-float.dragging {
  cursor: grabbing;
  transform: scale(0.98);
}

.order-tip-modal {
  width: min(460px, 100%);
}

.order-tip-modal .modal-text {
  max-height: 58vh;
  overflow: auto;
  margin-bottom: 0;
}

.query-modal {
  width: min(620px, 100%);
}

.query-modal .query {
  margin-top: 14px;
}

.query-modal .result {
  max-height: 58vh;
  overflow: auto;
}

.support-modal {
  width: min(560px, 100%);
}

.support-guide {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #d8e2de;
  border-radius: 8px;
  background: #f7faf8;
  color: #33443f;
  line-height: 1.7;
  white-space: pre-wrap;
}

.support-list {
  display: grid;
  gap: 12px;
}

.support-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  background: #ffffff;
}

.support-item > span {
  color: #66716d;
  font-size: 13px;
  font-weight: 700;
}

.support-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: stretch;
}

.support-copy-row code,
.support-item a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #d7dfdc;
  border-radius: 6px;
  background: #f8faf9;
  padding: 9px 10px;
  color: #173b34;
  text-decoration: none;
  word-break: break-all;
}

.support-open-link {
  justify-content: center;
  background: linear-gradient(135deg, #2f7564, #24584c) !important;
  border-color: #2f7564 !important;
  color: #ffffff !important;
  font-weight: 800;
}

.disabled-link {
  pointer-events: none;
  color: #8a9692 !important;
}

.success-order {
  background: #f3f6f5;
  border: 1px solid #d5dfdb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.success-order span {
  display: block;
  color: #66716d;
  font-size: 13px;
  margin-bottom: 6px;
}

.success-order strong {
  display: block;
  color: #194d42;
  font-size: 24px;
  word-break: break-all;
}

@media (max-width: 900px) {
  .layout,
  .admin-grid,
  .auth-layout,
  .settings-layout,
  .product-detail-layout,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .side {
    order: 0;
    position: static;
  }

  .row,
  .order-row,
  .user-row,
  .order-admin-toolbar,
  .network-row,
  .status-timeline > div {
    grid-template-columns: 1fr;
  }

  .product-admin-row,
  .agent-row {
    grid-template-columns: 1fr;
  }

  .product-admin-meta,
  .agent-admin-meta,
  .product-admin-actions,
  .agent-admin-actions {
    justify-content: flex-start;
  }

  .order-row-status-actions {
    justify-content: flex-start;
  }

  .product-admin-meta,
  .agent-admin-meta {
    flex-wrap: wrap;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 16px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar strong,
  .topbar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-bar {
    gap: 6px;
  }

  .user-icon-btn {
    width: 36px;
    min-height: 36px;
    font-size: 16px;
  }

  .support-action-btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .layout,
  .admin-layout {
    padding: 14px;
  }

  .query,
  .button-row,
  .captcha-row,
  .add-network,
  .checkout-steps,
  .checkout-actions {
    grid-template-columns: 1fr;
  }

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

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

  .admin-main {
    padding: 14px;
  }
}

.front-page {
  --bg: #f3f5f4;
  --panel: #ffffff;
  --text: #17211f;
  --muted: #66716d;
  --line: #d7dfdc;
  --brand: #236b5a;
  --brand-dark: #194d42;
  --accent: #a8782b;
  background:
    linear-gradient(180deg, #edf2ef 0%, #f7f8f7 44%, #f2f4f3 100%);
}

.front-page .topbar {
  background: linear-gradient(90deg, #f4f8f6, #eaf2ef);
  border-bottom: 1px solid #d3dfda;
  box-shadow: 0 8px 22px rgba(45, 68, 62, 0.08);
}

.front-page .topbar strong {
  color: #213430;
  letter-spacing: 0;
}

.front-page .topbar span {
  color: #65736f;
}

.front-page .user-icon-btn {
  background: #ffffff;
  border-color: #cddbd6;
  color: #253c36;
  box-shadow: 0 4px 12px rgba(37, 60, 54, 0.08);
}

.front-page .user-icon-btn:hover {
  background: #f7faf8;
}

.front-page .support-action-btn {
  background: #ffffff;
  border-color: #cddbd6;
  color: #1f4d43;
  box-shadow: 0 4px 12px rgba(37, 60, 54, 0.08);
}

.front-page .support-action-btn:hover {
  background: #f7faf8;
}

.front-page .top-action-btn {
  color: #236b5a;
}

.front-page .admin-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(218, 226, 223, 0.24);
}

.front-page .section-title h1 {
  color: #1c302c;
}

.front-page .section-title p {
  color: #65736f;
}

.front-page .panel,
.front-page .card {
  border-color: rgba(37, 73, 65, 0.12);
  box-shadow: 0 10px 24px rgba(24, 41, 37, 0.06);
}

.front-page .query-panel {
  background: #ffffff;
}

.order-feed-panel {
  margin-bottom: 16px;
  padding: 10px;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.feed-head h2 {
  margin: 0;
  font-size: 14px;
}

.feed-head span {
  color: #65736f;
  font-size: 11px;
}

.order-feed-list {
  display: grid;
  gap: 4px;
  grid-auto-rows: minmax(29px, auto);
  min-height: 194px;
  max-height: 194px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #c9d8d2 transparent;
}

.order-feed-list::-webkit-scrollbar {
  width: 6px;
}

.order-feed-list::-webkit-scrollbar-track {
  background: transparent;
}

.order-feed-list::-webkit-scrollbar-thumb {
  background: #c9d8d2;
  border-radius: 999px;
}

.feed-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 0.8fr 0.9fr;
  gap: 5px;
  align-items: center;
  border: 1px solid #d8e2de;
  border-radius: 5px;
  background: #f7faf8;
  padding: 5px 7px;
  color: #263a35;
  font-size: 11px;
}

.feed-row strong {
  color: #1f4d43;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-row span {
  color: #526964;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-row em {
  font-style: normal;
  color: #8a6423;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-end-note {
  min-height: 29px;
  display: grid;
  place-items: center;
  color: #65736f;
  font-size: 11px;
  border: 1px dashed #d8e2de;
  border-radius: 5px;
  background: #fbfcfb;
}

.front-page .card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.front-page .card:hover,
.front-page .card:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(24, 41, 37, 0.1);
  border-color: #7fa89e;
  outline: none;
}

.front-page .card.selected {
  outline: 3px solid rgba(35, 107, 90, 0.16);
  border-color: #356f60;
}

.front-page .product-image {
  background:
    linear-gradient(135deg, rgba(33, 56, 51, 0.96), rgba(57, 93, 83, 0.92));
  color: #e7efec;
}

.front-page .price {
  color: #236b5a;
}

.front-page .paybox {
  background: #eef4f1;
  border: 1px solid #c9d8d2;
  color: #20302c;
  box-shadow: 0 10px 22px rgba(30, 52, 46, 0.08);
}

.front-page .paybox span,
.front-page .paybox .inner-label {
  color: #526964;
  font-weight: 600;
}

.front-page .paybox select,
.front-page .paybox input,
.front-page .paybox textarea {
  background: #ffffff;
  color: #10231e;
}

.front-page .pay-amount strong {
  color: #8a6423;
  text-shadow: none;
}

.front-page .copy-row code {
  background: #ffffff;
  border-color: #cfdad6;
  color: #17211f;
}

.front-page .copy-row button {
  background: #d9c08b;
  color: #24302d;
  border-color: #d9c08b;
  font-weight: 700;
}

.front-page .primary {
  background: linear-gradient(135deg, #2f7564, #24584c);
  border-color: #2f7564;
  box-shadow: 0 8px 16px rgba(36, 88, 76, 0.12);
}

.front-page .primary:hover {
  background: linear-gradient(135deg, #356f60, #1f4d43);
}

@media (max-width: 560px) {
  .front-page .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .front-page .grid > .panel {
    grid-column: 1 / -1;
  }

  .front-page .product-card {
    min-width: 0;
  }

  .front-page .product-card .card-body {
    grid-template-rows: auto auto minmax(38px, 1fr) auto;
    gap: 7px;
    padding: 10px;
  }

  .front-page .product-card h3 {
    font-size: 14px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .front-page .product-card .price-row {
    align-items: flex-start;
    gap: 4px;
    flex-wrap: wrap;
  }

  .front-page .product-card .price {
    font-size: 17px;
    line-height: 1.1;
  }

  .front-page .product-card .purchase-count {
    font-size: 10px;
    line-height: 1.2;
  }

  .front-page .product-card .desc {
    min-height: 36px;
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .front-page .product-card .primary {
    min-height: 34px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
  }

  .order-tip-float {
    right: 14px;
    bottom: 76px;
    width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .order-tip-float span {
    font-size: 12px;
  }
}

.front-page .pill {
  background: #e5efeb;
  color: #24584c;
}
