:root {
  --ink: #1f1712;
  --muted: #85766b;
  --line: rgba(76, 51, 33, 0.12);
  --paper: rgba(255, 255, 255, 0.88);
  --primary: #ff6f1f;
  --primary-light: #ffb43a;
  --primary-dark: #ff4422;
  --price: #f23f24;
  --hero-start: #17100c;
  --hero-mid: #352014;
  --hero-end: #ff6d27;
  --bg-start: #fff0dc;
  --bg-mid: #fff8f1;
  --bg-end: #f8f3ee;
  --shadow: 0 24px 80px rgba(63, 43, 25, 0.14);
}

* {
  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 8% 6%, rgba(255, 183, 74, 0.32), transparent 30%),
    radial-gradient(circle at 92% 10%, rgba(32, 179, 146, 0.2), transparent 32%),
    linear-gradient(135deg, #fff8ed 0%, #f8efe5 48%, #efe6dc 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card,
.panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  width: min(460px, 100%);
  padding: 38px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 1000;
  background: linear-gradient(135deg, #1f1712 0%, var(--primary) 100%);
}

.eyebrow {
  margin: 18px 0 8px;
  color: #20b392;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.18;
}

h2 {
  font-size: 22px;
}

.muted {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.login-form,
.field-grid {
  display: grid;
  gap: 16px;
}

.login-form {
  margin-top: 28px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #6f5f52;
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  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.94);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(255, 107, 42, 0.52);
  box-shadow: 0 0 0 4px rgba(255, 107, 42, 0.1);
}

.primary-btn,
.soft-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 1000;
}

.primary-btn {
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
  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;
}

.notice-card {
  padding: 15px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  color: #176d5e;
  background: #eafbf5;
}

.notice-card span,
.store-select-btn span {
  color: #6d817b;
  font-size: 13px;
  line-height: 1.5;
}

.store-select-list {
  display: grid;
  gap: 12px;
}

.store-select-btn {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  text-align: left;
  background: #fff;
}

.theme-shell {
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 430px;
  gap: 20px;
  align-items: start;
}

.panel,
.preview-panel {
  padding: 24px;
}

.disabled-panel {
  display: grid;
  gap: 8px;
  color: #8a5a1f;
  background: #fff8ea;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.theme-status-bar {
  margin: 8px 0 18px;
  padding: 14px;
  border: 1px solid rgba(255, 107, 42, 0.14);
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.86));
}

.theme-status-item {
  min-height: 64px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.theme-status-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.theme-status-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-all;
}

.theme-status-item.warning strong {
  color: #e15a20;
}

.reset-toolbar {
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: rgba(255, 241, 223, 0.58);
}

.reset-toolbar span {
  margin: 0 4px 0 0;
  color: #7e5b3d;
  font-size: 13px;
  font-weight: 1000;
}

.section-head span,
.preview-toolbar span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-grid,
.color-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

.section-mini-title {
  margin: 24px 0 12px;
  color: #2e241c;
  font-size: 15px;
  font-weight: 1000;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preset-card {
  min-height: 112px;
  padding: 10px;
  border: 1px solid rgba(91, 65, 43, 0.1);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  color: #2e241c;
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
}

.preset-card.active {
  border-color: rgba(255, 107, 42, 0.55);
  box-shadow: 0 12px 28px rgba(255, 107, 42, 0.12);
}

.preset-preview {
  height: 44px;
  border-radius: 14px;
}

.preset-card strong {
  font-size: 13px;
}

.color-field {
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 10px;
  align-items: end;
}

.color-field input[type="color"] {
  min-height: 46px;
  padding: 4px;
}

.upload-field {
  position: relative;
  min-height: 120px;
  padding: 16px;
  border: 1px dashed rgba(255, 107, 42, 0.34);
  border-radius: 20px;
  display: grid;
  align-content: center;
  gap: 7px;
  background: #fff8ef;
}

.upload-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-field strong {
  color: #8b512d;
}

.upload-field small {
  color: #9a7c64;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.preview-panel {
  position: sticky;
  top: 24px;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.phone-preview {
  width: 360px;
  margin: 0 auto;
  border: 10px solid #17120f;
  border-radius: 42px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  box-shadow: 0 24px 70px rgba(31, 23, 18, 0.22);
}

.phone-hero {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--hero-start), var(--hero-mid), var(--hero-end));
}

.preview-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 12, 7, 0.15), rgba(17, 10, 6, 0.88));
}

.phone-content {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 24px;
  color: #fff;
}

.preview-logo {
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
}

.phone-title {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 1000;
}

.phone-sub {
  margin-top: 9px;
  color: rgba(255, 246, 232, 0.86);
  font-size: 13px;
  line-height: 1.5;
}

.phone-body {
  padding: 14px 14px 24px;
}

.phone-preview {
  color: var(--text, #211713);
}

.phone-preview .phone-content {
  color: var(--hero-text, #fff);
}

.phone-preview .speed-card,
.phone-preview .quick-grid div,
.phone-preview .deal-card {
  color: var(--card-text, var(--text, #211713));
  background: var(--card, #ffffff);
  border: 1px solid var(--primary-light, #ffb43a);
}

.phone-preview .speed-card span,
.phone-preview .deal-card span {
  color: var(--card-muted, var(--muted, #85766b));
}

.phone-preview .quick-grid div {
  color: var(--panel-text, var(--text, #211713));
  background: var(--panel, #fff7ef);
}

.phone-preview .speed-card button {
  color: var(--on-primary, #fff);
}

.phone-preview .deal-image {
  color: var(--on-primary, #fff);
  background: linear-gradient(135deg, var(--primary-light), var(--accent, var(--primary)));
}

.speed-card {
  margin-top: -28px;
  padding: 15px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(101, 54, 22, 0.18);
}

.speed-card strong,
.speed-card span {
  display: block;
}

.speed-card strong {
  font-size: 14px;
}

.speed-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.speed-card button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.quick-grid div {
  min-height: 58px;
  padding: 8px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #4d3321;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.deal-card {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  background: #fff;
}

.deal-image {
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.deal-card strong,
.deal-card span {
  display: block;
}

.deal-card strong {
  font-size: 15px;
}

.deal-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.deal-price {
  margin-top: 8px;
  color: var(--price);
  font-size: 22px;
  font-weight: 1000;
}

.phone-preview.layout-premium .phone-hero,
.phone-preview.layout-brand .phone-hero {
  height: 330px;
}

.phone-preview.layout-fastFood .phone-hero {
  height: 240px;
}

.phone-preview.layout-groupDeal .deal-card {
  border: 2px solid rgba(255, 73, 101, 0.2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  min-width: 220px;
  padding: 13px 18px;
  border-radius: 999px;
  color: #fff;
  text-align: center;
  background: rgba(28, 23, 19, 0.9);
  transform: translateX(-50%);
}

@media (max-width: 980px) {
  .topbar,
  .section-head,
  .preview-toolbar {
    flex-direction: column;
  }

  .theme-grid,
  .theme-status-bar,
  .field-grid,
  .color-grid,
  .asset-grid,
  .preset-list {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .preview-panel {
    position: static;
  }

  .phone-preview {
    width: min(360px, 100%);
  }
}
