:root {
  color-scheme: light;
  --page: #f6f7f3;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --ink: #181916;
  --muted: #686d65;
  --line: rgba(136, 145, 136, 0.26);
  --line-strong: rgba(123, 133, 124, 0.42);
  --teal: #0f766e;
  --gold: #c0a56b;
  --shadow: 0 30px 90px rgba(39, 43, 38, 0.15);
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(124deg, rgba(255, 255, 255, 0.96), rgba(232, 238, 232, 0.72) 44%, rgba(238, 233, 219, 0.72)),
    var(--page);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='1440' height='980' viewBox='0 0 1440 980' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-60 642C168 514 273 569 482 474C679 384 812 242 1051 266C1238 285 1348 397 1500 330' fill='none' stroke='%23b8a36a' stroke-opacity='.18' stroke-width='1.2'/%3E%3Cpath d='M-80 742C178 606 323 650 545 548C746 455 890 344 1106 377C1264 402 1355 487 1494 443' fill='none' stroke='%230f766e' stroke-opacity='.12' stroke-width='1.1'/%3E%3Cpath d='M-90 816C164 719 334 734 562 642C787 551 936 473 1157 501C1328 523 1412 579 1530 556' fill='none' stroke='%232d312c' stroke-opacity='.08' stroke-width='1'/%3E%3C/svg%3E");
  background-size: cover;
  opacity: 0.9;
}

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

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1360px;
  margin: 0 auto 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(207, 219, 215, 0.46));
  box-shadow: 0 12px 26px rgba(31, 35, 31, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95);
  color: #0f766e;
  font-family: Georgia, serif;
  font-size: 17px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button,
.icon-button,
.format-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border 160ms ease;
}

.ghost-button,
.primary-button {
  height: 42px;
  gap: 8px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.58);
  color: #30332f;
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.primary-button {
  background: linear-gradient(135deg, #161815, #2d2f2a);
  color: #f8edcf;
  box-shadow: 0 14px 34px rgba(26, 28, 24, 0.2);
}

.ghost-button:hover,
.primary-button:hover,
.icon-button:hover,
.style-card:hover,
.upload-box:hover,
.format-button:hover {
  transform: translateY(-1px);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(420px, 1fr);
  gap: 22px;
  max-width: 1360px;
  margin: 0 auto;
  align-items: stretch;
}

.editor {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 22px 58px rgba(43, 47, 42, 0.09), inset 0 1px 2px rgba(255, 255, 255, 0.84);
  padding: 22px;
  backdrop-filter: blur(22px) saturate(1.1);
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.section-title {
  margin-bottom: 16px;
  color: #252823;
  font-size: 16px;
  font-weight: 780;
}

.field-group,
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field-label {
  color: #51564f;
  font-size: 12px;
  font-weight: 780;
}

.format-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  padding: 5px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.75);
}

.format-button {
  height: 42px;
  gap: 8px;
  border-radius: 999px;
  background: transparent;
  color: #555a52;
  font-size: 13px;
  font-weight: 780;
}

.format-button.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: #10130f;
  box-shadow: 0 10px 24px rgba(43, 47, 42, 0.1), inset 0 1px 1px rgba(255, 255, 255, 1);
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.style-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 82px;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  color: #30342f;
  padding: 10px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.82);
  transition: border 160ms ease, transform 160ms ease, background 160ms ease;
}

.style-card.is-active {
  border-color: rgba(15, 118, 110, 0.58);
  background: rgba(255, 255, 255, 0.86);
}

.style-swatch {
  display: block;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.style-swatch.pearl {
  background: linear-gradient(120deg, #ffffff, #dde9e4 48%, #c5a96d);
}

.style-swatch.obsidian {
  background: linear-gradient(120deg, #151714, #30322d 54%, #d5bc78);
}

.style-swatch.jade {
  background: linear-gradient(120deg, #f4fbf6, #0f766e 52%, #d7c791);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  outline: 0;
  padding: 12px 13px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.86);
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #596058 50%),
    linear-gradient(135deg, #596058 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 13px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.84);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-box {
  position: relative;
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 104px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  color: #484d45;
  font-size: 13px;
  font-weight: 720;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.84);
  transition: transform 160ms ease, border 160ms ease, background 160ms ease;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  color: #0f766e;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.92);
}

.analytics-panel {
  align-self: start;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
  padding: 13px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.86);
}

.metric-card span,
.insight-row span {
  color: #697069;
  font-size: 12px;
  font-weight: 760;
}

.metric-card strong {
  color: #171a17;
  font-size: 28px;
  line-height: 1;
}

.insight-list {
  display: grid;
  gap: 11px;
}

.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.insight-row strong {
  color: #22261f;
  font-size: 13px;
  text-align: right;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 1px rgba(80, 88, 79, 0.08);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #c0a56b);
  transition: width 180ms ease;
}

.preview-stage {
  position: sticky;
  top: 24px;
  display: grid;
  min-height: calc(100vh - 66px);
  place-content: center;
  justify-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(231, 237, 231, 0.66)),
    #eef1eb;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.86);
  overflow: hidden;
  padding: 44px 24px;
}

.preview-stage::before,
.preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
}

