* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 150px 0 100px;
    margin-top: 60px;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #c0392b;
}

/* Cats Section */
.cats-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.cats-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.cat-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.cat-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.cat-info {
    padding: 1.5rem;
}

.cat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.cat-details-text {
    color: #666;
    margin-bottom: 1rem;
}

.cat-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

/* Cat Details */
.cat-detail-image {
    width: 100%;
    max-width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto 1.5rem auto;
    display: block;
}

.cat-detail-info h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.cat-detail-info p {
    margin-bottom: 0.8rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

.adopt-button {
    background: #27ae60;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s;
}

.adopt-button:hover {
    background: #219a52;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-option input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
}

.radio-option span {
    user-select: none;
}

/* 長問題的標籤樣式 */
.form-group label {
    line-height: 1.4;
}

/* 數字輸入框樣式 */
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* 契約區域樣式 */
.contract-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    margin-top: 2rem;
}

.contract-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.contract-section p {
    margin-bottom: 1rem;
    color: #666;
}

.contract-actions {
    margin-bottom: 1.5rem;
}

.contract-link {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.contract-link:hover {
    background: #2980b9;
    color: white;
}

.agreement-section {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    line-height: 1.5;
}

.checkbox-option input[type="checkbox"] {
    width: auto;
    margin-right: 0.8rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.checkbox-option span {
    user-select: none;
    color: #2c3e50;
    font-weight: 500;
}

/* 媒體上傳區域樣式 */
.media-upload-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.media-upload-section label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.95rem;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: #fafafa;
    transition: border-color 0.3s, background-color 0.3s;
}

.upload-area:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.upload-placeholder {
    cursor: pointer;
    padding: 1rem;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    margin: 0.3rem 0;
    color: #666;
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
}

.uploaded-files {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
}

.file-preview {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    border: 1px solid #ddd;
}

.file-preview img,
.file-preview video {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.file-preview .file-info {
    padding: 0.4rem;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    background: white;
    line-height: 1.2;
}

.file-preview .file-size {
    font-size: 0.65rem;
    color: #999;
    margin-top: 0.1rem;
}

.file-preview .remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.file-preview .remove-file:hover {
    background: rgba(192, 57, 43, 0.9);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background: #f8f9fa;
    font-size: 1.5rem;
}

/* 提交按鈕禁用狀態 */
.submit-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-button:disabled:hover {
    background: #bdc3c7;
}

.submit-button {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #2980b9;
}

.submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }
    
    .cats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .cat-detail-image {
        height: 250px;
    }
    
    .cat-detail-info h2 {
        font-size: 1.5rem;
    }
    
    .cat-detail-info p {
        font-size: 1rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav a {
        margin: 0 1rem;
    }
    
    /* 媒體上傳區域響應式 */
    .uploaded-files {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .file-preview img,
    .file-preview video {
        height: 60px;
    }
    
    .file-icon {
        height: 60px;
        font-size: 1.2rem;
    }
    
    .upload-area {
        padding: 1rem;
    }
    
    .upload-placeholder {
        padding: 0.5rem;
    }
    
    .upload-icon {
        font-size: 1.5rem;
    }
}