    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: #000;
      color: #fff;
      overflow: hidden;
      height: 100vh;
      display: flex;
      flex-direction: column;
      touch-action: manipulation;
    }

    .header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
      padding: 20px;
      text-align: center;
    }

    .header h1 {
      font-size: 18px;
      font-weight: 600;
      margin-top: 20px;
    }

    .scan-instructions {
      position: fixed;
      top: 100px;
      left: 20px;
      right: 20px;
      z-index: 99;
      background: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 12px;
      border-radius: 8px;
      text-align: center;
      font-size: 14px;
      backdrop-filter: blur(10px);
      transition: opacity 0.3s ease;
    }

    .error-msg {
      position: fixed;
      top: 80px;
      left: 20px;
      right: 20px;
      z-index: 101;
      background: rgba(255, 59, 48, 0.9);
      color: white;
      padding: 15px;
      border-radius: 12px;
      text-align: center;
      font-weight: 500;
      display: none;
      backdrop-filter: blur(10px);
    }

    .success-msg {
      position: fixed;
      top: 80px;
      left: 20px;
      right: 20px;
      z-index: 101;
      background: rgba(52, 199, 89, 0.9);
      color: white;
      padding: 15px;
      border-radius: 12px;
      text-align: center;
      font-weight: 500;
      display: none;
      backdrop-filter: blur(10px);
    }

    .camera-container {
      flex: 1;
      position: relative;
      overflow: hidden;
    }

    #video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #000;
    }

    .scan-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
      z-index: 50;
    }

    .scan-frame {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 250px;
      height: 250px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(1px);
    }

    .scan-frame::before {
      content: '';
      position: absolute;
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
      border: 2px solid transparent;
      border-radius: 20px;
      background: linear-gradient(45deg, #00ff88, #0099ff) border-box;
      -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: subtract;
      animation: scanPulse 2s ease-in-out infinite;
    }

    @keyframes scanPulse {
      0%, 100% { opacity: 0.6; transform: scale(1); }
      50% { opacity: 1; transform: scale(1.02); }
    }

    .corner {
      position: absolute;
      width: 30px;
      height: 30px;
      border: 3px solid #00ff88;
    }

    .corner.top-left {
      top: -3px;
      left: -3px;
      border-right: none;
      border-bottom: none;
      border-radius: 20px 0 0 0;
    }

    .corner.top-right {
      top: -3px;
      right: -3px;
      border-left: none;
      border-bottom: none;
      border-radius: 0 20px 0 0;
    }

    .corner.bottom-left {
      bottom: -3px;
      left: -3px;
      border-right: none;
      border-top: none;
      border-radius: 0 0 0 20px;
    }

    .corner.bottom-right {
      bottom: -3px;
      right: -3px;
      border-left: none;
      border-top: none;
      border-radius: 0 0 20px 0;
    }

    .scan-line {
      position: absolute;
      left: 10px;
      right: 10px;
      height: 2px;
      background: linear-gradient(90deg, transparent, #00ff88, transparent);
      animation: scanLine 2s ease-in-out infinite;
    }

    @keyframes scanLine {
      0% { top: 10px; opacity: 1; }
      50% { opacity: 0.8; }
      100% { top: calc(100% - 12px); opacity: 0; }
    }

    .controls {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 100;
      background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, transparent 100%);
      padding: 30px 20px 40px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .control-btn {
      width: 50px;
      height: 50px;
      border: 2px solid rgba(255, 255, 255, 0.6);
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.3);
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      cursor: pointer;
      transition: all 0.2s ease;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }

    .control-btn:active {
      transform: scale(0.95);
      background: rgba(255, 255, 255, 0.1);
    }

    .flash-btn.active {
      background: rgba(255, 215, 0, 0.3);
      border-color: rgba(255, 215, 0, 0.8);
      color: #FFD700;
    }

    .scan-btn {
      width: 80px;
      height: 80px;
      border: 4px solid #00ff88;
      border-radius: 50%;
      background: rgba(0, 255, 136, 0.1);
      backdrop-filter: blur(10px);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32px;
      cursor: pointer;
      transition: all 0.2s ease;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      animation: scanBtnPulse 2s ease-in-out infinite;
    }

    @keyframes scanBtnPulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
      50% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    }

    .scan-btn:active {
      transform: scale(0.95);
      background: rgba(0, 255, 136, 0.2);
    }

    .result-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 200;
      background: rgba(0, 0, 0, 0.9);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      backdrop-filter: blur(10px);
    }

    .result-content {
      background: rgba(20, 20, 20, 0.95);
      border-radius: 20px;
      padding: 30px;
      max-width: 90%;
      max-height: 80%;
      overflow-y: auto;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .result-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .result-title {
      font-size: 20px;
      font-weight: 600;
      color: #00ff88;
    }

    .close-btn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      cursor: pointer;
      font-size: 18px;
      touch-action: manipulation;
    }

    .result-text {
      background: rgba(0, 0, 0, 0.5);
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
      word-break: break-all;
      font-family: 'Courier New', monospace;
      font-size: 14px;
      line-height: 1.5;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .result-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .action-btn {
      background: rgba(0, 122, 255, 0.8);
      border: none;
      border-radius: 12px;
      color: white;
      padding: 12px 20px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s ease;
      touch-action: manipulation;
      flex: 1;
      min-width: 100px;
    }

    .action-btn:active {
      transform: scale(0.95);
      background: rgba(0, 122, 255, 1);
    }

    .action-btn.copy {
      background: rgba(52, 199, 89, 0.8);
    }

    .action-btn.copy:active {
      background: rgba(52, 199, 89, 1);
    }

    .history-panel {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 200;
      background: #000;
      display: none;
      flex-direction: column;
    }

    .history-header {
      background: rgba(0, 0, 0, 0.9);
      padding: 20px;
      padding-top: 50px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .history-list {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
    }

    .history-item {
      background: rgba(20, 20, 20, 0.8);
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 10px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .history-item:active {
      transform: scale(0.98);
      background: rgba(30, 30, 30, 0.8);
    }

    .history-time {
      font-size: 12px;
      color: #666;
      margin-bottom: 8px;
    }

    .history-text {
      font-size: 14px;
      word-break: break-all;
      line-height: 1.4;
    }

    .empty-history {
      text-align: center;
      color: #666;
      font-size: 16px;
      margin-top: 100px;
    }

    @media (max-height: 600px) {
      .scan-frame {
        width: 200px;
        height: 200px;
      }
      .controls {
        padding: 20px;
      }
      .scan-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
      }
      .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
      }
    }