* { margin: 0; padding: 0; box-sizing: border-box; }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100vh;
      padding: 20px;
    }
    
    .container { max-width: 500px; margin: 0 auto; }
    
    .card {
      background: white;
      border-radius: 16px;
      padding: 20px;
      margin-bottom: 16px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    .card-title {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .info-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid #eee;
    }
    .info-row:last-child { border-bottom: none; }
    .info-label { color: #666; }
    .info-value { font-weight: 600; color: #333; }
    
    .items-list {
      background: #f8f9fa;
      border-radius: 8px;
      padding: 8px 12px;
      margin: 8px 0;
    }
    
    .item-row {
      display: flex;
      justify-content: space-between;
      padding: 5px 0;
    }
    
    /* 進度條 */
    .progress-step {
      display: flex;
      align-items: center;
      padding: 10px;
      margin: 6px 0;
      border-radius: 8px;
      background: #f8f9fa;
      cursor: pointer;
      transition: all 0.2s;
      border: 2px solid transparent;
    }
    .progress-step:hover:not(.disabled) { background: #e9ecef; }
    .progress-step.completed { background: #d4edda; cursor: not-allowed; }
    .progress-step.selected { background: #fff3cd; border: 2px solid #ffc107; }
    .progress-step.disabled { background: #e9ecef; cursor: not-allowed; opacity: 0.6; }
    
    .step-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      margin-right: 10px;
    }
    .step-icon.completed { background: #28a745; color: white; }
    .step-icon.current { background: #ffc107; color: white; }
    .step-icon.pending { background: #e9ecef; color: #999; }
    
    .step-info { flex: 1; }
    .step-title { font-weight: bold; font-size: 14px; }
    .step-detail { font-size: 12px; color: #666; }
    
    /* 輸入框 */
    .input-group { margin: 12px 0; }
    .input-label { display: block; margin-bottom: 6px; font-weight: 600; color: #333; font-size: 14px; }
    .input-field {
      width: 100%;
      padding: 12px;
      border: 2px solid #e9ecef;
      border-radius: 10px;
      font-size: 16px;
    }
    .input-field:focus { outline: none; border-color: #667eea; }
    .input-hint { font-size: 12px; color: #666; margin-top: 4px; }
    
    /* 按鈕 */
    .btn {
      width: 100%;
      padding: 14px;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
    }
    .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
    .btn-primary:disabled { background: #ccc; cursor: not-allowed; transform: none; }
    .btn-secondary { background: #f8f9fa; color: #333; margin-top: 10px; }
    /* 成功頁面 - 緊湊版 */
    .completed-badge { text-align: center; padding: 10px; }
    .completed-icon { font-size: 36px; margin-bottom: 6px; }
    .completed-title { font-size: 18px; font-weight: bold; color: #28a745; }
    
    /* QR Code - 縮小版 */
    .qr-container { text-align: center; padding: 8px; }
    .qr-container p { font-size: 12px; margin-bottom: 6px; color: #666; }
    .qr-image {
      width: 150px;
      height: 150px;
      margin: 6px auto;
      border: 3px solid #667eea;
      border-radius: 10px;
    }
    
    /* 新增品項 */
    .item-entry { background: #f8f9fa; border-radius: 8px; padding: 10px; margin: 8px 0; }
    .item-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
    .remove-item { background: #dc3545; color: white; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
    .add-item-btn {
      width: 100%;
      padding: 10px;
      border: 2px dashed #667eea;
      border-radius: 8px;
      background: transparent;
      color: #667eea;
      font-size: 14px;
      cursor: pointer;
      margin: 10px 0;
    }
    
    /* Loading */
    .loading { text-align: center; padding: 40px; }
    .spinner {
      width: 40px; height: 40px;
      border: 4px solid #f3f3f3;
      border-top: 4px solid #667eea;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin: 0 auto 16px;
    }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
    .loading-status { margin-top: 8px; color: #333; }
    .loading-actions {
      display: none;
      margin-top: 16px;
      gap: 10px;
      flex-direction: column;
    }
    .loading-actions.active { display: flex; }
    
    /* 頁面切換 */
    .page { display: none; }
    .page.active { display: block; }
    
    /* 選單 */
    .menu-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
    .menu-btn { padding: 16px; border: none; border-radius: 12px; background: #f8f9fa; cursor: pointer; }
    .menu-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    .menu-btn-icon { font-size: 28px; margin-bottom: 6px; }
    .menu-btn-text { font-size: 13px; font-weight: 600; }
    
    .error-border { border-color: #dc3545 !important; background-color: #fff8f8; color: #dc3545; }
    .error-text { color: #dc3545 !important; }
    .inventory-info { font-size: 12px; color: #28a745; margin-left: 4px; font-weight: bold; white-space: nowrap; }
    .item-note { width: 60% !important; }
    .item-model { text-transform: uppercase; }
    
    /* Autocomplete */
    .autocomplete-wrapper { position: relative; width: 100%; }
    .autocomplete-list {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border: 1px solid #ddd;
      border-radius: 0 0 8px 8px;
      max-height: 250px;
      overflow-y: auto;
      z-index: 1000;
      display: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .autocomplete-list.active { display: block; }
    .autocomplete-item {
      padding: 12px;
      cursor: pointer;
      border-bottom: 1px solid #f0f0f0;
      font-size: 16px;
    }
    .autocomplete-item:hover { background-color: #f8f9fa; color: #667eea; }
    .autocomplete-item:last-child { border-bottom: none; }
    
    /* Modal */
    .modal {
      display: none;
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,0.5);
      align-items: center;
      justify-content: center;
    }
    .modal.active { display: flex; }
    .modal-content {
      background-color: white;
      padding: 20px;
      border-radius: 12px;
      width: 90%;
      max-width: 400px;
      max-height: 80vh;
      overflow-y: auto;
      box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 15px;
      border-bottom: 1px solid #eee;
      padding-bottom: 10px;
    }
    .modal-title { font-size: 18px; font-weight: bold; }
    .modal-close { font-size: 24px; cursor: pointer; color: #999; }
    .stock-list-item {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid #f5f5f5;
    }
    .stock-partner { font-weight: 500; }
    .stock-qty { font-weight: bold; color: #28a745; }
    .btn-stock {
      padding: 2px 8px;
      font-size: 12px;
      background: #17a2b8;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      margin-left: 5px;
    }

    /* 列印樣式 */
    @media print {
      @page { size: A4; margin: 10mm; }
      body { background: white !important; padding: 0 !important; min-height: auto !important; }
      .no-print { display: none !important; }
      .container { max-width: 100% !important; }
      .card { box-shadow: none !important; border: 1px solid #ddd; margin-bottom: 0 !important; padding: 12px !important; page-break-inside: avoid; }
      .page { display: none !important; }
      .page.active { display: block !important; }
      .completed-badge { padding: 6px !important; }
      .completed-icon { font-size: 28px !important; }
      .completed-title { font-size: 16px !important; }
      .qr-image { width: 130px !important; height: 130px !important; }
    }

.update-time-display {
  font-size: 12px;
  color: #666;
  margin-top: -8px;
  margin-bottom: 12px;
  text-align: right;
}
