:root {
  --ink: #121417;
  --muted: #68707d;
  --line: #e4e8ee;
  --panel: #ffffff;
  --canvas-bg: #eef2f7;
  --accent: #2563eb;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f7f8fb;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden { display: none !important; }

.libraryPage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto;
  background: #ffffff;
}

.libraryHeader {
  height: 58px;
  margin: 0;
  padding: 0 clamp(22px, 3.125vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid #f0f2f6;
}

.brandLockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brandMark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #5b2cff 56%, #8b5cf6 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .3);
}

.brandMark svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.brandName {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.accountButton {
  min-width: 76px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
}

.libraryHeader h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.libraryHeader .eyebrow {
  margin-bottom: 4px;
  color: rgba(255,255,255,.55);
}

.platformTabs {
  position: absolute;
  left: 50%;
  top: 13px;
  z-index: 3;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  transform: translateX(-50%);
}

.platformTab {
  height: 32px;
  min-width: 94px;
  padding: 0 20px;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  background: #ffffff;
  color: #677181;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(19, 25, 36, .04);
}

.platformTab.active {
  border-color: #111418;
  background: #111418;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(19, 25, 36, .16);
}

.templateGrid {
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(22px, 2.5vw, 40px) clamp(34px, 4vw, 72px) 72px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: clamp(30px, 3vw, 54px);
  background: #ffffff;
}

.templateGrid.isSingleTemplate {
  max-width: 700px;
  grid-template-columns: minmax(0, 1fr);
}

.templateGrid.isSingleTemplate.isIpadPlatform {
  max-width: min(920px, calc(100vw - 28px));
  padding-left: clamp(14px, 3vw, 48px);
  padding-right: clamp(14px, 3vw, 48px);
}

.siteFooter {
  position: fixed;
  left: clamp(18px, 3.125vw, 64px);
  bottom: 18px;
  z-index: 20;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.infoMenuButton {
  height: 32px;
  padding: 0 13px;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .84);
  color: #68707d;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .07);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.infoMenuButton:hover {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .1);
}

.siteRecordLinks {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a93a3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: auto;
}

.siteRecordLinks a {
  color: inherit;
  text-decoration: none;
}

.siteRecordLinks a:hover {
  color: var(--ink);
}

.templateCard {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.templateCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(19, 25, 36, .08);
}

.templateCard:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .42);
  outline-offset: 3px;
}

.templatePreview {
  height: 300px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #edf1f6;
}

