* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    padding-bottom: 80px;
    /* 為底部按鈕留空間 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 25px;
    padding: 15px 10px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* 移除手機點擊高亮 */
}

.upload-area:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.upload-area.drag-over {
    background: #f0f4ff;
    border: 3px dashed #667eea;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.upload-area p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* 提升觸摸響應 */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 8px 20px;
    font-size: 0.9rem;
}

.groups-container {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.photo-group {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.group-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.photo-item {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.02);
}

.photo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.photo-description textarea {
    width: 100%;
    height: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-size: 14px;
    font-family: inherit;
}

.photo-description textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding-bottom: 2px;
}

.photo-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.group-info {
    display: grid;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group input,
.input-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.action-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 100;
}

.empty-state {
    text-align: center;
    color: white;
    padding: 60px 20px;
    font-size: 1.2rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 80px;
    }

    header {
        margin-bottom: 20px;
        padding: 10px 5px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .upload-area {
        padding: 25px 15px;
        border-radius: 12px;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .upload-area h3 {
        font-size: 1.1rem;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .photo-group {
        padding: 15px;
        border-radius: 15px;
    }

    .group-header h3 {
        font-size: 1.1rem;
    }

    .btn-danger {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .input-group input,
    .input-group textarea {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    .action-buttons {
        padding: 12px 10px;
        gap: 8px;
    }

    .action-buttons .btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* 超小屏幕優化 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .upload-area {
        padding: 20px 12px;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .photo-group {
        padding: 12px;
    }

    .action-buttons .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}