/* 汽車租賃系統 - Apple 風格設計 */

/* CSS 變數定義 */
:root {
    /* Light 模式變數 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fbfbfd;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --accent-primary: #0071e3;
    --accent-secondary: #0077ed;
    --border-primary: #d2d2d7;
    --border-secondary: #e5e5e7;
    --shadow-primary: rgba(0, 0, 0, 0.1);
    --shadow-secondary: rgba(0, 0, 0, 0.05);
    --success-color: #34c759;
    --warning-color: #ff9500;
    --error-color: #ff3b30;
    --input-bg: #ffffff;
    --input-border: #d2d2d7;
    --input-focus-border: #0071e3;
    --input-focus-shadow: rgba(0, 113, 227, 0.1);
}

/* Dark 模式變數 */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #ebebf5;
    --text-tertiary: #ebebf599;
    --accent-primary: #0a84ff;
    --accent-secondary: #409cff;
    --border-primary: #38383a;
    --border-secondary: #48484a;
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-secondary: rgba(0, 0, 0, 0.2);
    --success-color: #30d158;
    --warning-color: #ff9f0a;
    --error-color: #ff453a;
    --input-bg: #1c1c1e;
    --input-border: #38383a;
    --input-focus-border: #0a84ff;
    --input-focus-shadow: rgba(10, 132, 255, 0.1);
}

/* 全域樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* 主題切換按鈕 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    user-select: none;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: var(--text-primary);
    flex-shrink: 0;
}

/* 主要容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 20px 60px;
    text-align: center;
    width: 100%;
}

/* 標題樣式 */
h1 {
    font-size: clamp(32px, 8vw, 56px);
    line-height: 1.07143;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-wrap: break-word;
    hyphens: auto;
}

.subtitle {
    font-size: clamp(18px, 4vw, 28px);
    line-height: 1.10722;
    font-weight: 400;
    letter-spacing: .004em;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 註冊表單 */
.registration-form {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

.form-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.required {
    color: var(--error-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* 欄位錯誤樣式 */
.form-group input.error,
.form-group select.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.field-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

.field-error::before {
    content: '⚠️';
    font-size: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* QR Code 掃描區域 */
.qr-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 113, 227, 0.15);
    position: relative;
}

.qr-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.qr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.05) 0%, rgba(0, 113, 227, 0.1) 100%);
}

.qr-header:hover {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1) 0%, rgba(0, 113, 227, 0.15) 100%);
    transform: translateY(-2px);
}

.qr-header-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.qr-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.qr-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0056b3;
    text-shadow: 0 1px 2px rgba(0, 86, 179, 0.2);
}

.qr-text p {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.5;
    font-weight: 600;
}

.qr-benefits {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.benefit-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

.benefit-tag:nth-child(1) { animation-delay: 0.1s; }
.benefit-tag:nth-child(2) { animation-delay: 0.2s; }
.benefit-tag:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0056b3, #004085);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.3);
}

.qr-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

.qr-toggle-btn svg {
    transition: transform 0.3s ease;
}

.qr-toggle-btn.expanded svg {
    transform: rotate(180deg);
}

.qr-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.qr-content.expanded {
    max-height: 800px;
}

/* 顯示 QR Code 區域 */
.qr-generator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    padding: 2rem;
    background: var(--card-bg);
}

.qr-info {
    text-align: center;
}

.qr-info h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0056b3;
    text-shadow: 0 1px 2px rgba(0, 86, 179, 0.2);
}

.qr-info p {
    margin: 0;
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.5;
    font-weight: 600;
}

.qr-code-display {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.qr-code-display img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.qr-code-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.qr-transaction-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-secondary);
    text-align: center;
}

.qr-transaction-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.qr-transaction-info p:last-child {
    margin-bottom: 0;
}

.qr-transaction-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.qr-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--error-color);
    text-align: center;
}

.qr-error svg {
    color: var(--error-color);
}

.qr-error p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.qr-error .error-details {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
}

.qr-error .retry-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-error .retry-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.qr-code-display:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #333333;
}

.qr-loading p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333333;
}

.qr-actions {
    display: flex;
    gap: 1rem;
}

.qr-download-btn,
.qr-refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--card-bg);
    color: #1a1a1a;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-download-btn:hover,
.qr-refresh-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    border-color: #0056b3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 86, 179, 0.3);
}

