body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overscroll-behavior-y: none; /* 防止下拉刷新 */
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: auto;
}

/* 首頁樣式 */
.app-container {
    max-width: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.welcome-card {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.app-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    background-color: #4f46e5;
    border-radius: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 50px;
}

.input-field {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
    transition: border-color 0.3s;
}

.input-field:focus {
    border-color: #4f46e5;
    outline: none;
}

.start-button {
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.start-button:hover {
    background-color: #4338ca;
}

.draw-container {
    max-width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    padding-bottom: 20px;
    touch-action: none; /* 防止觸摸滑動 */
    position: relative;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
}

.canvas-container {
    flex: 1;
    background-color: white;
    border-radius: 12px;
    touch-action: none; /* 防止觸摸滑動 */
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: relative;
}

canvas {
    width: 100%;
    height: 100%;
    touch-action: none;
}

.color-palette {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.color-picker-label {
    font-size: 14px;
    color: #4b5563;
}

.color-picker-preview {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    overflow: hidden;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s;
}

.color-option:hover, .color-option.active {
    transform: scale(1.1);
    border-color: #4a5568;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #4b5563;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.brush-size {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.brush-size-label {
    font-size: 14px;
    color: #4b5563;
}

.brush-size-input {
    flex: 1;
}

.footer {
    flex-shrink: 0;
    text-align: center;
    color: #888;
    font-size: 15px;
    margin-top: 12px;
    margin-bottom: 10vh;
    letter-spacing: 0.5px;
    user-select: none;
}
.footer-link {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 500;
}
.footer-link:hover {
    color: #805ad5;
}

.loading-overlay {
    position: fixed;
    z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #4f46e5;
    transition: opacity 0.3s;
}
.loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
}
