/* 達人頁面專用樣式 - 統一設計語言 */

/* 基礎容器樣式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 基礎 Bootstrap 兼容性 */
.mt-4, .mb-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col-12, .col-md-4 {
    position: relative;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* 表單控制元件 */
.form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #8336D6;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(131, 54, 214, 0.25);
}

/* ==========================================================================
   達人頁面主要樣式
   ========================================================================== */

.users-page {
    margin: 0;
    padding: 0;
}

.users-page h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 篩選區域 */
.filter-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    border: 1px solid #f0f0f0;
}

.filter-section label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* 達人排行榜容器 */
.users-ranking-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

/* 達人卡片 */
.ranking-user-card {
    background: white;
    border-radius: 16px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 280px;
    justify-content: center;
    overflow: hidden;
}

.ranking-user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8336D6, #FF6B6B, #4ECDC4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-user-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.ranking-user-card:hover::before {
    opacity: 1;
}

/* 排名數字 */
.rank-number {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #8336D6, #A855F7);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(131, 54, 214, 0.3);
    z-index: 10;
}

/* 前三名特殊樣式 */
.ranking-user-card:nth-child(1) .rank-number {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.ranking-user-card:nth-child(2) .rank-number {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.4);
}

.ranking-user-card:nth-child(3) .rank-number {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.4);
}

/* 使用者頭像容器 */
.user-avatar-container {
    margin-bottom: 20px;
    margin-top: 20px;
    position: relative;
}

.user-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f8f9fa;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.ranking-user-card:hover .user-avatar-img {
    border-color: #8336D6;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(131, 54, 214, 0.2);
}