.preview-stage::before {
  background-image: url("data:image/svg+xml,%3Csvg width='900' height='680' viewBox='0 0 900 680' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-36 508C112 399 267 442 421 328C572 216 724 146 940 196' fill='none' stroke='%23b99e63' stroke-opacity='.22' stroke-width='2'/%3E%3Cpath d='M-35 588C148 468 300 493 483 385C647 288 765 266 940 315' fill='none' stroke='%230f766e' stroke-opacity='.13' stroke-width='1.4'/%3E%3Cpath d='M80 152C220 80 352 78 514 129C660 175 730 183 880 102' fill='none' stroke='%23ffffff' stroke-opacity='.58' stroke-width='1.2'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  opacity: 0.9;
}

.preview-stage::after {
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.72) 0%, transparent 28%),
    linear-gradient(318deg, rgba(15, 118, 110, 0.12), transparent 32%);
}

.preview-holder {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 100%;
}

.business-card {
  --card-bg: rgba(255, 255, 255, 0.54);
  --card-text: #171916;
  --card-muted: #60675f;
  --card-line: rgba(255, 255, 255, 0.58);
  --card-rule: rgba(15, 118, 110, 0.16);
  --card-accent: #b99f62;
  --card-glow: rgba(255, 255, 255, 0.72);
  --avatar-bg: rgba(255, 255, 255, 0.52);
  --avatar-line: rgba(255, 255, 255, 0.7);
  --avatar-text: #0f766e;
  --qr-bg: rgba(255, 255, 255, 0.74);
  --qr-ink: #1b211d;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-line);
  border-radius: 34px;
  padding: 30px;
  color: var(--card-text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.16) 42%, rgba(255, 255, 255, 0.48)),
    var(--card-bg);
  box-shadow: 0 34px 88px rgba(37, 42, 37, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(28px) saturate(1.18);
}

.business-card::before,
.business-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.business-card::before {
  background-image: url("data:image/svg+xml,%3Csvg width='820' height='620' viewBox='0 0 820 620' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-70 430C95 317 240 348 390 238C529 136 660 94 888 170' fill='none' stroke='white' stroke-opacity='.32' stroke-width='1.5'/%3E%3Cpath d='M-54 502C98 425 245 421 410 328C578 234 692 226 890 278' fill='none' stroke='white' stroke-opacity='.18' stroke-width='1.1'/%3E%3Cpath d='M50 92C172 42 303 56 420 98C554 146 636 140 770 62' fill='none' stroke='white' stroke-opacity='.28' stroke-width='1'/%3E%3C/svg%3E");
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.business-card::after {
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.5), transparent 22%),
    linear-gradient(315deg, var(--card-glow), transparent 30%);
  opacity: 0.8;
}

.format-landscape {
  width: min(740px, 88vw);
  min-height: 416px;
  aspect-ratio: 1.78 / 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "head help"
    "tag help"
    "doing foot";
  column-gap: 34px;
  row-gap: 18px;
}

.format-portrait {
  width: min(392px, 88vw);
  min-height: 660px;
}

.card-glow {
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 240px;
  border-radius: 45% 55% 42% 58%;
  background: var(--card-glow);
  filter: blur(18px);
  opacity: 0.72;
}

.card-head,
.card-foot,
.story-block,
.tagline {
  position: relative;
  z-index: 1;
}

.card-head {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  display: grid;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--avatar-line);
  border-radius: 26px;
  background: var(--avatar-bg);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.92), 0 12px 28px rgba(38, 42, 37, 0.1);
  color: var(--avatar-text);
  font-size: 34px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.avatar img,
.qr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity {
  min-width: 0;
}

.card-kicker {
  margin-bottom: 7px;
  color: var(--card-muted);
  font-size: 12px;
  font-weight: 800;
}

.identity h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.identity p {
  margin: 9px 0 0;
  color: var(--card-muted);
  font-size: 15px;
  line-height: 1.35;
}

.tagline {
  grid-area: tag;
  align-self: center;
  margin: 0;
  border-left: 2px solid var(--card-accent);
  padding-left: 14px;
  color: var(--card-text);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.35;
}

.story-block {
  border-top: 1px solid var(--card-rule);
  padding: 17px 0 0;
}

.format-landscape .story-block:nth-of-type(1) {
  grid-area: doing;
}

