/* 重置基础样式（控制介面底圖 + RWD） */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: auto;  /* 改為 auto，讓高度適應內容 */
    overflow: hidden;
    background-color: #000;
    background-image: url('bg.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* 貼頂部對齊 */
    padding: 10px 0;  /* 上下各 10px 間距，與左右保持一致 */
  }
  
  /* 画布容器：强制1:1比例，自动适应视窗短边 */
  #canvas-container {
    width: 100vmin;  /* 使用vmin单位确保始终适应较短边 */
    height: 100vmin; /* 保持1:1比例 */
    display: flex;
    justify-content: center;
    align-items: flex-start;  /* 貼頂部對齊 */
  }
  
  /* canvas本身保持500x500的尺寸，但通过CSS缩放填满容器 */
  canvas {
    width: 95% !important;  /* 使用90%的尺寸替代transform: scale(0.9) */
    height: 95% !important; /* 使用90%的尺寸替代transform: scale(0.9) */
  }

  /* ========== 統一按鈕樣式（黑白色系，main/user/ui 共用） ========== */
  button,
  .btn {
    background: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 5px;
  }

  button:hover,
  .btn:hover {
    background: #262626;
    color: #e5e5e5;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  button:active,
  .btn:active {
    transform: translateY(0);
  }

  button:disabled,
  .btn:disabled {
    background: #333;
    color: #9ca3af;
    border-color: rgba(255, 255, 255, 0.15);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  /* 送出按鈕與一般按鈕同風格 */
  .submit-btn {
    background: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .submit-btn:hover:not(:disabled) {
    background: #262626;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .submit-btn:disabled {
    background: #333;
    color: #9ca3af;
  }