:root {
    --primary-color: #FF9A9E;
    --secondary-color: #FECFEF;
    --accent-color: #A1C4FD;
    --accent-light: #C2E9FB;
    --text-main: #4A4A4A;
    --text-light: #7A7A7A;
    --bg-color: #FFF5F5;
    --card-bg: #FFFFFF;
    --shadow: 0 15px 35px rgba(255, 154, 158, 0.15);
    --shadow-hover: 0 25px 45px rgba(255, 154, 158, 0.3);
    --border-radius: 24px;
}

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

body {
    font-family: 'Nunito', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(254, 207, 239, 0.4) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(194, 233, 251, 0.4) 0%, transparent 20%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 頂部橫幅 */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -10%;
    width: 120%; height: 200%;
    background: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    z-index: -1;
    transform: rotate(-3deg);
    border-bottom: 5px dashed var(--secondary-color);
}

.badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(161, 196, 253, 0.4);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0px white, 4px 4px 0px var(--secondary-color);
}

.hero h1 span {
    color: var(--accent-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* 作品網格 */
.gallery-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 3rem;
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 卡片與版面設計 */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 卡片頂部資訊 */
.card-header {
    padding: 1.5rem;
    border-bottom: 1px dashed #eee;
    text-align: center;
    background: linear-gradient(to bottom, #ffffff, #fdfbfb);
}

.theme-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.student-info {
    display: flex;
    justify-content: center;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: inline-block;
    padding: 6px 20px;
    background: var(--secondary-color);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(254, 207, 239, 0.5);
}

/* 卡片圖片 */
.card-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #f0f0f0;
}

.image-column {
    position: relative;
    background: #fff;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .image-wrapper img {
    transform: scale(1.05);
}

.upload-controls {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

body.edit-mode .upload-controls {
    display: flex;
}

.image-upload-label {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s;
}

.image-upload-label:hover {
    background: rgba(0,0,0,0.9);
}

.image-upload-label.camera-btn {
    background: rgba(255, 154, 158, 0.9);
    color: #333;
}

.image-upload-label.camera-btn:hover {
    background: rgba(255, 120, 130, 1);
}

.image-upload-input {
    display: none;
}

.tag {
    position: absolute;
    top: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.tag-process {
    left: 15px;
    color: var(--accent-color);
}

.tag-final {
    right: 15px;
    color: var(--primary-color);
}

/* 卡片底部內容 */
.card-footer {
    padding: 1.5rem;
    text-align: center;
    flex: 1;
}

.process-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* 移除不再需要的互動提示 */
.interaction-hint {
    display: none;
}

/* 頁尾 */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .gallery-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 2rem;
    }
    .card-images {
        grid-template-columns: 1fr;
    }
    .image-wrapper {
        height: 250px;
    }
}

/* 管理控制按鈕 */
.admin-controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: white;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.control-btn.editing {
    background: var(--accent-color);
    color: white;
}

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

/* 編輯模式樣式 */
body.edit-mode [contenteditable="true"] {
    border-bottom: 2px dashed var(--accent-color);
    outline: none;
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 5px;
    border-radius: 4px;
}

body.edit-mode [contenteditable="true"]:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.delete-card-btn {
    display: none;
    position: absolute;
    top: -15px;
    right: -15px;
    width: 32px;
    height: 32px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

body.edit-mode .delete-card-btn {
    display: block;
}

.upload-controls {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

body.edit-mode .upload-controls {
    display: flex;
}

.image-upload-label {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.image-upload-label.camera-btn {
    background: rgba(46, 213, 115, 0.9);
}

.image-upload-label:hover {
    background: rgba(0,0,0,0.9);
}

.image-upload-label.camera-btn:hover {
    background: rgba(46, 213, 115, 1);
}

.image-upload-input {
    display: none;
}
