
  /* * {
    box-sizing: border-box;
  }
  body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #e0e0e0 0%, #e0e0e0 45%, #3366cc 45%, #3366cc 55%, #e0e0e0 55%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  } */

  /* 彈窗遮罩 */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
  }
  .modal-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  /* 彈窗本體 */
  .login-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
  }

  /* 頂部：標籤 + 關閉 */
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    border-bottom: 1px solid #eee;
  }
  .modal-tabs {
    display: flex;
    gap: 0;
  }
  .modal-tab {
    padding: 12px 20px;
    font-size: 16px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
  }
  .modal-tab:hover {
    color: #333;
  }
  .modal-tab.active {
    color: #007bff;
    font-weight: 500;
  }
  .modal-tab.active::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 2px;
    background: #007bff;
  }
  .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
  }
  .modal-close:hover {
    color: #333;
    background: #f0f0f0;
  }

  /* 表單區 */
  .modal-body {
    padding: 24px;
  }
  .form-panel {
    display: none;
  }
  .form-panel.active {
    display: block;
  }

  .form-group {
    margin-bottom: 18px;
  }
  .form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
  }
  .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .input-wrap:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
  }
  .input-wrap .icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #999;
    pointer-events: none;
  }
  .input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px 12px 44px;
    font-size: 14px;
    outline: none;
  }
  .input-wrap input::placeholder {
    color: #aaa;
  }
  .input-wrap .toggle-pwd {
    position: absolute;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .toggle-pwd:hover {
    color: #333;
  }
  .toggle-pwd svg {
    width: 18px;
    height: 18px;
  }

  /* 登入：記住我 + 忘記密碼 */
  .login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
  }
  .remember-wrap input {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
  .forgot-link {
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
  }
  .forgot-link:hover {
    text-decoration: underline;
  }

  /* 按鈕 */
  .btn-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
  }
  .btn-primary:hover {
    background: #0069d9;
  }
  .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
  }
  .btn-primary svg {
    width: 18px;
    height: 18px;
  }

  /* 註冊：頭像區 */
  .avatar-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
  }
  .avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
  }
  .avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .avatar-preview .placeholder-icon {
    width: 32px;
    height: 32px;
    color: #999;
  }
  .avatar-upload-btn {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
  }
  .avatar-upload-btn svg {
    width: 14px;
    height: 14px;
  }
  .avatar-actions {
    flex: 1;
    min-width: 0;
  }
  .btn-upload {
    padding: 10px 16px;
    font-size: 14px;
    color: #007bff;
    background: #e7f1ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
  }
  .btn-upload:hover {
    background: #cce5ff;
  }
  .avatar-hint {
    font-size: 12px;
    color: #999;
  }
  .avatar-input {
    display: none !important;
  }

  .form-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
  }
  .input-wrap.error {
    border-color: #dc3545;
  }
