/* 創作者專區 - IG 風格，與主站獨立 */

:root {
    --ig-bg: #fafafa;
    --ig-border: #dbdbdb;
    --ig-text: #262626;
    --ig-text-secondary: #8e8e8e;
    --ig-primary: #0095f6;
    --ig-link: #00376b;
    --ig-white: #ffffff;
    --ig-card-bg: #ffffff;
    --ig-shadow: 0 1px 3px rgba(0,0,0,.08);
}

* {
    box-sizing: border-box;
}

.ig-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--ig-bg);
    color: var(--ig-text);
    min-height: 100vh;
    padding-top: 53px;
}

/* 頂欄 - IG 風格 */
.ig-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 53px;
    background: var(--ig-white);
    border-bottom: 1px solid var(--ig-border);
    z-index: 100;
}

.ig-topbar-inner {
    max-width: 975px;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ig-topbar-back {
    color: var(--ig-text);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.ig-topbar-back:hover {
    color: var(--ig-text-secondary);
}

.ig-topbar-placeholder {
    width: 40px;
}

.ig-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.ig-topbar-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ig-topbar-link {
    font-size: 0.8125rem;
    color: var(--ig-text-secondary);
    text-decoration: none;
    white-space: nowrap;
}

.ig-topbar-link:hover {
    color: var(--ig-text);
}

.ig-topbar-link-primary {
    color: var(--ig-primary);
    font-weight: 600;
}

/* 列表頁 - 探索/個人卡風格 */
.ig-main {
    max-width: 975px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.ig-intro-card {
    background: linear-gradient(140deg, #ffffff 10%, #f7fbff 100%);
    border: 1px solid var(--ig-border);
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 18px;
}

.ig-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.ig-list-subtitle {
    font-size: 0.875rem;
    color: var(--ig-text-secondary);
    margin: 0 0 20px 0;
}

.ig-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ig-search-input {
    flex: 1;
    border: 1px solid var(--ig-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    background: var(--ig-white);
    color: var(--ig-text);
}

.ig-search-input:focus {
    border-color: var(--ig-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.15);
}

.ig-search-btn {
    border: none;
    border-radius: 10px;
    background: var(--ig-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
}

.ig-search-btn:hover {
    opacity: .92;
}

.ig-admin-link {
    margin: 0 0 16px 0;
}

.ig-admin-link a {
    font-size: 0.875rem;
    color: var(--ig-primary);
    font-weight: 600;
    text-decoration: none;
}

.ig-admin-link a:hover {
    text-decoration: underline;
}

/* 篩選列 */
.ig-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ig-border);
}

.ig-filter label {
    font-size: 0.875rem;
    color: var(--ig-text-secondary);
    margin: 0;
}

/* 按鈕式篩選 */
.ig-filter-group {
    margin-bottom: 12px;
}

.ig-filter-group:last-of-type {
    margin-bottom: 0;
}

.ig-filter-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--ig-text-secondary);
    margin-bottom: 8px;
}

.ig-filter-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ig-filter-btn {
    display: inline-block;
    font-size: 0.875rem;
    padding: 6px 14px;
    border: 1px solid var(--ig-border);
    border-radius: 20px;
    background: var(--ig-white);
    color: var(--ig-text);
    text-decoration: none;
    transition: border-color .2s, background .2s, color .2s;
}

.ig-filter-btn:hover {
    border-color: var(--ig-text-secondary);
    background: var(--ig-bg);
}

.ig-filter-btn.active {
    border-color: var(--ig-primary);
    background: var(--ig-primary);
    color: #fff;
}

.ig-filter-btn.active:hover {
    opacity: 0.9;
    color: #fff;
}

.ig-filter-clear {
    font-size: 0.8125rem;
    color: var(--ig-text-secondary);
    text-decoration: none;
}

.ig-filter-clear:hover {
    color: var(--ig-primary);
    text-decoration: underline;
}

.ig-creator-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ig-creator-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--ig-border);
    color: var(--ig-text-secondary);
}

.ig-creator-ip {
    font-size: 0.7rem;
    color: var(--ig-primary);
    margin-top: 2px;
}

