    :root {
      --primary: #800000;
      --primary-dark: #4b0000;
      --secondary: #b03060;
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --info: #2563eb;
      --light: #f3f4f6;
      --dark: #1f2937;
      --bg-light: #fdf2f2;
      --bg-dark: #111827;
      --text-light: #1f2937;
      --text-dark: #f9fafb;
      --card-light: #ffffff;
      --card-dark: #111827;
      --border-light: #e5e7eb;
      --border-dark: #4b5563;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(135deg, #800000 0%, #2b000f 100%);
      min-height: 100vh;
      transition: all 0.3s ease;
      padding: 20px;
    }

    body.dark-mode {
      background: linear-gradient(135deg, #1b0a0a 0%, #020617 100%);
    }

    .container {
      max-width: 1400px;
      margin: 0 auto;
    }

    .header {
      text-align: center;
      color: white;
      margin-bottom: 30px;
      animation: fadeInDown 0.8s ease;
    }

    .header h1 {
      font-size: 3rem;
      font-weight: 700;
      margin-bottom: 10px;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }

    .header p {
      font-size: 1.2rem;
      opacity: 0.9;
    }

    .theme-toggle {
      position: fixed;
      top: 20px;
      right: 20px;
      background: rgba(255,255,255,0.2);
      backdrop-filter: blur(10px);
      border: none;
      padding: 12px 16px;
      border-radius: 50px;
      cursor: pointer;
      color: white;
      font-size: 1.2rem;
      transition: all 0.3s ease;
      z-index: 1000;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .theme-toggle:hover {
      background: rgba(255,255,255,0.3);
      transform: scale(1.1);
    }

    .stats-bar {
      display: flex;
      gap: 15px;
      margin-bottom: 30px;
      flex-wrap: wrap;
      animation: fadeIn 1s ease;
    }

    .stat-card {
      flex: 1;
      min-width: 200px;
      background: rgba(255,255,255,0.15);
      backdrop-filter: blur(10px);
      padding: 20px;
      border-radius: 15px;
      color: white;
      display: flex;
      align-items: center;
      gap: 15px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.1);
      transition: transform 0.3s ease;
    }

    .stat-card:hover {
      transform: translateY(-5px);
    }

    .stat-card i {
      font-size: 2rem;
    }

    .stat-content h3 {
      font-size: 2rem;
      font-weight: 700;
    }

    .stat-content p {
      opacity: 0.8;
      font-size: 0.9rem;
    }

    .main-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 30px;
      margin-bottom: 30px;
    }

    @media (max-width: 1024px) {
      .main-grid {
        grid-template-columns: 1fr;
      }
    }

    .card {
      background: var(--card-light);
      padding: 30px;
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.15);
      animation: fadeInUp 0.8s ease;
    }

    body.dark-mode .card {
      background: var(--card-dark);
      color: var(--text-dark);
    }

    .card h2 {
      font-size: 1.8rem;
      margin-bottom: 20px;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    body.dark-mode .card h2 {
      color: var(--primary);
    }

    .tabs {
      display: flex;
      gap: 10px;
      margin-bottom: 20px;
      border-bottom: 2px solid var(--border-light);
      flex-wrap: wrap;
    }

    .tab-btn {
      padding: 10px 20px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 1rem;
      color: var(--text-light);
      border-bottom: 3px solid transparent;
      transition: all 0.3s ease;
    }

    body.dark-mode .tab-btn {
      color: var(--text-dark);
    }

    .tab-btn:hover {
      color: var(--primary);
    }

    .tab-btn.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      font-weight: 600;
    }

    .tab-content {
      display: none;
    }

    .tab-content.active {
      display: block;
      animation: fadeIn 0.5s ease;
    }

    .form-group {
      margin-bottom: 20px;
    }

    .form-group label {
      display: block;
      margin-bottom: 8px;
      font-weight: 600;
      color: var(--text-light);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    body.dark-mode .form-group label {
      color: var(--text-dark);
    }

    .form-control {
      width: 100%;
      padding: 12px 16px;
      border: 2px solid var(--border-light);
      border-radius: 8px;
      font-size: 1rem;
      transition: all 0.3s ease;
      font-family: inherit;
    }

    body.dark-mode .form-control {
      background: var(--bg-dark);
      color: var(--text-dark);
      border-color: var(--border-dark);
    }

    .form-control:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    textarea.form-control {
      resize: vertical;
      min-height: 100px;
    }

    .btn {
      padding: 12px 30px;
      border: none;
      border-radius: 8px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      color: white;
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    }

    .btn-success {
      background: var(--success);
    }

    .btn-danger {
      background: var(--danger);
    }

    .btn-warning {
      background: var(--warning);
    }

    .btn-info {
      background: var(--info);
    }

    .btn-block {
      width: 100%;
      justify-content: center;
    }

    .btn-group {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .qr-preview {
      background: var(--card-light);
      padding: 30px;
      border-radius: 10px;
      text-align: center;
      min-height: 400px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    }

    body.dark-mode .qr-preview {
      background: var(--card-dark);
    }

    #qr_name {
      color: #666;
      margin-top: 10px;
      word-break: break-all;
      font-size: 0.95rem;
      line-height: 1.4;
    }

    body.dark-mode #qr_name {
      color: rgba(249, 250, 251, 0.85);
    }

    #qrcode {
      margin: 20px 0;
    }

    #qrcode canvas, #qrcode img {
      border-radius: 8px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.1);
      max-width: 100%;
      height: auto !important;
    }

    .color-picker-group {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
    }

    .color-picker {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .color-picker input[type="color"] {
      width: 50px;
      height: 50px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
    }

    .range-slider {
      width: 100%;
    }

    .range-value {
      display: inline-block;
      margin-left: 10px;
      font-weight: 600;
      color: var(--primary);
    }

    .template-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 15px;
    }

    .template-card {
      background: var(--light);
      padding: 20px;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.3s ease;
      text-align: center;
    }

    body.dark-mode .template-card {
      background: var(--dark);
    }

    .template-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0,0,0,0.15);
      background: var(--primary);
      color: white;
    }

    .template-card i {
      font-size: 2.5rem;
      margin-bottom: 10px;
    }

    .template-card h3 {
      font-size: 1.2rem;
      margin-bottom: 5px;
    }

    .template-card p {
      font-size: 0.9rem;
      opacity: 0.8;
    }

    .batch-input {
      display: flex;
      gap: 10px;
      margin-bottom: 10px;
    }

    .batch-input input {
      flex: 1;
    }

    #videoContainer {
      position: relative;
      max-width: 100%;
      margin: 20px 0;
    }

    #qrReader {
      width: 100%;
      min-height: 320px;
      border-radius: 10px;
      overflow: hidden;
      background: rgba(0,0,0,0.06);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    body.dark-mode #qrReader {
      background: rgba(255,255,255,0.08);
    }

    #video {
      width: 100%;
      border-radius: 10px;
    }

    #canvas {
      display: none;
    }

    .api-section {
      background: var(--light);
      padding: 20px;
      border-radius: 8px;
      margin-top: 20px;
    }

    body.dark-mode .api-section {
      background: var(--dark);
    }

    body.dark-mode pre {
      background: #0b1220;
      color: #e5e7eb;
    }

    body.dark-mode code {
      color: #e5e7eb;
    }

    .btn:focus,
    .tab-btn:focus,
    .form-control:focus,
    input[type="color"]:focus {
      outline: none;
      box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.25);
    }

    pre {
      background: #2d3748;
      color: #e2e8f0;
      padding: 15px;
      border-radius: 8px;
      overflow-x: auto;
      font-size: 0.9rem;
      line-height: 1.6;
      margin: 10px 0;
    }

    .copy-btn {
      float: right;
      padding: 5px 15px;
      font-size: 0.85rem;
      margin-top: -10px;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeInDown {
      from {
        opacity: 0;
        transform: translateY(-30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeOut {
      from {
        opacity: 1;
      }
      to {
        opacity: 0;
      }
    }

    .alert {
      padding: 15px 20px;
      border-radius: 8px;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      gap: 10px;
      animation: fadeInDown 0.5s ease;
    }

    .alert-success {
      background: #d1fae5;
      color: #065f46;
      border-left: 4px solid var(--success);
    }

    .alert-danger {
      background: #fee2e2;
      color: #991b1b;
      border-left: 4px solid var(--danger);
    }

    .alert-info {
      background: #dbeafe;
      color: #1e40af;
      border-left: 4px solid var(--info);
    }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.7);
      z-index: 2000;
      justify-content: center;
      align-items: center;
      animation: fadeIn 0.3s ease;
    }

    .modal.active {
      display: flex;
    }

    .modal-content {
      background: white;
      padding: 30px;
      border-radius: 14px;
      max-width: 600px;
      width: 90%;
      max-height: 90vh;
      overflow-y: auto;
      animation: fadeInUp 0.4s ease;
    }

    body.dark-mode .modal-content {
      background: var(--card-dark);
      color: var(--text-dark);
    }

    .close-modal {
      float: right;
      font-size: 1.5rem;
      cursor: pointer;
      color: var(--text-light);
    }

    body.dark-mode .close-modal {
      color: var(--text-dark);
    }