.format-landscape .story-block:nth-of-type(2) {
  grid-area: help;
  border-top: 0;
  border-left: 1px solid var(--card-rule);
  padding: 4px 0 0 26px;
}

.format-portrait .tagline {
  margin: 34px 0 28px;
}

.format-portrait .story-block {
  margin-top: 21px;
  padding-top: 21px;
}

.mini-title {
  margin-bottom: 10px;
  color: var(--card-muted);
  font-size: 12px;
  font-weight: 830;
}

.story-block p {
  margin: 0;
  font-size: 16px;
  line-height: 1.72;
}

.format-landscape .story-block p {
  font-size: 15px;
  line-height: 1.62;
}

.card-foot {
  grid-area: foot;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.format-portrait .card-foot {
  margin-top: 46px;
}

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

.meta-list:empty {
  display: none;
}

.meta-list span {
  border: 1px solid var(--card-rule);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--card-muted);
  font-size: 12px;
  font-weight: 780;
  backdrop-filter: blur(10px);
}

.qr {
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  background: var(--qr-bg);
  color: var(--qr-ink);
  padding: 8px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.86);
}

.qr svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}

.theme-pearl {
  --card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(222, 237, 232, 0.32) 56%, rgba(245, 237, 216, 0.38));
  --card-text: #171a17;
  --card-muted: #697069;
  --card-line: rgba(255, 255, 255, 0.78);
  --card-rule: rgba(15, 118, 110, 0.14);
  --card-accent: #b99f62;
  --card-glow: rgba(15, 118, 110, 0.14);
  --avatar-bg: rgba(255, 255, 255, 0.54);
  --avatar-line: rgba(255, 255, 255, 0.82);
  --avatar-text: #0f766e;
  --qr-bg: rgba(255, 255, 255, 0.72);
  --qr-ink: #1a201c;
}

.theme-obsidian {
  --card-bg: linear-gradient(148deg, rgba(22, 24, 21, 0.82), rgba(50, 52, 47, 0.72) 55%, rgba(77, 67, 43, 0.72));
  --card-text: #fbf4df;
  --card-muted: #d1c7aa;
  --card-line: rgba(255, 255, 255, 0.22);
  --card-rule: rgba(232, 206, 139, 0.18);
  --card-accent: #d7bd78;
  --card-glow: rgba(215, 189, 120, 0.2);
  --avatar-bg: rgba(255, 255, 255, 0.12);
  --avatar-line: rgba(255, 255, 255, 0.22);
  --avatar-text: #d7bd78;
  --qr-bg: rgba(255, 249, 226, 0.84);
  --qr-ink: #191a16;
}

.theme-jade {
  --card-bg: linear-gradient(145deg, rgba(244, 251, 246, 0.68), rgba(15, 118, 110, 0.26) 58%, rgba(225, 211, 163, 0.28));
  --card-text: #073b37;
  --card-muted: #52736d;
  --card-line: rgba(255, 255, 255, 0.7);
  --card-rule: rgba(7, 59, 55, 0.16);
  --card-accent: #bba66c;
  --card-glow: rgba(15, 118, 110, 0.18);
  --avatar-bg: rgba(255, 255, 255, 0.48);
  --avatar-line: rgba(255, 255, 255, 0.76);
  --avatar-text: #0f766e;
  --qr-bg: rgba(241, 250, 245, 0.78);
  --qr-ink: #073e3a;
}

.preview-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px;
  box-shadow: 0 18px 42px rgba(43, 47, 42, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #161815, #2d2f2a);
  color: #f9efd3;
}

.status {
  min-width: 90px;
  padding: 0 10px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

@media (max-width: 1180px) {
  .format-landscape {
    width: min(640px, 88vw);
    min-height: 360px;
    column-gap: 22px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 18px;
  }

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

  .preview-stage {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .format-landscape {
    width: min(392px, 88vw);
    min-height: 660px;
    aspect-ratio: auto;
    display: block;
  }

  .format-landscape .tagline {
    margin: 34px 0 28px;
  }

  .format-landscape .story-block,
  .format-landscape .story-block:nth-of-type(2) {
    border-left: 0;
    border-top: 1px solid var(--card-rule);
    margin-top: 21px;
    padding: 21px 0 0;
  }

  .format-landscape .card-foot {
    margin-top: 46px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .top-actions,
  .two-col,
  .upload-row,
  .style-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    display: grid;
    width: 100%;
  }

  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .panel {
    padding: 18px;
  }

  .preview-stage {
    padding: 28px 12px;
  }

  .style-card {
    min-height: 72px;
  }

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

  .business-card {
    padding: 22px;
  }

  .identity h2 {
    font-size: 31px;
  }

  .tagline {
    font-size: 18px;
  }

  .card-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}
