    :root {
      --bg: #f8fafc;
      --panel: #ffffff;
      --card: #f1f5f9;
      --muted: #64748b;
      --text: #1e293b;
      --accent: #3b82f6;
      --accent-2: #6366f1;
      --green: #10b981;
      --red: #ef4444;
      --yellow: #f59e0b;
      --border: #e2e8f0;
      --shadow: 0 10px 30px rgba(0,0,0,.08);
      --transition: all 0.3s ease;
      --radius-lg: 16px;
      --radius-md: 12px;
      --radius-sm: 8px;
      --header-height: 70px;
    }

	[data-theme="dark"] {
  --bg: #0f1117;
  --panel: #161921;
  --card: #1c1f2b;
  --muted: #a0a8ba;
  --text: #f2f4ff;
  --accent: #6d8bff;
  --accent-2: #9f70ff;
  --green: #21e39d;
  --red: #ff5f70;
  --yellow: #ffcf5d;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 12px 35px rgba(0,0,0,0.45);
	}

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html, body {
      height: 100%;
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
	  background: url('/theme/image/background.svg') no-repeat center center fixed; 
	  background-size: cover;
      background: var(--bg);
	  padding-top: 70px;
      color: var(--text);
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
      font-size: 16px;
      line-height: 1.6;
      transition: background-color 0.3s ease, color 0.3s ease;
    }

    a {
      color: var(--accent);
      text-decoration: none;
    }

    /* Header */
    .header-story {
      position: relative;
      z-index: 50;
      background: var(--panel);
      backdrop-filter: blur(6px);
      border-bottom: 1px solid var(--border);
      transition: var(--transition);
      height: var(--header-height);
      display: flex;
      align-items: center;
    }

    .wrap {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 16px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

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

    .brand .logo {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      display: grid;
      place-items: center;
      box-shadow: var(--shadow);
      flex-shrink: 0;
    }

    .brand .logo span {
      font-weight: 800;
      color: white;
    }

    .brand-text {
      display: flex;
      flex-direction: column;
    }

    h1 {
      margin: 0;
      font-size: 18px;
      font-weight: 700;
    }

    .sub {
      color: var(--muted);
      font-size: 13px;
      margin-top: 2px;
    }

    .theme-toggle {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: var(--transition);
    }

    .theme-toggle:hover {
      background: var(--accent);
      color: white;
    }

    /* Steps */
    .steps {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 8px;
      max-width: 200px;
    }

    .step {
      height: 6px;
      border-radius: 999px;
      background: var(--border);
      position: relative;
      overflow: hidden;
    }

    .step>span {
      position: absolute;
      inset: 0;
      width: 0%;
      background: linear-gradient(90deg, var(--accent), var(--accent-2));
      transition: width .6s ease;
    }

    /* layout */
    .container {
      display: grid;
      grid-template-columns: 360px 1fr 280px;
      gap: 20px;
      align-items: start;
      margin: 20px auto;
      max-width: 1200px;
      padding: 0 16px;
      min-height: calc(100vh - var(--header-height) - 40px);
    }

    @media (max-width: 1100px) {
      .container {
        grid-template-columns: 340px 1fr;
      }
    }

    @media (max-width: 900px) {
      .container {
        grid-template-columns: 1fr;
        gap: 16px;
      }
    }

    /* Panel styling */
    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
      transition: var(--transition);
      overflow: hidden;
    }

    .panel .head {
      padding: 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 600;
    }

    .panel .body {
      padding: 16px;
    }

    .controls {
      display: grid;
      gap: 16px;
    }

    .group {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      transition: var(--transition);
    }

    .group .ghead {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 600;
    }

    .group .gbody {
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    label {
      display: block;
      font-weight: 600;
      margin-bottom: 8px;
      font-size: 14px;
    }

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

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

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

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

    /* Form elements */
    input[type="text"],
    input[type="number"],
    textarea,
    select {
      width: 100%;
      padding: 12px 14px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: var(--panel);
      color: var(--text);
      outline: none;
      font-family: inherit;
      font-size: 14px;
      transition: var(--transition);
    }

    input[type="text"]:focus,
    input[type="number"]:focus,
    textarea:focus,
    select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

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

    input[type="color"] {
      width: 40%;
      height: 44px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: var(--panel);
      padding: 0;
      cursor: pointer;
    }

    input[type="range"] {
      width: 100%;
      -webkit-appearance: none;
      appearance: none;
      height: 6px;
      background: var(--border);
      border-radius: 3px;
      outline: none;
    }

    input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: 2px solid var(--panel);
      box-shadow: 0 0 0 1px var(--border);
    }

    input[type="range"]::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: 2px solid var(--panel);
      box-shadow: 0 0 0 1px var(--border);
    }

    /* Buttons */
    .btn {
      appearance: none;
      border: none;
      border-radius: var(--radius-md);
      padding: 12px 16px;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      color: white;
      font-weight: 600;
      font-size: 14px;
      cursor: pointer;
      box-shadow: var(--shadow);
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    }

    .btn.secondary {
      background: var(--card);
      color: var(--text);
    }

    .btn.ghost {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
    }

    .btn.block {
      width: 100%;
    }

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

    .toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    /* Preview area */
    .preview-wrap {
      display: grid;
      gap: 16px;
    }

    .canvas-holder {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      display: grid;
      place-items: center;
      position: relative;
    }

    .zoom {
      position: absolute;
      top: 16px;
      right: 16px;
      display: flex;
      gap: 8px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 6px;
      box-shadow: var(--shadow);
    }

    .zoom button {
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--card);
	  opacity: 50%;
      color: var(--text);
      padding: 6px 12px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 13px;
    }

    .zoom button:hover,
    .zoom button.active {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }

    #storyCanvas {
      width: 360px;
      height: 640px;
      border-radius: var(--radius-lg);
      box-shadow: 0 20px 60px rgba(0,0,0,.15);
      background: #000;
      transition: var(--transition);
    }

    .hint {
      font-size: 13px;
      color: var(--muted);
      text-align: center;
    }

    /* Info tooltip */
    .info {
      border: none;
      background: var(--card);
      color: var(--muted);
      border-radius: 50%;
      width: 20px;
      height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: var(--transition);
      font-size: 12px;
      font-weight: bold;
    }

    .info:hover {
      background: var(--accent);
      color: white;
    }

    .tooltip {
      position: fixed;
      z-index: 999;
      background: var(--panel);
      border: 1px solid var(--border);
      padding: 12px 14px;
      border-radius: var(--radius-md);
      max-width: 280px;
      box-shadow: var(--shadow);
      display: none;
      font-size: 13px;
      line-height: 1.5;
    }

    .tooltip.show {
      display: block;
    }

    /* Elements styling */
    .elements-container {
      display: grid;
      gap: 14px;
    }

    .element-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 16px;
      position: relative;
      animation: fadeIn 0.3s ease;
    }

    .element-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
    }

    .element-type {
      font-weight: 700;
      color: var(--accent);
      font-size: 14px;
    }

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

    .element-actions button {
      background: transparent;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 6px;
      border-radius: 6px;
      transition: var(--transition);
      font-size: 14px;
    }

    .element-actions button:hover {
      color: var(--accent);
      background: var(--card);
    }

    .add-element-btn {
      width: 100%;
      margin-top: 10px;
    }

    /* Ads */
    .ads {
      display: grid;
      gap: 16px;
    }

    .ad {
      background: var(--card);
      border: 1px dashed var(--border);
      border-radius: var(--radius-md);
      height: 250px;
      display: grid;
      place-items: center;
      color: var(--muted);
    }

    .ad.small {
      height: 120px;
    }

    /* Footer content */
    .content {
      max-width: 1200px;
      margin: 40px auto;
      padding: 0 16px;
    }

    .content h2 {
      font-size: 22px;
      margin: 24px 0 14px;
      font-weight: 700;
    }

    .content p, .content li {
      color: var(--text);
      margin-bottom: 12px;
      line-height: 1.6;
    }

    .content ol, .content ul {
      padding-left: 20px;
      margin-bottom: 20px;
    }

    .content li {
      margin-bottom: 8px;
    }

    .faq details {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      margin: 10px 0;
      transition: var(--transition);
    }

    .faq details[open] {
      background: var(--card);
    }

    .faq summary {
      cursor: pointer;
      font-weight: 600;
      transition: var(--transition);
    }

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

    .faq p {
      margin-top: 12px;
    }

    .pill {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      padding: 6px 12px;
      border-radius: 999px;
      background: var(--card);
      border: 1px solid var(--border);
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
    }

    /* Mobile optimizations */
    @media (max-width: 768px) {
      :root {
        --header-height: 60px;
      }
      
      .container {
        gap: 16px;
        margin: 16px auto;
      }
      
      .panel {
        border-radius: var(--radius-md);
      }
      
      .group {
        border-radius: var(--radius-md);
      }
      
      .row, .row3 {
        grid-template-columns: 1fr;
      }
      
      .zoom {
        top: 12px;
        right: 12px;
      }
      
      #storyCanvas {
        width: 300px;
        height: 533px;
      }
      
      .brand .logo {
        width: 36px;
        height: 36px;
      }
      
      h1 {
        font-size: 16px;
      }
      
      .sub {
        font-size: 12px;
      }
      
      .theme-toggle {
        width: 36px;
        height: 36px;
      }
    }

    @media (max-width: 480px) {
      #storyCanvas {
        width: 270px;
        height: 480px;
      }
      
      .wrap {
        padding: 0 12px;
      }
      
      .panel .head, .panel .body {
        padding: 14px;
      }
      
      .group .ghead, .group .gbody {
        padding: 12px 14px;
      }
      
      .btn {
        padding: 10px 14px;
        font-size: 13px;
      }
      
      .toolbar {
        gap: 8px;
      }
      
      .canvas-holder {
        padding: 16px;
      }
    }

    /* Animation for new elements */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Theme transition */
    * {
      transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    }

/* Tailwind-like utility classes */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-blue-900 { --tw-gradient-from: #1e3a8a; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(30, 58, 138, 0)); }
.to-purple-900 { --tw-gradient-to: #581c87; }
.from-purple-800 { --tw-gradient-from: #6b21a8; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(107, 33, 168, 0)); }
.to-blue-800 { --tw-gradient-to: #1e40af; }
.bg-opacity-50 { background-color: rgba(255, 255, 255, 0.5); }
.rounded-2xl { border-radius: 1rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-lg { border-radius: 0.5rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.p-8 { padding: 2rem; }
.p-6 { padding: 1.5rem; }
.p-5 { padding: 1.25rem; }
.p-4 { padding: 1rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-12 { margin-top: 3rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-white { color: #fff; }
.text-blue-100 { color: #dbeafe; }
.text-blue-200 { color: #bfdbfe; }
.text-blue-300 { color: #93c5fd; }
.text-purple-400 { color: #c084fc; }
.text-gray-300 { color: #d1d5db; }
.text-indigo-200 { color: #c7d2fe; }
.text-center { text-align: center; }
.inline-block { display: inline-block; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}