/* --- 基本重設與全域設定 --- */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-weight: 400;
    letter-spacing: -0.01em;
}

main {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* --- 頁首與導覽 --- */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--box-shadow);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}
.logo:hover {
    text-decoration: none;
    transform: scale(1.05);
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-color);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
}

.main-nav a:hover, .main-nav a.active {
    background: var(--primary-light);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-user {
    color: var(--text-muted);
    font-weight: 500;
    background: var(--border-light);
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* --- 頁尾 --- */
.main-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f8fafc;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

/* --- 按鈕樣式 --- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--box-shadow);
}
.btn-primary:hover {
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}
.btn-primary::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;
}
.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--box-shadow);
}
.btn:disabled {
    background: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}


/* --- 表單容器與元件 --- */
.form-container {
    max-width: 520px;
    margin: 50px auto;
    padding: 40px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}
.form-container p {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--surface-color);
    transition: all 0.3s ease;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--surface-color);
}
.form-control:hover {
    border-color: var(--primary-color);
}

.form-group .btn {
    width: 100%;
}
.form-container p a {
    font-weight: 500;
}
.help-block {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* --- 提示訊息 --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}


/* --- 藝廊 (圖片網格) --- */
.page-title {
    text-align: center;
    margin: 50px 0 60px;
    padding: 40px 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.page-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}
.page-title h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-title p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}
.page-title .btn {
    margin-top: 30px;
}


.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: all 0.4s ease;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
}
.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3), transparent);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}
.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-info h3 {
    margin-bottom: 6px;
    font-size: 1.3rem;
    font-weight: 700;
}
.gallery-item-info span {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}
.gallery-item-votes {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
    font-size: 1.1rem;
    color: var(--text-muted);
}
.empty-gallery a {
    font-weight: 600;
    color: var(--primary-color);
}

/* --- 相簿網格 --- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}
.album-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    aspect-ratio: 4 / 3;
    cursor: pointer;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    transition: all 0.4s ease;
}
.album-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}
.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.album-item:hover img {
    transform: scale(1.08);
}
.album-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3), transparent);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    transition: all 0.5s ease;
}
.album-item-info h3 {
    margin-bottom: 6px;
    font-size: 1.4rem;
    font-weight: 700;
}
.album-item-info span {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}
.album-item-count {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* --- 單張圖片頁面 --- */
.image-view-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
    background: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    border: 1px solid var(--border-light);
}
.image-display {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.image-display img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.image-display:hover img {
    transform: scale(1.02);
}

.image-details h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.image-meta {
    margin-bottom: 24px;
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1.05rem;
}
.image-meta a {
    font-weight: 600;
    color: var(--primary-color);
}

.image-description {
    margin-bottom: 32px;
    white-space: pre-wrap;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.vote-section {
    background: var(--border-light);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.vote-count {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-color);
}
.btn-vote {
    width: 100%;
    font-size: 1.1rem;
    padding: 16px 24px;
}

/* --- 上傳界面樣式 --- */
.upload-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.upload-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.upload-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* 相簿選擇區域 */
.album-selection-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.album-selection-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.album-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.album-option-card {
    position: relative;
}

.album-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-color);
}

.option-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.album-option-card input[type="radio"]:checked + .option-label {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.option-content h4 {
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.option-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.album-field-group {
    margin-top: 20px;
}

.album-field-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

/* 上傳區域 */
.upload-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.upload-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.upload-area {
    position: relative;
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-color);
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-content h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.upload-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-muted);
}

.upload-hint {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.upload-hint span {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 5px 12px;
    border-radius: 20px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* 預覽區域 */
.preview-section {
    margin-top: 30px;
}

.preview-section h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.preview-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.preview-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-item:hover .preview-overlay {
    opacity: 1;
}

.remove-btn {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.preview-info {
    padding: 12px;
}

.preview-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview-description {
    padding: 0 12px 12px 12px;
}

.preview-description label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 6px;
}

.preview-description-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    transition: border-color 0.3s ease;
}

.preview-description-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* 上傳按鈕 */
.upload-actions {
    text-align: center;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.btn-upload {
    font-size: 1.2rem;
    padding: 18px 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.btn-upload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.3rem;
}

.btn-loading {
    display: none;
}

/* --- 刪除功能樣式 --- */
.album-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-item:hover .album-actions {
    opacity: 1;
}

.btn-delete-album {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-delete-album:hover {
    background: #dc3545;
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.image-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .image-actions {
    opacity: 1;
}

.btn-delete-image {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-delete-image:hover {
    background: #dc3545;
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

/* --- 管理員面板樣式 --- */
.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.admin-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.admin-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stats-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.stats-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 15px;
}

.stat-content h4 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--text-color);
}

.stat-content p {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 600;
}

.stat-content small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.users-section {
    padding: 30px;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-light);
}

.users-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.users-table {
    overflow-x: auto;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.users-table th,
.users-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
}

.users-table tr:hover {
    background: var(--background-color);
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-badge.admin {
    background: var(--primary-light);
    color: var(--primary-color);
}

.role-badge.user {
    background: var(--border-light);
    color: var(--text-muted);
}

.actions {
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.current-user {
    color: var(--text-muted);
    font-style: italic;
}

/* --- 管理員面板新增功能樣式 --- */
.user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--background-color);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.action-card h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
}

.create-user-form .form-group {
    margin-bottom: 0;
}

.create-user-form label {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.create-user-form input[type="checkbox"] {
    margin-right: 8px;
}

.csv-import-form .form-group {
    margin-bottom: 15px;
}

.csv-help {
    margin-top: 15px;
    padding: 15px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.csv-help h5 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.csv-help p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.csv-help pre {
    background: var(--background-color);
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    margin-top: 10px;
    overflow-x: auto;
}

/* --- 刪除確認頁面樣式 --- */
.delete-confirmation {
    margin-top: 20px;
}

.album-info,
.image-info {
    background: var(--background-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.album-info h3,
.image-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-color);
}

.album-description,
.image-description {
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.album-stats,
.image-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.image-preview {
    text-align: center;
    margin-bottom: 20px;
}

.image-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.image-album {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.warning-message {
    display: flex;
    align-items: flex-start;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.warning-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #856404;
}

.warning-content h4 {
    color: #856404;
    margin-bottom: 10px;
    font-weight: 600;
}

.warning-content p {
    color: #856404;
    margin-bottom: 10px;
}

.warning-content ul {
    color: #856404;
    margin-left: 20px;
}

.warning-content li {
    margin-bottom: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

/* --- 響應式設計 --- */
@media (max-width: 992px) {
    .user-actions {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .create-user-form .form-group {
        margin-bottom: 15px;
    }
    
    .image-view-container {
        grid-template-columns: 1fr;
    }
    
    .album-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .gallery-grid, .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .upload-container {
        padding: 0 15px;
    }
    
    .upload-header, .album-selection-section, .upload-section, .upload-actions {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }
    .form-container {
        padding: 20px;
    }
    
    .upload-hint {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-upload {
        font-size: 1.1rem;
        padding: 15px 30px;
        min-width: 180px;
    }
}

