:root {
      --primary: #6366f1;
      --primary-hover: #4f46e5;
      --primary-light: #eef2ff;
      --surface: #ffffff;
      --bg: #f8fafc;
      --text: #0f172a;
      --text-muted: #64748b;
      --border: #e2e8f0;
      --radius-lg: 16px;
      --radius-md: 10px;
      --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
    }

    .hero-sec {
      max-width: 1080px;
      margin: 2.2rem auto 1.25rem auto;
      padding: 0 1.25rem;
      text-align: center;
    }
    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.82rem;
      font-weight: 700;
      color: #4f46e5;
      background: #eef2ff;
      padding: 4px 14px;
      border-radius: 20px;
      margin-bottom: 0.85rem;
      border: 1px solid #c7d2fe;
    }
    .hero-title {
      font-size: 2.35rem;
      font-weight: 800;
      letter-spacing: -0.025em;
      color: #0f172a;
      line-height: 1.25;
      margin-bottom: 0.65rem;
    }
    .hero-sub {
      font-size: 1.02rem;
      color: var(--text-muted);
      max-width: 720px;
      margin: 0 auto;
    }

    .app-box {
      width: 100%;
      max-width: 1260px;
      margin: 1.5rem auto 3rem auto;
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0 1.25rem;
      box-sizing: border-box;
    }

    /* Dropzone */
    .dropzone {
      width: 100%;
      box-sizing: border-box;
      border: 1.5px dashed #cbd5e1;
      border-radius: 18px;
      padding: 3.5rem 1.5rem;
      text-align: center;
      cursor: pointer;
      background: #ffffff;
      box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
      transition: border-color 0.15s ease;
      position: relative;
    }
    .dropzone:hover {
      border-color: var(--primary);
      background: #ffffff;
    }
    .dropzone input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .dropzone-icon {
      width: 58px;
      height: 58px;
      margin: 0 auto 0.85rem auto;
      color: var(--primary);
    }
    .btn-upload-primary {
      background: #4f46e5;
      color: #ffffff;
      padding: 0.62rem 1.4rem;
      border-radius: 10px;
      font-size: 0.95rem;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: none;
      transition: background-color 0.15s ease;
      position: relative;
      z-index: 10;
      user-select: none;
    }
    .btn-upload-primary:hover {
      background: #4338ca;
      transform: none !important;
      box-shadow: none !important;
    }
    .btn-reupload {
      cursor: pointer;
      font-size: 0.8rem;
      color: #4f46e5;
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      padding: 4px 10px;
      border-radius: 8px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: background-color 0.15s ease;
      user-select: none;
    }
    .btn-reupload:hover {
      background: #e0e7ff;
      color: #3730a3;
      transform: none !important;
    }
    .sample-btn {
      background: white;
      border: 1px solid #cbd5e1;
      padding: 0.58rem 1.15rem;
      border-radius: 10px;
      font-size: 0.88rem;
      font-weight: 700;
      color: #475569;
      cursor: pointer;
      transition: border-color 0.15s ease, background-color 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      position: relative;
      z-index: 10;
      user-select: none;
    }
    .sample-btn:hover {
      border-color: #94a3b8;
      color: #0f172a;
      background: #f8fafc;
      transform: none !important;
    }

    /* Workspace */
    .workspace-wrap {
      display: none;
      flex-direction: column;
      gap: 1.5rem;
    }
    .studio-grid {
      display: grid;
      grid-template-columns: 1.15fr 1fr;
      gap: 1.5rem;
    }
    @media (max-width: 860px) {
      .studio-grid { grid-template-columns: 1fr; }
    }

    .panel-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 1.25rem;
      box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
    .panel-title {
      font-size: 0.95rem;
      font-weight: 800;
      color: #1e293b;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    /* Video Player & Timeline */
    .video-preview-box {
      position: relative;
      width: 100%;
      background: #090d16;
      border-radius: 8px;
      overflow: hidden;
      aspect-ratio: 16 / 9;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .video-preview-box video {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .timeline-wrap {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.85rem;
    }
    .timeline-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.82rem;
      font-weight: 700;
    }
    .time-badge {
      background: #eef2ff;
      color: #4f46e5;
      padding: 2px 8px;
      border-radius: 6px;
      font-variant-numeric: tabular-nums;
    }
    .dual-slider-row {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .dual-slider-row label {
      font-size: 0.78rem;
      font-weight: 700;
      color: #64748b;
      width: 52px;
    }
    .dual-slider-row input[type="range"] {
      flex: 1;
      height: 6px;
      border-radius: 3px;
      accent-color: #6366f1;
      cursor: pointer;
    }
    .dual-slider-row span {
      font-size: 0.82rem;
      font-weight: 800;
      color: #0f172a;
      width: 55px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }
    .quick-trim-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.25rem;
    }
    .quick-trim-btn {
      padding: 0.25rem 0.65rem;
      font-size: 0.75rem;
      font-weight: 700;
      border-radius: 6px;
      border: 1px solid #cbd5e1;
      background: white;
      cursor: pointer;
      color: #475569;
      transition: all 0.15s ease;
    }
    .quick-trim-btn:hover { border-color: #6366f1; color: #6366f1; }

    /* Configuration Panel Controls */
    .control-group {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
    }
    .control-label {
      font-size: 0.82rem;
      font-weight: 700;
      color: #334155;
      display: flex;
      justify-content: space-between;
    }
    .pills-group {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
    }
    .pill-btn {
      padding: 0.4rem 0.85rem;
      font-size: 0.8rem;
      font-weight: 700;
      border-radius: 8px;
      border: 1px solid #cbd5e1;
      background: white;
      color: #334155;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .pill-btn:hover { border-color: #6366f1; color: #6366f1; }
    .pill-btn.active {
      border-color: #6366f1;
      background: #eef2ff;
      color: #4f46e5;
      box-shadow: 0 1px 3px rgba(99,102,241,0.15);
    }

    .meme-input {
      width: 100%;
      padding: 0.45rem 0.75rem;
      border-radius: 6px;
      border: 1px solid #cbd5e1;
      font-size: 0.85rem;
      color: #0f172a;
      outline: none;
    }
    .meme-input:focus { border-color: #6366f1; }

    /* Action Buttons */
    .btn-submit-convert {
      width: 100%;
      padding: 0.95rem;
      font-size: 1.05rem;
      font-weight: 800;
      border-radius: var(--radius-md);
      cursor: pointer;
      border: none;
      background: #4f46e5;
      color: white;
      box-shadow: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: background-color 0.15s ease;
    }
    .btn-submit-convert:hover {
      background: #4338ca;
      transform: none !important;
      box-shadow: none !important;
    }
    .btn-submit-convert:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    /* Progress Box */
    .progress-box {
      display: none;
      background: white;
      border: 1px solid #c7d2fe;
      border-radius: 8px;
      padding: 1.25rem;
      text-align: center;
      margin-top: 1rem;
    }
    .progress-bar-wrap {
      width: 100%;
      height: 8px;
      background: #e2e8f0;
      border-radius: 4px;
      overflow: hidden;
      margin: 0.75rem 0;
    }
    .progress-bar-fill {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, #6366f1, #a855f7);
      border-radius: 4px;
      transition: width 0.15s ease;
    }

    /* Result Preview Showcase */
    .result-section {
      display: none;
      margin-top: 1.5rem;
      padding-top: 1.5rem;
      border-top: 1px dashed var(--border);
      flex-direction: column;
      gap: 1.25rem;
      align-items: center;
    }
    .gif-display-card {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
      max-width: 640px;
      width: 100%;
      box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    }
    .gif-img-wrap {
      max-width: 100%;
      border-radius: 8px;
      overflow: hidden;
      background: #0f172a;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 200px;
    }
    .gif-img-wrap img {
      max-width: 100%;
      max-height: 420px;
      display: block;
      object-fit: contain;
    }
    .gif-stats-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 1.25rem;
      font-size: 0.85rem;
      font-weight: 700;
      color: #334155;
    }
    .gif-stats-row span strong { color: #6366f1; }

    .wechat-tag {
      font-size: 0.8rem;
      font-weight: 700;
      padding: 3px 10px;
      border-radius: 20px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .wechat-tag.success {
      background: #f0fdf4;
      color: #16a34a;
      border: 1px solid #bbf7d0;
    }
    .wechat-tag.warning {
      background: #fffbeb;
      color: #d97706;
      border: 1px solid #fde68a;
    }

    .btn-action-group {
      display: flex;
      justify-content: center;
      gap: 1rem;
      flex-wrap: wrap;
      width: 100%;
    }
    .btn-lg {
      padding: 0.75rem 1.6rem;
      font-size: 0.95rem;
      font-weight: 700;
      border-radius: var(--radius-md);
      cursor: pointer;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.15s ease;
    }
    .btn-download {
      background: #16a34a;
      color: white;
      box-shadow: none;
      transition: background-color 0.15s ease;
    }
    .btn-download:hover {
      background: #15803d;
      transform: none !important;
      box-shadow: none !important;
    }
    .btn-copy {
      background: #4f46e5;
      color: white;
      box-shadow: none;
      transition: background-color 0.15s ease;
    }
    .btn-copy:hover {
      background: #4338ca;
      transform: none !important;
      box-shadow: none !important;
    }
    .btn-outline {
      background: white;
      border: 1px solid var(--border);
      color: var(--text);
    }
    .btn-outline:hover { background: #f1f5f9; }