/* 創作者卡片 - IG 個人預覽 */
.ig-creator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}

@media (min-width: 640px) {
    .ig-creator-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.ig-creator-card {
    display: block;
    text-decoration: none;
    color: var(--ig-text);
    background: var(--ig-card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--ig-border);
    transition: border-color .2s, box-shadow .2s;
}

.ig-creator-card:hover {
    border-color: var(--ig-text-secondary);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.ig-creator-avatar {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ig-creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ig-creator-avatar .ig-placeholder-avatar {
    font-size: 3rem;
    color: var(--ig-text-secondary);
}

.ig-creator-info {
    padding: 12px;
}

.ig-creator-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ig-creator-intro {
    font-size: 0.8125rem;
    color: var(--ig-text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ig-creator-meta {
    font-size: 0.75rem;
    color: var(--ig-text-secondary);
    margin-top: 4px;
}

.ig-profile-shop-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--ig-text-secondary);
    border: 1px dashed var(--ig-border);
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* 個人頁 - IG 個人檔案版面 */
.ig-profile {
    max-width: 975px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    position: relative;
}

.ig-profile-manage-link {
    position: absolute;
    top: 0;
    right: 16px;
}

.ig-profile-manage-link a {
    font-size: 0.875rem;
    color: var(--ig-primary);
    font-weight: 600;
    text-decoration: none;
}

.ig-profile-manage-link a:hover {
    text-decoration: underline;
}

.ig-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

@media (min-width: 736px) {
    .ig-profile-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
    }
}

.ig-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
}

.ig-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ig-profile-avatar .ig-placeholder-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--ig-text-secondary);
}

.ig-profile-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

@media (min-width: 736px) {
    .ig-profile-info {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .ig-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ig-topbar-links {
        gap: 8px;
    }

    .ig-topbar-link {
        font-size: 0.75rem;
    }
}

.ig-profile-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.ig-profile-intro {
    font-size: 0.9375rem;
    color: var(--ig-text);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.ig-profile-bio {
    font-size: 0.9375rem;
    color: var(--ig-text);
    line-height: 1.5;
    white-space: pre-line;
    margin: 0 0 12px 0;
}

.ig-profile-bio-wrap {
    margin: 0 0 12px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px 0;
}

.ig-profile-bio-wrap .ig-profile-bio {
    margin: 0;
    width: 100%;
}

.ig-profile-bio-wrap .ig-profile-bio-full {
    width: 100%;
}

.ig-bio-toggle {
    font-size: 0.9375rem;
    color: var(--ig-text-secondary);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    vertical-align: baseline;
    line-height: 1.5;
    flex: 0 0 auto;
}

.ig-bio-toggle:hover {
    color: var(--ig-text);
}

.ig-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #00376b;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}
.ig-profile-link:hover {
    text-decoration: underline;
}

/* 作品牆 - IG 貼文網格 */
.ig-works-section {
    border-top: 1px solid var(--ig-border);
    padding-top: 24px;
}

.ig-works-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ig-text-secondary);
}

.ig-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.ig-work-item {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--ig-border);
    cursor: pointer;
    position: relative;
}

.ig-work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.ig-work-item:hover img {
    transform: scale(1.03);
}

.ig-work-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8125rem;
    padding: 8px;
    text-align: center;
}

.ig-work-item:hover .ig-work-overlay {
    opacity: 1;
}

/* 燈箱 */
.ig-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.92);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ig-lightbox.active {
    display: flex;
}

.ig-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.ig-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-lightbox-close:hover {
    background: rgba(255,255,255,.25);
}

.ig-lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.9);
    font-size: 0.875rem;
    text-align: center;
    max-width: 90%;
}

/* 空狀態 */
.ig-empty {
    text-align: center;
    color: var(--ig-text-secondary);
    font-size: 0.9375rem;
    padding: 48px 16px;
}

/* 頁尾 */
.ig-footer {
    text-align: center;
    padding: 24px 16px;
    border-top: 1px solid var(--ig-border);
    background: var(--ig-white);
}

.ig-footer a {
    color: var(--ig-text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
}
.ig-footer a:hover {
    text-decoration: underline;
    color: var(--ig-text);
}
