:root {
  --ink: #1c1713;
  --muted: #83766b;
  --line: rgba(74, 52, 35, 0.1);
  --paper: rgba(255, 255, 255, 0.9);
  --cream: #fff6e8;
  --orange: #ff6b2a;
  --amber: #ffb74a;
  --green: #20b392;
  --blue: #3f83e6;
  --purple: #8065d9;
  --shadow: 0 24px 80px rgba(63, 43, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 9% 8%, rgba(255, 183, 74, 0.36), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(32, 179, 146, 0.22), transparent 32%),
    linear-gradient(135deg, #fff8ed 0%, #f8efe5 48%, #efe6dc 100%);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(440px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: -1px;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 233, 159, 0.7), transparent 34%),
    linear-gradient(135deg, #25201b 0%, #ff6b2a 100%);
  box-shadow: 0 16px 36px rgba(255, 107, 42, 0.22);
}

.eyebrow {
  margin: 18px 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin-top: 4px;
  font-size: 32px;
}

h3 {
  font-size: 20px;
}

.muted,
.hint {
  color: var(--muted);
  line-height: 1.7;
}

.hint {
  margin-top: 16px;
  font-size: 13px;
}

.login-form,
.grid-form {
  display: grid;
  gap: 16px;
}

.login-form {
  margin-top: 28px;
}

.merchant-login-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merchant-login-row span {
  color: #8b7a6d;
  font-size: 13px;
  font-weight: 800;
}

.merchant-login-link,
.merchant-login-btn {
  min-width: 112px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(32, 179, 146, 0.24);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #176d5e;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
  background:
    radial-gradient(circle at 12% 20%, rgba(32, 179, 146, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(237, 255, 249, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: 0 8px 18px rgba(32, 179, 146, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.merchant-login-link:hover,
.merchant-login-btn:hover {
  border-color: rgba(32, 179, 146, 0.52);
  color: #0f5f52;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(32, 179, 146, 0.13);
  transform: translateY(-1px);
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #6f5f52;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(91, 65, 43, 0.14);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

textarea {
  min-height: 108px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 107, 42, 0.56);
  box-shadow: 0 0 0 4px rgba(255, 107, 42, 0.12);
}

.file-field {
  position: relative;
}

.file-input {
  position: absolute;
  inset: 28px 0 0;
  width: 100%;
  min-height: 78px;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-card {
  min-height: 78px;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 107, 42, 0.38);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  color: #8b512d;
  background:
    radial-gradient(circle at 92% 14%, rgba(255, 183, 74, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 247, 236, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.upload-card::before {
  content: "+";
  position: absolute;
  right: 18px;
  top: 44px;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff9f31 0%, #ff5d24 100%);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(255, 93, 36, 0.18);
}

.upload-card strong {
  font-size: 14px;
  font-weight: 900;
}

.form-note {
  min-height: 72px;
  padding: 16px 18px;
  border: 1px solid rgba(63, 131, 230, 0.16);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #5d554d;
  background:
    radial-gradient(circle at 92% 16%, rgba(63, 131, 230, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(245, 249, 255, 0.96), rgba(255, 255, 255, 0.88));
}

.form-note strong {
  font-size: 14px;
  font-weight: 900;
  color: #20456f;
}

.form-note span {
  margin: 0;
  color: #6f645a;
  font-size: 13px;
  line-height: 1.65;
}

.upload-card small {
  max-width: calc(100% - 52px);
  color: #9a7c64;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.file-field:hover .upload-card,
.file-input:focus + .upload-card {
  border-color: rgba(255, 107, 42, 0.68);
  box-shadow: 0 0 0 4px rgba(255, 107, 42, 0.1);
}

.file-field em {
  display: block;
  margin-top: 7px;
  color: #9a7c64;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.primary-btn,
.soft-btn,
.ghost-btn,
.mini-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.primary-btn {
  min-height: 48px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, #ff9f31 0%, #ff5d24 100%);
  box-shadow: 0 14px 30px rgba(255, 93, 36, 0.22);
}

.soft-btn,
.ghost-btn {
  min-height: 42px;
  padding: 0 18px;
  color: #68492f;
  background: #fff1df;
}

.ghost-btn {
  width: 100%;
}

.mini-btn {
  min-height: 34px;
  padding: 0 12px;
  color: #276d5e;
  background: #e0f7ef;
  font-size: 13px;
}

.shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 183, 74, 0.22), transparent 32%),
    linear-gradient(180deg, #241d18 0%, #3a281e 100%);
}

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

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.main {
  padding: 28px;
}

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

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 18px 56px rgba(74, 52, 35, 0.08);
}

.metric-card {
  padding: 22px;
  overflow: hidden;
  position: relative;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  background: rgba(255, 107, 42, 0.1);
  transform: rotate(18deg);
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
}

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

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 24px;
}

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

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

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.grid-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.form-note {
  min-height: 92px;
  padding: 18px;
  border: 1px solid rgba(32, 179, 146, 0.18);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(circle at 92% 16%, rgba(32, 179, 146, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(239, 255, 248, 0.96), rgba(255, 255, 255, 0.88));
}

.form-note strong {
  color: #176d5e;
  font-size: 15px;
  font-weight: 900;
}

.form-note span {
  color: #6d817b;
  font-size: 13px;
  line-height: 1.6;
}

.write-method-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)) 1.2fr;
  gap: 14px;
  align-items: stretch;
}

.write-select-card,
.write-action-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(32, 179, 146, 0.18);
  border-radius: 20px;
}

.write-select-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(32, 179, 146, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(239, 255, 248, 0.94), rgba(255, 255, 255, 0.82));
}

.write-select-card em {
  display: block;
  margin-top: 8px;
  color: #6d817b;
  font-size: 12px;
  font-style: normal;
}

.write-action-card {
  cursor: pointer;
  text-align: left;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 183, 74, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 246, 232, 0.98), rgba(255, 255, 255, 0.9));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.write-action-card:hover {
  border-color: rgba(255, 107, 42, 0.5);
  box-shadow: 0 14px 32px rgba(255, 107, 42, 0.12);
  transform: translateY(-2px);
}

.write-action-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.write-action-card p {
  color: #6d817b;
  font-size: 13px;
  line-height: 1.6;
}

.form-submit {
  align-self: end;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.list,
.table-list,
.deploy-list,
.log-list {
  display: grid;
  gap: 12px;
}

.row-card {
  padding: 16px;
  border: 1px solid rgba(91, 65, 43, 0.1);
  border-radius: 20px;
  display: grid;
  gap: 10px;
  background: rgba(255, 251, 245, 0.76);
}

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

.row-title {
  font-weight: 900;
}

.row-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.danger-text {
  color: #c04a2b;
  font-weight: 800;
}

.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #755038;
  background: #fff0df;
  font-size: 12px;
  font-weight: 900;
}

.badge.green {
  color: #1f7664;
  background: #e0f8ef;
}

.badge.blue {
  color: #2f65b0;
  background: #e8f2ff;
}

.badge.purple {
  color: #6650b0;
  background: #f1edff;
}

.deploy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.writer-box {
  padding: 14px;
  border: 1px solid rgba(32, 179, 146, 0.18);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #f0fbf6;
}

.writer-box span,
.writer-box em {
  display: block;
  color: #5e8177;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.writer-box strong {
  display: block;
  margin: 4px 0;
  color: #1f7664;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.auth-link {
  padding: 12px 14px;
  border: 1px solid rgba(63, 131, 230, 0.16);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f4f8ff;
}

.auth-link span {
  min-width: 0;
  color: #2f65b0;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-platform-card {
  border-color: rgba(63, 131, 230, 0.18);
  background:
    radial-gradient(circle at 92% 12%, rgba(63, 131, 230, 0.11), transparent 35%),
    rgba(255, 255, 255, 0.9);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: rgba(31, 24, 18, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metric-grid,
  .two-col,
  .grid-form,
  .write-method-grid,
  .writer-box {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-head,
  .row-main {
    flex-direction: column;
    align-items: stretch;
  }
}