/* 外部連結按鈕樣式 */
.qr-refresh-btn.auth-link {
    background: linear-gradient(135deg, #34c759, #28a745);
    border-color: #34c759;
    color: white;
    position: relative;
    overflow: hidden;
}

.qr-refresh-btn.auth-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.qr-refresh-btn.auth-link:hover::before {
    left: 100%;
}

.qr-refresh-btn.auth-link:hover {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border-color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.qr-download-btn svg,
.qr-refresh-btn svg {
    width: 16px;
    height: 16px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .qr-header {
        padding: 1.25rem;
    }
    
    .qr-header-content {
        gap: 1rem;
    }
    
    .qr-icon {
        width: 48px;
        height: 48px;
    }
    
    .qr-text h3 {
        font-size: 1.125rem;
    }
    
    .qr-text p {
        font-size: 0.875rem;
    }
    
    .benefit-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .qr-generator-container {
        padding: 1.5rem;
    }
    
    .qr-code-display {
        width: 280px;
        height: 280px;
    }
    
    .qr-transaction-info {
        margin-top: 12px;
        padding: 10px;
    }
    
    .qr-transaction-info p {
        font-size: 13px;
    }
    
    .qr-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .qr-download-btn,
    .qr-refresh-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .qr-header {
        padding: 1rem;
    }
    
    .qr-icon {
        width: 44px;
        height: 44px;
    }
    
    .qr-text h3 {
        font-size: 1rem;
    }
    
    .qr-text p {
        font-size: 0.8rem;
    }
    
    .qr-benefits {
        gap: 0.25rem;
    }
    
    .benefit-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .qr-generator-container {
        padding: 1rem;
    }
    
    .qr-code-display {
        width: 260px;
        height: 260px;
    }
    
    .qr-transaction-info {
        margin-top: 10px;
        padding: 8px;
    }
    
    .qr-transaction-info p {
        font-size: 12px;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .qr-code-display {
        background: var(--card-bg);
        border-color: var(--border-color);
    }
}

/* 動畫效果 */
@keyframes qrExpand {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-content.expanded {
    animation: qrExpand 0.4s ease;
}

/* 無障礙支援 */
@media (prefers-reduced-motion: reduce) {
    .qr-section::before,
    .qr-icon,
    .benefit-tag,
    .qr-content,
    .qr-toggle-btn svg,
    .qr-download-btn,
    .qr-refresh-btn {
        animation: none;
        transition: none;
    }
    
    .qr-content.expanded {
        animation: none;
    }
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    .qr-section {
        border-width: 3px;
    }
    
    .qr-download-btn,
    .qr-refresh-btn {
        border-width: 3px;
    }
}

/* 核取方塊樣式 */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-primary);
    border-radius: 6px;
    background: var(--input-bg);
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* 提交按鈕 */
.form-actions {
    text-align: center;
    margin-top: 32px;
}

.submit-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 113, 227, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 狀態卡片 */
.status-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 18px;
    padding: clamp(16px, 4vw, 24px);
    margin: 32px auto;
    display: inline-block;
    min-width: 280px;
    max-width: 90vw;
    width: 100%;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-primary);
    border-color: var(--accent-primary);
}

.status-card:active {
    transform: translateY(0);
}

.status-card .status-icon {
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.status-card .status-text {
    font-size: clamp(15px, 3vw, 17px);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.status-card .status-description {
    font-size: clamp(12px, 2.5vw, 14px);
    color: var(--text-secondary);
}

/* 描述文字 */
.description {
    font-size: clamp(16px, 3.5vw, 21px);
    line-height: 1.381;
    font-weight: 400;
    letter-spacing: .011em;
    color: var(--text-secondary);
    margin: 32px auto;
    max-width: 600px;
    padding: 0 16px;
}

/* 頁腳 */
.footer {
    margin-top: 60px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section h4::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.tech-stack {
    list-style: none;
    padding: 0;
}

.tech-stack li {
    color: var(--text-secondary);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-stack li::before {
    content: '▸';
    color: var(--accent-primary);
    font-weight: bold;
}

.github-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.github-link:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
}

.github-link svg {
    width: 16px;
    height: 16px;
}

.github-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

.stat svg {
    width: 12px;
    height: 12px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-secondary);
}

.footer-bottom p {
    color: var(--text-tertiary);
    font-size: 14px;
    margin: 0;
}

/* 載入動畫 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    border: 3px solid var(--border-primary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: clamp(14px, 3vw, 17px);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    padding: 0 16px;
}

/* 響應式設計 - 大螢幕 */
@media (min-width: 1200px) {
    .container {
        padding: 140px 40px 80px;
    }
    
    .status-card {
        min-width: 400px;
    }
}

/* 響應式設計 - 平板橫向 */
@media (max-width: 1024px) and (orientation: landscape) {
    .container {
        padding: 80px 20px 40px;
    }
    
    h1 {
        margin-bottom: 12px;
    }
    
    .subtitle {
        margin-bottom: 24px;
    }
}

/* 響應式設計 - 平板 */
@media (max-width: 1024px) {
    .container {
        padding: 100px 20px 50px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 響應式設計 - 手機橫向 */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 60px 16px 30px;
    }
    
    .theme-toggle {
        top: 12px;
        right: 12px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .status-card {
        margin: 20px auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 響應式設計 - 手機 */
@media (max-width: 768px) {
    .container {
        padding: 80px 16px 40px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 18px;
    }
    
    .theme-toggle svg {
        width: 14px;
        height: 14px;
    }
    
    .status-card {
        min-width: 280px;
        padding: 20px;
        margin: 24px auto;
        border-radius: 18px;
    }
    
    .footer {
        margin-top: 40px;
        padding: 24px 16px 12px;
        font-size: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-section {
        padding: 20px;
        border-radius: 18px;
    }
    
    .qr-generator-container {
        padding: 1.5rem;
    }
    
    .qr-code-display {
        width: 280px;
        height: 280px;
    }
}

/* 響應式設計 - 小手機 */
@media (max-width: 480px) {
    .container {
        padding: 70px 12px 30px;
    }
    
    .theme-toggle {
        top: 12px;
        right: 12px;
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 16px;
    }
    
    .theme-toggle svg {
        width: 12px;
        height: 12px;
    }
    
    .status-card {
        min-width: 240px;
        padding: 16px;
        margin: 20px auto;
        border-radius: 16px;
    }
    
    .description {
        padding: 0 12px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 20px 12px 10px;
        font-size: 11px;
    }
    
    .form-section {
        padding: 16px;
        border-radius: 16px;
    }
    
    .form-section h3 {
        font-size: 18px;
    }
    
    .qr-generator-container {
        padding: 0.75rem;
    }
    
    .qr-code-display {
        width: 240px;
        height: 240px;
    }
    
    .submit-btn {
        padding: 14px 24px;
        font-size: 16px;
        min-width: 180px;
    }
}

/* 響應式設計 - 超小手機 */
@media (max-width: 360px) {
    .container {
        padding: 60px 8px 20px;
    }
    
    .theme-toggle {
        top: 8px;
        right: 8px;
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .theme-toggle svg {
        width: 10px;
        height: 10px;
    }
    
    .status-card {
        min-width: 220px;
        padding: 12px;
        margin: 16px auto;
    }
    
    .description {
        padding: 0 8px;
    }
    
    .form-section {
        padding: 12px;
    }
    
    .qr-generator-container {
        padding: 0.75rem;
    }
    
    .qr-code-display {
        width: 220px;
        height: 220px;
    }
}

/* 響應式設計 - 高解析度螢幕 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .status-card {
        border-width: 0.5px;
    }
    
    .theme-toggle {
        border-width: 0.5px;
    }
    
    .form-section {
        border-width: 0.5px;
    }
}

/* 響應式設計 - 觸控裝置 */
@media (hover: none) and (pointer: coarse) {
    .status-card:hover {
        transform: none;
    }
    
    .theme-toggle:hover {
        transform: none;
    }
    
    .submit-btn:hover {
        transform: none;
    }
    
    .status-card:active {
        transform: scale(0.98);
    }
    
    .theme-toggle:active {
        transform: scale(0.95);
    }
    
    .submit-btn:active {
        transform: scale(0.98);
    }
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* 列印樣式 */
@media print {
    .theme-toggle,
    .loading {
        display: none !important;
    }
    
    .container {
        padding: 20px;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* GitHub 頂部橫條樣式 */
.github-banner {
    background: #000000;
    color: white;
    padding: 16px 0;
    margin-bottom: 30px;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.github-banner:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.github-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffffff, #cccccc, #ffffff);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.github-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.github-banner-link:hover {
    color: inherit;
    text-decoration: none;
}

.github-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.github-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.github-info svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.github-text {
    font-size: 16px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.github-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.github-arrow svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.github-banner:hover .github-arrow {
    transform: translateX(4px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .github-banner {
        margin-bottom: 20px;
        padding: 14px 0;
    }
    
    .github-banner-content {
        flex-direction: row;
        gap: 12px;
        text-align: left;
    }
    
    .github-info {
        justify-content: flex-start;
    }
    
    .github-text {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .github-banner {
        margin-bottom: 15px;
        padding: 12px 0;
    }
    
    .github-banner-content {
        padding: 0 15px;
        gap: 10px;
    }
    
    .github-text {
        font-size: 14px;
    }
    
    .github-info svg {
        width: 18px;
        height: 18px;
    }
    
    .github-arrow svg {
        width: 14px;
        height: 14px;
    }
} 