/* 使用者資訊容器 */
.user-info-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.user-name {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.user-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-name a:hover {
    color: #8336D6;
}

.user-account {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    word-break: break-word;
    font-weight: 500;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.user-stats span {
    color: #555;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.user-stats span:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.user-stats i {
    color: #8336D6;
    font-size: 14px;
}

/* ==========================================================================
   使用者個人資料頁面樣式（保持原有功能）
   ========================================================================== */

.user-profile-page {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.main-content {
    background: white;
    min-height: 400px;
}

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

/* 使用者個人資料頭部 */
.user-profile-header {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 使用者個人資料頭部 */
.user-profile-header {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cover-background {
    position: relative;
    width: 100%;
    min-height: 250px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
    z-index: 1; /* 確保背景層在按鈕下方 */
}

.header-content {
    position: relative;
    z-index: 20; /* 提高主要內容的 z-index */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    color: white;
}

/* 使用者頭部詳細樣式 */
.user-info-section {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 20px;
}

.user-avatar-section {
    flex-shrink: 0;
}

.user-avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.user-detail-section {
    flex-grow: 1;
    min-width: 0;
}

.user-name {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.user-account-name {
    font-size: 16px;
    opacity: 0.9;
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.8);
}

/* 使用者統計數據樣式 - 改善可讀性 */
.user-stats-section {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.4); /* 添加半透明背景 */
    padding: 12px 16px;
    border-radius: 12px;
    backdrop-filter: blur(8px); /* 背景模糊效果 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 文字陰影 */
}

.stat-label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.user-website {
    margin-top: 15px;
}

.website-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.website-link:hover {
    color: white;
    text-decoration: none;
}

/* 使用者個人介紹樣式改善 */
.user-bio {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-bio p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.user-bio.empty {
    text-align: center;
    padding: 24px;
    background: rgba(131, 54, 214, 0.1);
    border-radius: 16px;
    border: 2px dashed rgba(131, 54, 214, 0.3);
    backdrop-filter: blur(8px);
}

.empty-bio-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    font-style: italic;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.edit-bio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(131, 54, 214, 0.8);
    border: 1px solid rgba(131, 54, 214, 0.3);
    backdrop-filter: blur(4px);
}

.edit-bio-btn:hover {
    background: rgba(131, 54, 214, 1);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(131, 54, 214, 0.3);
}

/* 使用者標籤頁樣式 */
.user-tabs {
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-tabs {
    border-bottom: none;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 16px 24px;
    color: #666;
    text-decoration: none;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover {
    color: #FF6B6B;
    text-decoration: none;
    border-bottom-color: #FFE5E5;
}

.nav-link.active {
    color: #FF6B6B;
    border-bottom-color: #FF6B6B;
    background: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .user-info-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .user-avatar-image {
        width: 100px;
        height: 100px;
    }
    
    .user-name {
        font-size: 24px;
    }
    
    .user-stats-section {
        justify-content: center;
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .stat-box {
        padding: 10px 14px;
        min-width: 80px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .user-actions {
        justify-content: center;
        gap: 10px;
    }
    
    .user-actions .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .user-bio {
        padding: 16px;
        margin-top: 16px;
    }
    
    .user-bio p {
        font-size: 15px;
    }
    
    .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* 無內容狀態 */
.no-content-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.no-content {
    background: white;
    border-radius: 16px;
    padding: 80px 40px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.no-content i {
    color: #ddd !important;
    font-size: 48px;
    margin-bottom: 20px;
}

.no-content p {
    color: #999 !important;
    font-size: 18px;
    margin: 0;
    font-weight: 500;
}

/* ==========================================================================
   響應式設計
   ========================================================================== */

/* 平板樣式 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .users-page h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .filter-section {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .filter-section .col-md-4 {
        margin-bottom: 15px;
    }
    
    .users-ranking-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }
    
    .ranking-user-card {
        padding: 24px 20px;
        min-height: 260px;
    }
    
    .user-avatar-img {
        width: 80px;
        height: 80px;
    }
    
    .user-name {
        font-size: 16px;
    }
    
    .user-stats span {
        font-size: 13px;
        gap: 5px;
        padding: 6px 10px;
    }
    
    .rank-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* 手機樣式 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .users-page h1 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }
    
    .filter-section {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .users-ranking-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 25px;
    }
    
    .ranking-user-card {
        padding: 20px 16px;
        min-height: 240px;
    }
    
    .user-avatar-img {
        width: 70px;
        height: 70px;
    }
    
    .user-name {
        font-size: 15px;
    }
    
    .user-account {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .user-stats {
        gap: 16px;
        flex-direction: column;
        align-items: center;
    }
    
    .user-stats span {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .rank-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
        top: 15px;
        left: 15px;
    }
    
    .no-content {
        padding: 60px 30px;
    }
    
    .no-content i {
        font-size: 36px;
    }
    
    .no-content p {
        font-size: 16px;
    }
}

/* 超小手機 */
@media (max-width: 320px) {
    .users-ranking-container {
        gap: 12px;
    }
    
    .ranking-user-card {
        padding: 16px 12px;
    }
    
    .user-avatar-img {
        width: 60px;
        height: 60px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .user-stats span {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* 追蹤用戶頁面樣式 */
.following-users-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.following-user-card {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.following-user-card:hover {
    border-color: #8336D6;
    box-shadow: 0 4px 12px rgba(131, 54, 214, 0.1);
    transform: translateY(-2px);
}

.user-avatar-container {
    flex-shrink: 0;
}

.user-avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.following-user-card:hover .user-avatar-img {
    border-color: #8336D6;
}

.user-info-container {
    flex: 1;
    min-width: 0;
}

.user-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.user-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-name a:hover {
    color: #8336D6;
}

.user-account {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    word-break: break-all;
}

.user-stats {
    display: flex;
    gap: 15px;
    margin: 0;
}

.user-stats span {
    background-color: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-stats span i {
    color: #8336D6;
    font-size: 11px;
}

.no-content-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 40px;
}

.no-content i {
    color: #ccc;
    margin-bottom: 15px;
}

.no-content p {
    color: #999;
    font-size: 16px;
    margin: 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .following-users-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .following-user-card {
        padding: 15px;
        gap: 12px;
    }
    
    .user-avatar-img {
        width: 50px;
        height: 50px;
    }
    
    .user-name {
        font-size: 15px;
    }
    
    .user-stats {
        gap: 10px;
    }
    
    .user-stats span {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    .no-content {
        padding: 30px 20px;
    }
    
    .no-content i {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .following-user-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-info-container {
        width: 100%;
    }
    
    .user-stats {
        justify-content: center;
    }
}

/* 以下照片網格樣式已移至 application.css 統一管理 */

/* 用戶特定的照片樣式保留 */

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.photo-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-image {
    transform: scale(1.03);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.photo-stats span {
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.photo-stats i {
    font-size: 12px;
}

.photo-title {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

/* 用戶主頁面專用樣式 */
.user-profile-page {
    min-height: 100vh;
    background: #fafafa;
}

.main-content {
    background: white;
    min-height: 400px;
}

.main-content .container {
    padding: 30px 20px;
}

/* 無內容狀態樣式 */
.photos-grid .no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.photos-grid .no-content i {
    color: #adb5bd;
    margin-bottom: 20px;
}

.photos-grid .no-content p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* 分頁樣式 */
.pagination-center {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .photo-overlay {
        padding: 12px;
    }
    
    .photo-stats {
        gap: 12px;
    }
    
    .photo-stats span {
        font-size: 13px;
    }
    
    .photo-title {
        font-size: 13px;
    }
    
    .main-content .container {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .photo-overlay {
        padding: 10px;
    }
    
    .photo-stats {
        gap: 10px;
        margin-bottom: 6px;
    }
    
    .photo-stats span {
        font-size: 12px;
    }
    
    .photo-title {
        font-size: 12px;
    }
    
    .photos-grid .no-content {
        padding: 60px 15px;
    }
}

/* ==========================================================================
   使用者編輯頁面樣式
   ========================================================================== */

/* 編輯頁面佈局 */
#edit-user-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.edit-user-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    align-items: start;
}

/* 左側選單 */
.edit-user-sidebar {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    position: sticky;
    top: 100px;
}

.edit-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.edit-nav .nav-item:hover {
    color: #8336D6;
    background: rgba(131, 54, 214, 0.1);
    text-decoration: none;
}

.edit-nav .nav-item.active {
    color: #8336D6;
    background: rgba(131, 54, 214, 0.15);
    font-weight: 600;
}

.edit-nav .nav-item.view-profile {
    border-top: 1px solid #eee;
    margin-top: 12px;
    padding-top: 20px;
}

.edit-nav .nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* 右側編輯內容 */
.edit-user-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

/* 表單樣式 */
.edit-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label .required {
    color: #FF6B6B;
    margin-left: 4px;
}

.form-note {
    font-size: 12px;
    color: #999;
    margin-left: 4px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #8336D6;
    box-shadow: 0 0 0 3px rgba(131, 54, 214, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #FF6B6B;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.error-message {
    display: block;
    color: #FF6B6B;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* 特殊輸入框樣式 */
.account-display {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.account-prefix {
    padding: 12px 16px;
    background: #e9ecef;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.account-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.url-input-wrapper:focus-within {
    border-color: #8336D6;
    box-shadow: 0 0 0 3px rgba(131, 54, 214, 0.1);
}

.url-prefix {
    padding: 12px 16px;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    border-right: 1px solid #e9ecef;
}

.url-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    flex: 1;
}

/* OAuth 連結區塊 */
.oauth-connections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.oauth-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
}

.oauth-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.oauth-icon.facebook {
    background: #1877F2;
}

.oauth-icon.instagram {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

.oauth-info {
    flex: 1;
}

.oauth-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.oauth-status {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 2px;
}

/* 表單行動按鈕 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: #8336D6;
    color: white;
    border-color: #8336D6;
}

.btn-primary:hover {
    background: #943ddf;
    border-color: #943ddf;
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border-color: #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ddd;
    color: #333;
}

.btn-outline {
    border-color: #8336D6;
    color: #8336D6;
}

.btn-outline:hover {
    background: #8336D6;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* 密碼安全提示 */
.security-tips {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #8336D6;
}

.security-tips h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.security-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.security-tips li {
    margin-bottom: 4px;
    font-size: 13px;
}

/* 大頭照編輯器 */
.avatar-editor {
    max-width: 800px;
}

.current-avatar {
    text-align: center;
    margin-bottom: 40px;
}

.current-avatar h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.avatar-preview {
    display: inline-block;
    position: relative;
}

.current-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upload-section {
    margin-bottom: 30px;
}

.upload-section h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.upload-tips {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.upload-tips li {
    margin-bottom: 4px;
    font-size: 13px;
}

.file-upload-container {
    text-align: center;
}

.file-input {
    display: none;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #8336D6;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.file-upload-btn:hover {
    background: #943ddf;
    transform: translateY(-1px);
}

/* 圖片裁切區域 */
.crop-container {
    margin-top: 30px;
}

.crop-container h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.crop-area {
    max-width: 500px;
    max-height: 400px;
    margin: 0 auto 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.crop-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.crop-controls {
    text-align: center;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 載入中指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 12px;
}

.loading-spinner span {
    display: block;
    font-size: 16px;
    font-weight: 500;
}

/* 模態框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* 提高模態框 z-index */
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
}

/* 個人頁面的編輯功能 */
.profile-management {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1050; /* 比 header.css 的 z-index 更高 */
}

.management-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer; /* 確保顯示手型游標 */
    z-index: 1051; /* 個別元素也設定更高的 z-index */
    position: relative;
}

.management-btn:hover {
    background: white;
    color: #8336D6;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background: #8336D6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.avatar-edit-btn:hover {
    background: #943ddf;
    color: white;
    text-decoration: none;
    transform: scale(1.1);
}

/* 使用者行動按鈕統一樣式 */
.user-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.user-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-actions .btn-primary {
    background: rgba(131, 54, 214, 0.9);
    color: white;
    border-color: rgba(131, 54, 214, 0.3);
}

.user-actions .btn-primary:hover {
    background: rgba(131, 54, 214, 1);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(131, 54, 214, 0.4);
}

.user-actions .btn-outline {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-color: rgba(255, 255, 255, 0.3);
}

.user-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 1);
    color: #8336D6;
    text-decoration: none;
    transform: translateY(-2px);
    border-color: rgba(131, 54, 214, 0.3);
}

/* 提示訊息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 4px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    #edit-user-container {
        padding: 70px 15px 40px;
    }
    
    .edit-user-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .edit-user-sidebar {
        order: 2;
        position: static;
    }
    
    .edit-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 4px;
    }
    
    .edit-nav .nav-item {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .edit-nav .nav-item.view-profile {
        border-top: none;
        border-left: 1px solid #eee;
        margin-top: 0;
        margin-left: 8px;
        padding-top: 8px;
        padding-left: 16px;
    }
    
    .edit-user-content {
        order: 1;
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .oauth-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .profile-management {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
        padding: 0 20px;
    }
    
    .management-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .crop-area {
        max-width: 100%;
    }
    
    .crop-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .user-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .edit-user-content {
        padding: 16px;
    }
    
    .url-input-wrapper,
    .account-display {
        flex-direction: column;
    }
    
    .url-prefix,
    .account-prefix {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        text-align: center;
    }
    
    .avatar-editor {
        max-width: 100%;
    }
    
    .current-avatar-img {
        width: 100px;
        height: 100px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* Facebook 相關樣式 */

/* Facebook 來源標示 */
.facebook-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e3f2fd;
    color: #1877F2;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 500;
}

.facebook-source i {
    font-size: 10px;
}

/* Facebook 資訊區塊 */
.facebook-info-section {
    background: #f8f9ff;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.facebook-info-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1877F2;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.facebook-info-section .section-title i {
    font-size: 14px;
}

.facebook-info-section .info-note {
    color: #666;
    font-size: 12px;
    font-weight: 400;
    margin-left: 8px;
}

/* Facebook 只讀欄位 */
.facebook-readonly {
    margin-bottom: 16px;
}

.facebook-data {
    background: #f0f7ff !important;
    border-color: #b3d9ff !important;
    color: #1565c0 !important;
    cursor: not-allowed;
}

.facebook-data:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

/* Facebook 頭像顯示 */
.facebook-avatar-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
}

.facebook-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1877F2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
}

.avatar-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e3f2fd;
    border: 2px solid #1877F2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1877F2;
    font-size: 11px;
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
}

.avatar-fallback i {
    font-size: 24px;
    margin-bottom: 4px;
}

.avatar-source {
    color: #1565c0;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.avatar-source::before {
    content: "\f09a";
    font-family: "Font Awesome 5 Brands";
    color: #1877F2;
    margin-right: 4px;
}

/* Facebook 元資訊 */
.facebook-meta-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e3f2fd;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 12px;
}

.meta-item i {
    color: #1877F2;
    font-size: 11px;
}

/* 社群連結已連接狀態 */
.oauth-item.connected {
    background: #f0f7ff;
    border-color: #b3d9ff;
}

.oauth-status.connected {
    color: #1565c0 !important;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.oauth-status.connected i {
    color: #4caf50;
}

.oauth-account {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 2px;
    font-style: italic;
}

.btn-connected {
    background: #e8f5e8 !important;
    color: #2e7d2e !important;
    border-color: #c8e6c9 !important;
    cursor: default;
    pointer-events: none;
}

/* Facebook 響應式設計 */
@media (max-width: 768px) {
    .facebook-meta-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .facebook-source {
        display: block;
        margin-top: 4px;
        margin-left: 0;
    }

    .facebook-avatar-display {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 8px;
    }

    .facebook-avatar-img {
        width: 60px;
        height: 60px;
        align-self: center;
    }

    .avatar-source {
        font-size: 12px;
        justify-content: center;
    }
}

/* 隱私設定區塊 */
.privacy-settings-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.privacy-settings-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.privacy-settings-section .section-title i {
    color: #28a745;
    font-size: 14px;
}

/* 複選框樣式 */
.checkbox-group {
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(40, 167, 69, 0.05);
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-input:checked + .checkbox-custom {
    background: #28a745;
    border-color: #28a745;
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-text {
    flex: 1;
}

.checkbox-text strong {
    display: block;
    color: #495057;
    font-size: 14px;
    margin-bottom: 4px;
}

.checkbox-help {
    display: block;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
}

/* 示範資料提示 */
.demo-note {
    display: block;
    color: #007bff;
    font-size: 11px;
    font-style: italic;
    margin-top: 4px;
}