.libraryTemplateCard {
  width: 100%;
  height: clamp(230px, 19.6vw, 335px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.templateGrid.isIpadPlatform .libraryTemplateCard {
  height: clamp(220px, 20vw, 300px);
}

.templateGrid.isSingleTemplate.isIpadPlatform .libraryTemplateCard {
  height: clamp(300px, 29vw, 380px);
}

.realTemplatePreview {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  flex: 0 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  transform: translateZ(0);
}

.templateGrid.isIpadPlatform .realTemplatePreview {
  gap: 12px;
}

.previewCell {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
}

.widePreviewCell {
  grid-column: 1 / -1;
}

.previewCell img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.previewCell img.isLayeredPreview {
  transform: none;
}

.realTemplatePreview.isRenderingLayered .previewCell img {
  opacity: .55;
  filter: saturate(.75);
}

.realTemplatePreview.isLayeredReady .previewCell img {
  opacity: 1;
  filter: none;
}

.realTemplatePreview .libraryPreviewImage {
  border-radius: 0;
  object-fit: cover;
  box-shadow: none;
}

.miniShot {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  box-shadow: 0 16px 28px rgba(16, 24, 40, .22);
}

.miniTitle {
  position: absolute;
  left: 12%;
  top: 8%;
  width: 76%;
  color: var(--mini-title, #111827);
  font-size: 13px;
  line-height: 1.03;
  font-weight: 950;
  letter-spacing: 0;
}

.miniPhone {
  position: absolute;
  left: var(--mini-phone-x, 30%);
  top: var(--mini-phone-y, 38%);
  width: var(--mini-phone-w, 44%);
  height: var(--mini-phone-h, 46%);
  border: 5px solid #080a0f;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0,0,0,.32);
  transform: rotate(var(--mini-rot, 0deg));
}

.miniPhone::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 12px;
  border-radius: 20px;
  background: #050608;
}

.templateInfo {
  display: none;
}

.templateInfo h2,
.templateInfo p {
  display: none;
}

.templateBadge {
  display: none;
}

.libraryTemplateCard.isSoon .templateBadge {
  background: rgba(255,255,255,.86);
  color: #68707d;
}

.studioPage {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: 66px minmax(0, 1fr);
  background: var(--canvas-bg);
}

.studioTopbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  background: #111418;
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.studioActions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studioActions {
  margin-left: auto;
}

.backHomeButton {
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
}

.backHomeButton span:first-child {
  font-size: 26px;
  line-height: 1;
  font-weight: 950;
}

.backHomeButton:hover {
  color: rgba(255,255,255,.82);
}

.iconButton {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #ffffff;
  color: #111418;
  font-size: 19px;
  font-weight: 900;
}

.primaryButton,
.secondaryButton {
  height: 38px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 900;
}

.primaryButton {
  background: var(--accent);
  color: #ffffff;
}

.secondaryButton {
  background: #111827;
  color: #ffffff;
}

.secondaryButton.light {
  color: #ffffff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
}

.storyWorkspace {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  position: relative;
}

.textInspector {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px 14px;
  background: #ffffff;
  border-left: 1px solid #dfe5ee;
}

.textInspector h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 950;
}

.inspectorEmpty {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.inspectorEmpty h3,
.inspectorForm h3 {
  color: var(--ink);
}

.inspectorEmpty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.inspectorForm {
  display: grid;
  gap: 10px;
}

.backgroundInspector {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5ebf2;
}

.inspectorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inspectorHeader span {
  min-width: 58px;
  height: 22px;
  padding: 0 7px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #68707d;
  font-size: 11px;
  font-weight: 900;
}

.fieldGroup {
  display: grid;
  gap: 5px;
}

.fieldGroup span {
  color: #68707d;
  font-size: 11px;
  font-weight: 900;
}

.fieldGroup input,
.fieldGroup select,
.fieldGroup textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  outline: 0;
}

.fieldGroup input,
.fieldGroup select {
  height: 32px;
  padding: 0 9px;
}

.fieldGroup textarea {
  resize: vertical;
  min-height: 78px;
  max-height: 118px;
  padding: 8px;
  line-height: 1.38;
}

.fieldGroup input:focus,
.fieldGroup select:focus,
.fieldGroup textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

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

.sizeField {
  gap: 7px;
}

.fontSizeControl {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 7px;
}

.fontSizeControl input {
  height: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.fontSizeControl input::-webkit-outer-spin-button,
.fontSizeControl input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.fontSizeControl input[type="number"] {
  -moz-appearance: textfield;
}

.sizeStepButton {
  height: 36px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.sizeStepButton:hover {
  background: #eef2f7;
}

.sizeStepButton:active {
  transform: translateY(1px);
}

.fieldGroup .fontSizeRange {
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--accent);
}

.colorField {
  grid-template-columns: 1fr 56px;
  align-items: center;
}

.colorField input {
  height: 32px;
  padding: 4px;
}

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

.backgroundPresetButton {
  aspect-ratio: 1.05;
  border: 2px solid #ffffff;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.12), 0 4px 9px rgba(17,24,39,.08);
  cursor: pointer;
}

.backgroundPresetButton:hover {
  transform: translateY(-1px);
}

.backgroundPresetButton.isActive {
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.86), 0 0 0 3px var(--accent), 0 8px 18px rgba(37,99,235,.18);
}

.backgroundPresetButton:disabled,
.fieldGroup input:disabled,
.secondaryWideButton:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.secondaryWideButton {
  width: 100%;
  height: 34px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.secondaryWideButton:hover {
  background: #eef2f7;
}

.secondaryWideButton:active {
  transform: translateY(1px);
}

.storyViewport {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: clamp(18px, 2.2vw, 34px);
}

.storyBox {
  position: relative;
  margin: 0 auto;
}

.storyStrip {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.artboard {
  position: absolute;
  top: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 22px 58px rgba(19, 25, 36, .18);
}

.artboard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.06);
}

.shape,
.headline,
.phone,
.screen,
.templateBase,
.standardDeviceLayer,
.deviceLayer,
.deviceScreen,
.deviceIsland,
.deviceFrameImage,
.framedScreenLayer,
.badgeLayer,
.editableTextLayer,
.shapeLayer,
.screenshotSlot {
  position: absolute;
  box-sizing: border-box;
}

.realArtboard {
  background: #111418;
}

.templateBase {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

.shapeLayer {
  pointer-events: none;
  transform-origin: 50% 50%;
}

.deviceLayer {
  z-index: 12;
  background: #07090d;
  box-shadow: 0 58px 120px rgba(0,0,0,.34);
  transform-origin: 50% 50%;
  --device-border: 22px;
  --device-inset: 11px;
  --device-radius: 116px;
  --island-top: 42px;
  --island-width: 116px;
  --island-height: 30px;
  --island-radius: 16px;
}

.deviceLayer::before {
  content: "";
  position: absolute;
  inset: var(--device-inset);
  border: var(--device-border) solid rgba(255,255,255,.16);
  border-radius: calc(var(--device-radius) - var(--device-inset));
  pointer-events: none;
  z-index: 4;
}

.deviceScreen {
  overflow: hidden;
  z-index: 2;
  border: 0;
  padding: 0;
  text-align: left;
  background: #f8fafc;
  background-repeat: no-repeat;
  cursor: pointer;
}

.deviceIsland {
  top: var(--island-top);
  left: 50%;
  width: var(--island-width);
  height: var(--island-height);
  transform: translateX(-50%);
  border-radius: var(--island-radius);
  background: #030407;
  z-index: 5;
  pointer-events: none;
}

.sampleScreen {
  width: 100%;
  height: 100%;
  padding: 12% 9%;
  background: linear-gradient(180deg, #ffffff, #eef2f7);
}

.sampleBar,
.sampleHero {
  border-radius: 28px;
}

.sampleBar {
  height: 4.8%;
  margin-top: 9%;
  background: var(--sample-muted, rgba(20,184,166,.16));
}

.sampleBar.short {
  width: 32%;
  margin-top: 0;
  background: rgba(17,24,39,.13);
}

.sampleHero {
  height: 17%;
  margin-top: 18%;
  background: var(--sample-accent, #14b8a6);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.76);
  font-size: 92px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.sampleHero span {
  display: block;
  transform: scale(.86);
  transform-origin: center;
}

.deviceLayer:hover .replacePill {
  opacity: 1;
}

.standardDeviceLayer {
  z-index: 16;
  transform-origin: 50% 50%;
  cursor: move;
  touch-action: none;
}

.deviceFrameImage {
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.framedScreenLayer {
  z-index: 1;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #f8fafc;
  background-repeat: no-repeat;
  cursor: pointer;
  touch-action: none;
  transform-origin: 50% 50%;
}

.framedScreenLayer:hover::after,
.framedScreenLayer.hasUpload:hover::after {
  opacity: 1;
}

.framedScreenLayer::after {
  content: "上传截图";
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  min-width: 128px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(17,24,39,.86);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.framedScreenLayer.hasUpload::after {
  content: "替换截图";
}

.badgeLayer {
  z-index: 20;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  outline: 0;
  box-shadow: 0 18px 36px rgba(30, 17, 166, .22), inset 0 1px 0 rgba(255,255,255,.22);
  cursor: text;
  user-select: text;
}

.editableTextLayer {
  z-index: 20;
  min-height: 1em;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  cursor: move;
  user-select: text;
}

.textResizeHandle {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 7px solid #ffffff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 8px 18px rgba(37,99,235,.28), 0 0 0 2px rgba(37,99,235,.34);
  cursor: ew-resize;
  display: none;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.textResizeHandle.left {
  left: 0;
  transform: translate(-50%, -50%);
}

.textResizeHandle.right {
  right: 0;
  transform: translate(50%, -50%);
}

.editableTextLayer.isSelected .textResizeHandle,
.editableTextLayer:focus .textResizeHandle {
  display: block;
}

.badgeLayer:focus,
.editableTextLayer:focus,
.editableTextLayer.isSelected {
  outline: 2px solid rgba(37, 99, 235, .75);
  outline-offset: 8px;
}

.isDraggingText,
.isDraggingText *,
.isResizingText,
.isResizingText *,
.isDraggingDevice,
.isDraggingDevice * {
  cursor: grabbing !important;
  user-select: none !important;
}

.isResizingText,
.isResizingText * {
  cursor: ew-resize !important;
}

.screenshotSlot {
  z-index: 14;
  overflow: hidden;
  border: 0;
  padding: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  opacity: 1;
  cursor: pointer;
}

.screenshotSlot.hasUpload {
  opacity: 1;
}

.screenshotSlot span {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  min-width: 120px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(17,24,39,.86);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
}

.realArtboard:hover .screenshotSlot span,
.screenshotSlot.hasUpload:hover span {
  opacity: 1;
}

.headline {
  z-index: 10;
  pointer-events: none;
}

.headline .label {
  margin: 0 0 28px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 950;
  opacity: .68;
}

.headline h3 {
  margin: 0;
  font-size: var(--title-size, 100px);
  line-height: .98;
  letter-spacing: 0;
  font-weight: 950;
  white-space: pre-line;
}

.headline p {
  margin: 30px 0 0;
  font-size: var(--subtitle-size, 36px);
  line-height: 1.32;
  font-weight: 780;
  opacity: .75;
  white-space: pre-line;
}

.phone {
  z-index: 16;
  background: #080a0f;
  border-radius: var(--phone-radius, 120px);
  box-shadow: 0 56px 120px rgba(0,0,0,.34);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 5px solid rgba(255,255,255,.16);
  border-radius: calc(var(--phone-radius, 120px) - 18px);
  pointer-events: none;
  z-index: 3;
}

.phone::after {
  content: "";
  position: absolute;
  top: var(--island-top, 54px);
  left: 50%;
  width: var(--island-width, 160px);
  height: var(--island-height, 44px);
  transform: translateX(-50%);
  border-radius: 99px;
  background: #050608;
  z-index: 4;
  pointer-events: none;
}

.screen {
  overflow: hidden;
  z-index: 1;
  border: 0;
  padding: 0;
  text-align: left;
  background: #f8fafc;
  background-repeat: no-repeat;
}

.screen.hasImage {
  cursor: pointer;
}

.replacePill {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 20;
  transform: translateX(-50%);
  min-width: 150px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(17,24,39,.86);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.phone:hover .replacePill {
  opacity: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(0,0,0,.24);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.accountModalOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, .42);
  backdrop-filter: blur(8px);
}

.accountModal {
  position: relative;
  width: min(420px, 100%);
  padding: 30px 28px 26px;
  border: 1px solid rgba(226, 232, 240, .96);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .24);
}

.modalCloseButton {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.modalCloseButton:hover {
  background: #e2e8f0;
  color: #111827;
}

.modalIcon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--accent);
}

.modalIcon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.accountModal h2 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: 0;
}

.accountModal p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 700;
}

.infoModal {
  width: min(360px, 100%);
  padding-top: 28px;
}

.infoModal h2 {
  margin-top: 0;
}

.infoLinkList {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.infoLinkList a {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.infoLinkList a::after {
  content: "›";
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
}

.infoLinkList a:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.infoRecordText {
  margin-top: 14px !important;
  color: #94a3b8 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.modalActions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.modalTextLink {
  color: #475569;
  font-size: 13px;
  line-height: 38px;
  font-weight: 900;
  text-decoration: none;
}

.modalTextLink:hover {
  color: var(--accent);
}

@media (max-width: 1040px) {
  .templateGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .templateGrid.isSingleTemplate {
    grid-template-columns: minmax(0, 1fr);
  }
  .templateGrid.isSingleTemplate.isIpadPlatform {
    max-width: 860px;
  }
}

@media (max-width: 720px) {
  .libraryPage { grid-template-rows: 62px 44px minmax(0, 1fr) auto; }
  .libraryHeader {
    height: 62px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 14px;
  }
  .brandName { font-size: 17px; }
  .brandMark {
    width: 32px;
    height: 32px;
  }
  .accountButton {
    min-width: 66px;
    padding: 0 16px;
  }
  .platformTabs {
    position: static;
    transform: none;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 6px 14px 0;
  }
  .platformTab {
    min-width: 94px;
    padding: 0 18px;
  }
  .templateGrid {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 24px;
  }
  .templateGrid.isSingleTemplate {
    grid-template-columns: minmax(0, 1fr);
  }
  .siteFooter {
    left: 14px;
    bottom: 14px;
  }
  .libraryTemplateCard {
    height: clamp(150px, 36vw, 230px);
  }
  .templateGrid.isIpadPlatform .libraryTemplateCard {
    height: clamp(220px, 58vw, 320px);
  }
  .realTemplatePreview {
    overflow: hidden;
  }
  .studioPage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 110px minmax(0, 1fr) 260px;
  }
  .studioTopbar {
    grid-column: 1;
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
    padding: 12px;
    gap: 10px;
  }
  .backHomeButton {
    align-self: flex-start;
    height: 34px;
  }
  .storyWorkspace {
    grid-column: 1;
    grid-row: 2;
  }
  .textInspector {
    grid-column: 1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid #dfe5ee;
  }
  .studioActions { width: 100%; }
  .studioActions button { flex: 1; }
  .studioActions .accountButton { flex: 0 0 76px; }
  .storyViewport { padding: 24px; }
  .accountModal {
    padding: 26px 22px 22px;
  }
  .modalActions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .modalTextLink {
    line-height: 1.2;
    text-align: center;
  }
}
