.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --bg-color: #0f0f13;
    --card-bg: #1a1a24;
    --modal-bg: #1e1e2d;
    --accent: #00f3ff;
    --secondary: #ff2a6d;
    --text-main: #ffffff;
    --text-sub: #b3b3b3;
    --tag-bg: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    padding: 90px 40px 40px 40px;
    /* Modified for Sticky Header */
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 243, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 42, 109, 0.05) 0%, transparent 20%);
    min-height: 100vh;
}

/* --- Header Controls (Sticky) --- */
.header-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 0 40px;
    background: transparent;
    z-index: 800;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
    pointer-events: none;
    /* Let clicks pass through empty space */
}

/* Unified Search Container Style */
.search-bar-container {
    pointer-events: auto;
    display: flex;
    align-items: center;
    background: rgba(15, 15, 19, 0.85);
    /* Proper glass background here */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 25px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-bar-container:focus-within {
    background: rgba(20, 20, 30, 0.95);
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 15px 40px rgba(0, 243, 255, 0.2);
}

.header-controls.header-hidden {
    transform: translateY(-100px);
    /* Hide by moving up */
    opacity: 0;
}

/* Removed .search-box wrapper styles, now handled by container */
.search-icon {
    font-size: 1.1em;
    color: var(--text-sub);
    margin-right: 15px;
}

.search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1em;
    padding: 10px 0;
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Search Clear Button */
.search-clear-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    margin-left: 8px;
    flex-shrink: 0;
    font-size: 0.8em;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.filter-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
    margin-left: 10px;
}

.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.filter-toggle-btn.active {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* --- Filter Panel (Dropdown below search) --- */
.filter-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 100%;
    max-width: 900px;
    background: rgba(25, 25, 35, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 900;
}

.filter-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.filter-panel-inner {
    padding: 22px 26px;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 0;
    box-sizing: border-box;
}

.filter-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 16px 0;
}

.filter-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.78em;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

/* Sort Grid */
.sort-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.sort-option-chip {
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.82em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-sub);
    user-select: none;
    text-align: center;
    white-space: nowrap;
}

.sort-option-chip i {
    font-size: 1em;
}

.sort-option-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.sort-option-chip.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 243, 255, 0.15);
}

/* Bottom row: platforms + capacity side by side */
.filter-bottom-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.filter-bottom-row .filter-section:first-child {
    flex-shrink: 0;
}

.filter-bottom-row .filter-section:last-child {
    flex: 1;
    min-width: 0;
}

/* Platform Checks */
.platform-checks {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.check-label {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.check-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.check-label .label-text {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-sub);
    transition: all 0.2s;
    font-size: 0.85em;
    cursor: pointer;
}

.check-label .label-text:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.check-label input:checked~.label-text {
    background: var(--text-main);
    color: #000;
    border-color: #fff;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Capacity Number Input */
.capacity-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.capacity-number-input {
    width: 80px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.9em;
    font-family: monospace;
    outline: none;
    transition: all 0.2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.capacity-number-input::-webkit-outer-spin-button,
.capacity-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.capacity-number-input:focus {
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
}

.capacity-hint {
    color: var(--text-sub);
    font-size: 0.8em;
    white-space: nowrap;
}

/* Sort Order Buttons */
.sort-order-btns {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.sort-order-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.85em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-order-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.sort-order-btn.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

/* Mobile */
@media (max-width: 768px) {
    .filter-panel {
        width: 95vw;
        max-width: none;
    }

    .sort-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bottom-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* 隤噼��豢��� */
.lang-box {
    position: relative;
}

.lang-select {
    padding: 12px 15px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    font-family: inherit;
}

.lang-select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.lang-select option {
    background-color: #1e1e2d;
    color: white;
}

/* �萇𥿢敹急㭘�萄�蝒� */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.shortcuts-modal.active {
    opacity: 1;
    visibility: visible;
}

.shortcuts-content {
    background: var(--modal-bg);
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.shortcuts-content h3 {
    margin-bottom: 20px;
    color: var(--accent);
}

.shortcuts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcuts-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.shortcuts-list li:last-child {
    border-bottom: none;
}

kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.9em;
    color: var(--accent);
    min-width: 30px;
    text-align: center;
}

/* �衤犖瑼娍��𣇉內�厰� (New Feature) */
.profile-toggle-btn {
    width: 50px;
    height: 50px;
    font-size: 2.2em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    border-radius: 50%;
}

.profile-toggle-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* --- �∠��𡑒”��身閮� (Using v02 Base for Stability) --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

.info-card {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    /* animation: fadeIn 0.5s ease forwards; Removed to prevent re-render flash */
    opacity: 1;
    /* Fixed opacity */
}

.info-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    z-index: 10;
}

.mini-map-card .card-thumb-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    /* Fix: Enforce standard ratio */
    overflow: hidden;
}

.mini-map-card .card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb-wrapper {
    width: 100%;
    height: auto;
    position: relative;
    background-color: #000;
}

.card-thumb {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: filter 0.3s, opacity 0.4s ease;
}

/* 懶載入骨架屏 */
.card-thumb.lazy-placeholder {
    aspect-ratio: 16 / 9;
    background: linear-gradient(110deg, #1a1a24 30%, #252535 50%, #1a1a24 70%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    opacity: 1;
}

.card-thumb.lazy-loaded {
    animation: none;
    background: none;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.info-card:hover .card-thumb {
    filter: brightness(0.5);
}

/* �𥕦��厰� (New Feature) */
.card-heart {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Hover logic */
    opacity: 0;
}

.card-heart:hover,
.info-card:hover .card-heart,
.card-heart.active {
    opacity: 1;
}

.card-heart:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.card-heart.active {
    color: var(--secondary);
    border-color: var(--secondary);
}

.platform-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.info-card:hover .platform-badges {
    opacity: 1;
}

.badge {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.pc {
    color: #61dafb;
}

.badge.quest {
    color: #4caf50;
}

.badge.ios {
    color: #999;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0.6) 80%, transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.info-card:hover .card-content {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    font-size: 1.4em;
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    height: 1.8em;
    overflow: hidden;
}

.mini-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7em;
    font-weight: 600;
    background: rgba(0, 243, 255, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #ddd;
    margin-top: 5px;
}

.live-status {
    color: #4caf50;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
}

/* --- Modal 閰喟敦閬𣇉� --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3500;
    /* Fix: Higher than profile-overlay (3000) */
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 95%;
    max-width: 1100px;
    height: auto;
    max-height: 90vh;
    aspect-ratio: 16/9;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: 0.3s;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1005;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header-section {
    margin-bottom: 20px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#m-title {
    margin: 0;
    font-size: 2.5em;
    color: white;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

#m-author {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.author-info {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--accent);
    font-size: 1.1em;
    font-weight: 600;
    transition: 0.2s;
}

.author-info:hover {
    color: white;
    text-shadow: 0 0 10px var(--accent);
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    margin-right: 12px;
    background-color: #000;
}

/* 閮�鰐�厰� (New Feature) */
.subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
}

.subscribe-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.subscribe-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Modal �𥕦��厰� (New Feature) */
.modal-heart-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: 0.2s;
    margin-left: 15px;
}

.modal-heart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-heart-btn.active {
    color: var(--secondary);
    background: rgba(255, 42, 109, 0.1);
    border: 1px solid var(--secondary);
}


.detail-layout {
    display: flex;
    gap: 40px;
    flex: 1;
    min-height: 0;
}

.left-panel {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.description-wrapper {
    position: relative;
    height: 3.4em;
    margin-bottom: 20px;
    z-index: 10;
}

.description-wrapper.auto-height {
    height: auto;
    min-height: 100px;
    flex-grow: 1;
    overflow-y: visible;
    margin-bottom: 0;
}

.description-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    background: transparent;
    transition: all 0.3s ease;
    border-radius: 8px;
    color: #ddd;
    line-height: 1.6;
    font-size: 1em;
}

.description-inner p {
    margin: 0;
}

.description-wrapper.auto-height .description-inner {
    position: static;
    overflow: visible;
    padding-right: 10px;
}

.description-wrapper.expandable:hover .description-inner {
    max-height: 500px;
    background: rgba(30, 30, 45, 0.98);
    padding: 15px;
    margin: -15px;
    width: calc(100% + 30px);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--accent);
    overflow: visible;
}

.desc-ellipsis {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, rgba(32, 32, 53, 0.9) 30%);
    color: var(--accent);
    font-weight: bold;
    padding-left: 20px;
    padding-right: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 20;
}

.description-wrapper.expandable:not(.auto-height) .desc-ellipsis {
    opacity: 1;
}

.description-wrapper.expandable:hover .desc-ellipsis {
    opacity: 0;
}


/* --- 敶梁��鞱汗�� --- */
.video-preview-box {
    flex-grow: 1;
    min-height: 180px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.yt-preview-card {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    position: relative;
    transition: transform 0.3s;
}

.yt-preview-card:hover {
    transform: scale(1.02);
}

.yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    transition: 0.3s;
}

.yt-play-icon i {
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

.yt-preview-card:hover .yt-play-icon {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    font-size: 0.9em;
    pointer-events: none;
}

/* --- Filter Panel Styles --- */
.filter-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-sub);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.2);
}

.filter-toggle-btn.active {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent);
}

/* (Legacy filter styles removed) */

/* --- 喳豢 LAUNCH 厰 --- */
.right-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item h4 {
    margin: 0;
    font-size: 1.4em;
    color: var(--accent);
}

.stat-item span {
    font-size: 0.8em;
    color: #aaa;
    display: block;
    margin-top: 4px;
}


.info-row {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Right of Label */
}

.info-label {
    color: #aaa;
    font-size: 0.8em;
    display: block;
    margin-bottom: 0;
    /* Remove bottom margin */
    min-width: 60px;
    /* Optional alignment */
    flex-shrink: 0;
    /* Don't shrink label */
}

.info-value,
.tag-container-placeholder {
    flex-grow: 1;
    /* Take remaining space */
    min-width: 0;
    /* Allow shrinking for text overflow */
}

.info-value {
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- 璅嗵惜�脫惣�批��� --- */
.tag-container-placeholder {
    height: 60px;
    position: relative;
    z-index: 5;
}

.tag-cloud-inner {
    position: absolute;
    bottom: 0;
    /* Align to bottom for upward expansion */
    right: 0;
    /* Align right */
    width: 100%;
    max-height: 60px;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* Fix: Left align tags */
    gap: 6px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 8px;
    box-sizing: border-box;
}

.tag-container-placeholder.expandable:hover .tag-cloud-inner {
    max-height: 500px;
    background: #1e1e2d;
    padding: 10px;
    margin: -10px;
    /* Expands outwards */
    width: calc(100% + 20px);
    z-index: 100;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    /* Shadow upwards */
    border: 1px solid var(--accent);
}

.tag-ellipsis {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.8) 50%);
    color: var(--accent);
    font-weight: bold;
    padding-left: 20px;
    padding-right: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.tag-container-placeholder.expandable .tag-ellipsis {
    opacity: 1;
}

.tag-container-placeholder.expandable:hover .tag-ellipsis {
    opacity: 0;
}

.big-tag {
    background: rgba(0, 243, 255, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    border: 1px solid rgba(0, 243, 255, 0.2);
    white-space: nowrap;
}

/* --- LAUNCH �厰� --- */
.launch-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2em;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Segoe UI', sans-serif;
    color: var(--accent);
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 6px;
    /* Polish: Slightly softer corners */
    margin-top: 20px;
    /* Fix: Move up (remove auto) */
    transition: all 0.3s ease;
    box-sizing: border-box;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    /* Polish: Text glow */
}

.launch-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 30px var(--accent);
    /* Polish: Stronger hover glow */
    transform: translateY(-2px);
    text-shadow: none;
}

/* --- �亦��游��厰� --- */
.load-more-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 60px;
    width: 100%;
}

.load-more-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.load-more-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* --- 頛芣偘�蠘� (Carousel - New Feature) --- */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.horizontal-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 20px 0;
    white-space: nowrap;
    scroll-behavior: smooth;
}

.horizontal-scroll-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    /* Fix: Higher than hover cards (10) */
    transition: all 0.2s;
    opacity: 0;
}

.carousel-wrapper:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent);
}

.scroll-btn.left {
    left: 10px;
    /* Inside */
}

.scroll-btn.right {
    right: 10px;
    /* Inside */
}

/* Hide element helper class */
.d-none {
    display: none !important;
}

/* --- �衤犖瑼娍� Overlay (New Feature) --- */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 19, 0.98);
    backdrop-filter: blur(15px);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    padding: 60px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    overflow-y: auto;
}

.profile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2.5em;
    cursor: pointer;
}

.profile-section {
    margin-bottom: 50px;
}

.profile-section h2 {
    color: var(--accent);
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* --- 鞈��憭暹�蝐斤頂蝯� --- */
.folder-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.folder-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.folder-tab:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent);
}

.folder-tab.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

.folder-tab.add-folder-btn {
    background: transparent;
    border-style: dashed;
    color: var(--accent);
}

.folder-tab.add-folder-btn:hover {
    background: rgba(0, 243, 255, 0.15);
}

.delete-folder-btn {
    background: rgba(255, 42, 109, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-folder-btn:hover {
    background: var(--secondary);
    color: #fff;
}

/* --- 鞈��憭暹�雿𨅯� --- */
.folder-actions {
    margin-bottom: 20px;
}

.folder-action-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-folder-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-folder-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* 資料夾分享按鈕 */
.share-folder-btn:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
}

.share-folder-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.import-folder-btn:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: #ff9800;
    color: #ff9800;
}

/* 輸出代碼顯示 */
.export-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
}

.export-code-label {
    color: var(--text-sub);
    font-size: 0.85rem;
}

.code-text {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    color: #4caf50;
    letter-spacing: 3px;
}

.copy-code-btn {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid #4caf50;
    color: #4caf50;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.copy-code-btn:hover {
    background: #4caf50;
    color: #fff;
}

.close-export-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1rem;
    margin-left: auto;
}

.close-export-btn:hover {
    color: var(--text-main);
}

/* 匯入 Modal */
.import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 7000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-modal {
    background: var(--modal-bg);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.import-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.import-modal-header h3 {
    margin: 0;
    color: var(--text-main);
}

.import-modal-header .close-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 1.2rem;
    cursor: pointer;
}

.import-step label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.import-code-input-row {
    display: flex;
    gap: 10px;
}

.import-code-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    text-align: center;
}

.import-code-input:focus {
    border-color: var(--accent);
    outline: none;
}

.preview-btn {
    padding: 10px 18px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.preview-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.import-error {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-top: 8px;
}

.import-preview-info {
    margin-bottom: 16px;
}

.import-preview-info p {
    margin: 0;
    color: var(--text-main);
}

.import-meta {
    color: var(--text-sub) !important;
    font-size: 0.85rem;
    margin-top: 4px !important;
}

.import-preview-worlds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.import-world-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.import-world-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.import-world-title {
    padding: 4px 6px;
    font-size: 0.75rem;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.import-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.import-action-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.import-new-btn:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
}

.import-merge-btn:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: #ff9800;
    color: #ff9800;
}

.merge-folder-picker {
    margin-bottom: 12px;
}

.merge-folder-picker p {
    color: var(--text-sub);
    font-size: 0.85rem;
    margin: 0 0 8px 0;
}

.merge-folder-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.merge-folder-item {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.merge-folder-item:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: #ff9800;
}

.import-step .back-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 0;
}

.import-step .back-btn:hover {
    color: var(--text-main);
}

/* 資料夾分享 - 手機適配 */
@media (max-width: 768px) {
    .folder-action-btns {
        flex-wrap: wrap;
    }

    .folder-action-btns .edit-folder-btn,
    .folder-action-btns .delete-folder-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .export-code-box {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .code-text {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    .import-modal {
        width: 95%;
        padding: 16px;
        max-height: 85vh;
    }

    .import-code-input-row {
        flex-direction: column;
    }

    .import-code-input {
        font-size: 1rem;
    }

    .import-actions {
        flex-direction: column;
    }

    .import-preview-worlds {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

.folder-edit-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.folder-edit-input input {
    flex-grow: 1;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95em;
}

.folder-edit-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.folder-edit-input .save-btn {
    background: var(--accent);
    border: none;
    color: #000;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.folder-edit-input .cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-sub);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- �芷膄蝣箄�撠滩店獢� --- */
.delete-confirm-box {
    background: rgba(255, 42, 109, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.delete-confirm-box p {
    margin-bottom: 15px;
    color: var(--text-main);
}

.confirm-btns {
    display: flex;
    gap: 10px;
}

.confirm-yes {
    background: var(--secondary);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.confirm-no {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- �臬��讠�鞈��憭� Grid --- */
.folder-worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.folder-worlds-grid .profile-card {
    min-width: unset;
    max-width: unset;
}

.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-sub);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.expand-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* --- 鞈��憭暸���膥 Modal --- */
.folder-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 5500;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.folder-picker-overlay.active {
    opacity: 1;
    visibility: visible;
}

.folder-picker-modal {
    background: #1a1a24;
    border-radius: 16px;
    padding: 30px;
    min-width: 350px;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.folder-picker-modal h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.3em;
}

.folder-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.folder-item:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent);
}

.folder-name {
    flex-grow: 1;
    font-weight: 500;
}

.folder-count {
    color: var(--text-sub);
    font-size: 0.85em;
}

.folder-check {
    color: var(--accent);
}

.new-folder-input {
    display: flex;
    gap: 10px;
}

.new-folder-input input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95em;
}

.new-folder-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.new-folder-input button {
    background: var(--accent);
    border: none;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.new-folder-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent);
}

.remove-from-all-btn {
    width: 100%;
    background: rgba(255, 42, 109, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.remove-from-all-btn:hover {
    background: var(--secondary);
    color: #fff;
}

.author-maps-row {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.author-info-column {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.author-info-column .author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.author-info-column .author-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
}

.author-maps-column {
    flex-grow: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    position: relative;
    padding-bottom: 10px;
}

.author-maps-column::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.mini-grid {
    display: flex;
    gap: 15px;
    padding-bottom: 10px;
}

.mini-map-card {
    min-width: 220px;
    max-width: 220px;
    height: auto;
}

.profile-card {
    min-width: 300px;
    max-width: 350px;
    flex-shrink: 0;
}

/* --- �踵�撘讛矽�� --- */
@media (max-width: 900px) {
    .modal-content {
        height: auto;
        max-height: 95vh;
        overflow-y: auto;
        aspect-ratio: auto;
    }

    .detail-layout {
        flex-direction: column;
        gap: 20px;
    }

    .video-preview-box {
        height: 200px;
        flex-grow: 0;
    }

    .header-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 15px 20px;
        gap: 10px;
        position: static;
    }

    body {
        padding-top: 40px;
    }

    .sort-box {
        width: 100%;
    }

    .profile-overlay {
        padding: 30px;
    }
}

#loading {
    text-align: center;
    color: #888;
    margin-top: 50px;
    font-size: 1.2em;
}

.no-results {
    text-align: center;
    color: var(--text-sub);
    font-size: 1.2em;
    padding: 40px;
}

.error-msg {
    text-align: center;
    color: #ff4444;
    padding: 20px;
}

/* ===== �餃�/閮餃� Modal ===== */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

.auth-content {
    background: rgba(30, 30, 45, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(0, 243, 255, 0.3);
}

.auth-content .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--text-sub);
    cursor: pointer;
    background: none;
    border: none;
    transition: 0.2s;
}

.auth-content .close-btn:hover {
    color: var(--accent);
}

.auth-form h2 {
    margin: 0 0 25px 0;
    color: var(--text-main);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-sub);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1em;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.auth-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.auth-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent), #00b8d4);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-sub);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ===== Profile Header (�冽�鞈��) ===== */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 243, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    font-size: 3em;
    color: var(--accent);
}

.user-name {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-main);
}

.user-email {
    font-size: 0.9em;
    color: var(--text-sub);
}

.guest-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sub);
    font-size: 1.1em;
}

.guest-info i {
    font-size: 2em;
}

.login-btn,
.logout-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.login-btn {
    background: linear-gradient(135deg, var(--accent), #00b8d4);
    border: none;
    color: #000;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.4);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.logout-btn:hover {
    background: rgba(255, 42, 109, 0.1);
}

/* 撽𡑒�蝣潸撓�交� */
.verification-input {
    font-size: 24px !important;
    letter-spacing: 8px;
    text-align: center;
    font-weight: bold;
}

.verify-hint {
    color: var(--text-sub);
    margin-bottom: 20px;
    text-align: center;
}

.verify-hint strong {
    color: var(--accent);
}

.auth-success {
    background: rgba(0, 255, 100, 0.1) !important;
    border-color: #00ff64 !important;
    color: #00ff64 !important;
}

/* --- ?剖?銝𠰴�璅?? (New Feature) --- */
.avatar-wrapper {
    position: relative;
    cursor: pointer;
    margin-right: 15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.avatar-wrapper .user-avatar {
    font-size: 60px;
    /* 閬�??�𧋦?�之撠?*/
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 50%;
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay i {
    color: white;
    font-size: 20px;
}

/* --- Header ?剖? (New Feature) --- */
.header-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    transition: all 0.3s;
}

.profile-toggle-btn:hover .header-avatar-img {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* --- 鋆�?閬𣇉? (New Feature) --- */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.crop-modal.active {
    opacity: 1;
    visibility: visible;
}

.crop-container {
    background: #1e1e2d;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.crop-container h3 {
    margin: 0 0 15px 0;
    color: var(--accent);
    text-align: center;
}

.img-container {
    max-height: 60vh;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
}

.img-container img {
    max-width: 100%;
    display: block;
}

.crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.crop-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: 0.2s;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.confirm-btn {
    background: var(--accent);
    color: #000;
}

.confirm-btn:hover {
    background: #00d6e2;
}

/* ========== 通知系統樣式 ========== */
.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-btn i {
    font-size: 18px;
    color: #fff;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1001;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.notification-panel.active {
    right: 0;
}

.notification-panel-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.mark-all-read {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.mark-all-read:hover {
    background: var(--primary-color);
    color: #000;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
    text-align: center;
}

.notification-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.notification-empty p {
    font-size: 16px;
    margin: 0 0 8px;
    color: #888;
}

.notification-empty small {
    font-size: 12px;
    color: #555;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.notification-thumb {
    width: 60px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-info {
    flex: 1;
    min-width: 0;
}

.notification-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}

.notification-author {
    color: var(--primary-color);
}

/* ========== Profile Overlay 新增樣式 ========== */
.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.profile-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.profile-action-btn.admin-btn {
    background: var(--primary-color);
    color: #000;
}

.profile-action-btn.admin-btn:hover {
    filter: brightness(1.1);
}

.profile-action-btn.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.profile-action-btn.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 設定區塊 */
.settings-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.setting-label {
    color: #aaa;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-label i {
    width: 20px;
    text-align: center;
}

.setting-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* 設定列 - 可點擊 */
.setting-row.clickable {
    cursor: pointer;
    border-radius: 8px;
    padding: 12px 8px;
    margin: 0 -8px;
    transition: background 0.2s;
}

.setting-row.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.setting-row.danger-row .setting-label {
    color: #ff6b6b;
}

/* 設定展開面板 */
.settings-expand-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
    margin: 4px 0 8px 0;
}

.settings-expand-panel .form-group {
    margin-bottom: 12px;
}

.settings-expand-panel .form-group label {
    display: block;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 6px;
}

.settings-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent, #00c6ff);
}

.settings-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: rgba(255, 60, 60, 0.1);
    border-radius: 6px;
}

.settings-btn-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.settings-cancel-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.settings-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.settings-confirm-btn {
    padding: 8px 18px;
    background: var(--accent, #00c6ff);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.settings-confirm-btn:hover {
    opacity: 0.85;
}

.settings-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 通知迷你列表 */
.notification-mini-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-mini-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.notification-mini-item.notif-unread {
    background: rgba(100, 180, 255, 0.1);
    border-left-color: var(--accent, #00c6ff);
}

.notification-mini-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-mini-thumb {
    width: 50px;
    height: 38px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-mini-info {
    flex: 1;
    min-width: 0;
}

.notification-mini-title {
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-mini-author {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.more-notifications {
    text-align: center;
    font-size: 12px;
    color: var(--primary-color);
    padding: 8px;
}

.more-notifications.clickable {
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.more-notifications.clickable:hover {
    background: rgba(255, 255, 255, 0.08);
}

.more-notifications i {
    margin-right: 4px;
    font-size: 10px;
}

/* 通知類型標籤 */
.notif-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

.notif-type-badge.badge-new {
    background: rgba(76, 175, 80, 0.25);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.notif-type-badge.badge-update {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.35);
}

.empty-hint {
    color: #666;
    font-style: italic;
    font-size: 13px;
    padding: 10px 0;
}

.empty-hint p {
    margin: 0;
}

/* ========== Profile Overlay 改為左側滑出 ========== */
.profile-overlay {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    z-index: 3000;
    transition: left 0.3s ease;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 25px;
}

.profile-overlay.active {
    left: 0;
}

.profile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* 頭像按鈕移到左邊 */
.header-controls {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.profile-toggle-btn {
    position: fixed !important;
    left: 20px !important;
    top: 20px !important;
    z-index: 101 !important;
}

/* ========== 修復並優化 Profile Sidebar ========== */
/* 語言選擇器選項顏色修復 */
.setting-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Profile Overlay 不阻擋右側滾動 */
.profile-overlay {
    pointer-events: none;
}

.profile-overlay.active {
    pointer-events: auto;
}

/* 快速連結按鈕樣式 */
.quick-link-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.quick-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.quick-link-btn i {
    font-size: 18px;
    color: var(--primary-color);
}

.quick-link-btn .link-text {
    flex: 1;
    text-align: left;
}

.quick-link-btn .link-title {
    font-size: 14px;
    font-weight: 500;
}

.quick-link-btn .link-count {
    font-size: 12px;
    color: #888;
}

.quick-link-btn .link-arrow {
    color: #666;
}

/* ========== 全螢幕專屬視圖 ========== */
.fullscreen-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.fullscreen-view.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.fullscreen-header h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fullscreen-header h2 i {
    color: var(--primary-color);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.fullscreen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.author-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.author-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.author-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #666;
    text-align: center;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ========== 修復文字裁切與滾動問題 ========== */

/* 1. 修復 Profile Header 佈局 (避免按鈕擠在右邊) */
.profile-header {
    flex-direction: column;
    /* 改為垂直排列 */
    align-items: flex-start;
    /* 靠左對齊 */
    gap: 15px;
}

/* 確保用戶資訊 (頭像+名字) 佔滿寬度 */
.user-info {
    width: 100%;
}

/* 確保按鈕列佔滿寬度並正常排列 */
.profile-actions {
    width: 100%;
    margin-top: 5px;
}

/* 2. 讓側邊欄內容可滾動 */
.profile-overlay {
    overflow-y: auto;
    /* 確保垂直方向可滾動 */
    max-height: 100vh;
}

/* 3. 修復搜尋框位置 (確保在 Header 正中央直上直下) */
.header-controls {
    /* 確保置中且不歪斜 */
    align-items: center;
}

/* 確保按鈕文字不換行 */
.profile-action-btn {
    white-space: nowrap;
}

.profile-header .user-name {
    margin-right: 0;
    /* 移除可能的右側邊距 */
}

/* 調整頭像容器在垂直排列時的樣式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ========== 強制收藏內容靠左對齊 ========== */
.quick-link-btn {
    justify-content: flex-start;
    /* 確保內容從左邊開始 */
}

.quick-link-btn i:first-child {
    /* 左側圖示樣式微調 */
    margin-right: 5px;
}

.quick-link-btn .link-text {
    text-align: left;
    /* 強制文字左對齊 */
    flex: 1;
    /* 佔滿中間空間 */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* 確保文字區塊內的項目也靠左 */
}

.quick-link-btn .link-title {
    width: 100%;
    text-align: left;
}

.quick-link-btn .link-count {
    width: 100%;
    text-align: left;
}

/* ========== 修復按鈕寬度超出 ========== */
.quick-link-btn {
    box-sizing: border-box;
    /* 確保 padding 不會撐大寬度 */
    width: 100%;
    /* 填滿父容器 */
    max-width: 100%;
    /* 防止意外撐開 */
}

/* 防止 Profile Overlay 內容撐開 */
.profile-overlay {
    box-sizing: border-box;
}

/* 確保 Profile Section 也不會超出 */
.profile-section {
    width: 100%;
    box-sizing: border-box;
}

/* ========== 新增外部懸浮縮回按鈕樣式 ========== */
.profile-collapse-btn {
    position: absolute;
    top: 50%;
    /* 垂直置中 */
    right: -30px;
    /* 移出側邊欄外 (按鈕寬度預設約 30px) */
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: rgba(20, 20, 30, 0.95);
    border-radius: 0 10px 10px 0;
    /* 右側圓角 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 5px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 3001;
    /* 比 overlay 高 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    /* 與側邊欄接合處不要邊框 */
    color: #fff;
    transition: all 0.3s;
}

.profile-collapse-btn:hover {
    background: var(--primary-color);
    color: #000;
}

/* 因為按鈕是 absolute 定位於 overlay 內，所以 overlay 本身需要 overflow visible 才能讓按鈕顯示在外面 */
.profile-overlay {
    overflow: visible;
}

/* 但我們又需要內容可滾動，所以需要一個內部容器來處理滾動 */
/* 由於之前的修改直接把 overflow-y: auto 加在 .profile-overlay 上，這裡為了相容，我們需要微調 */
/* 
   修正方案：
   1. .profile-overlay 維持 overflow: visible (為了顯示突出按鈕)
   2. 按鈕使用 fixed 定位跟隨側邊欄移動，或者修改 HTML 結構增加內部 wrapper
   
   最簡單的方案是用 fixed 定位並透過 JS 計算，但 CSS left 屬性配合 transition 最順暢。
   我們改用一個偽元素或者簡單的 trick：
   讓 .profile-collapse-btn 為 fixed 定位，但這會很難跟隨 transition。
   
   最佳解：
   修改 .profile-overlay 的 overflow 為 visible。
   但是 .profile-overlay 內容溢出怎麼辦？
   
   我們把內容包在一個 wrapper 裡，或者...
   其實如果按鈕是絕對定位在 overlay 內，且 overlay 設定了 overflow: auto/scroll，按鈕會隨著內容滾動而跑掉，且可能被切掉。
   
   所以必須：
   CSS Trick: 按鈕放在 overlay「內」，但使用 position: fixed。
   不，這樣按鈕不會跟著 slide。
   
   解法：
   保持 .profile-overlay overflow: visible。
   內容使用另一個容器包起來，那個容器 overflow-y: auto。
*/

/* 
   因為我無法輕易大幅重構 HTML 結構 (wrapper)，
   這裡使用一個替代方案：
   將 .profile-overlay 的 overflow 設為 visible。
   但是這會導致內容無法滾動。
   
   讓我們修正一下：
   確實需要一個 wrapper。但為了不改太多 HTML，
   我可以把 .profile-collapse-btn 設為 fixed，並根據 .profile-overlay.active 狀態改變它的 left 位置。
*/

.profile-collapse-btn {
    position: fixed;
    left: -40px;
    /* 初始隱藏 */
    top: 50%;
    transition: left 0.3s ease;
    /* 與側邊欄同步 */
}

.profile-overlay.active+.profile-collapse-btn,
/* 如果按鈕在外面 */
.profile-overlay.active .profile-collapse-btn {
    /* 如果按鈕在裡面 */
    /* 這裡有點棘手因為按鈕在裡面會被 overflow hidden 切掉 */
}

/* 
   為了確保功能正常且不改壞滾動，
   我將採用：
   1. 把按鈕移到 .profile-overlay 內部（已做）。
   2. .profile-overlay 設定 overflow: visible (允許按鈕突出)。
   3. 但這樣內容太長會溢出螢幕。
   
   折衷辦法：
   修改 HTML 結構，把內容包在 .profile-content-wrapper 裡。
*/

/* ========== 修復懸浮按鈕與滾動結構 ========== */
.profile-overlay {
    overflow: visible !important;
    /* 允許按鈕突出去 */
    padding: 0;
    /* 內距移給 wrapper */
    display: flex;
    flex-direction: column;
}

.profile-inner-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    /* 把原本 overlay 的內距移到這裡 */
    height: 100%;
    /* 隱藏滾動條但保留功能 (可選) */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* 修正按鈕定位 */
.profile-collapse-btn {
    position: absolute;
    right: -30px;
    /* 寬度 30px */
    top: 50%;
    transform: translateY(-50%);
    /* 其他樣式保持不變 */
}

/* ========== 修復與美化 2026-01-31 ========== */

/* 1. 確保縮回按鈕可見 */
.profile-overlay {
    overflow: visible !important;
    /* 這個很重要 */
}

.profile-collapse-btn {
    right: -40px;
    /* 拉更出去一點 */
    width: 40px;
    height: 80px;
    /* 加大一點比較好點 */
    background: #1e1e2d;
    /* 配合深色主題 */
    color: var(--primary-color);
    box-shadow: 6px 0 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    z-index: 9999;
    /* 確保最上層 */
}

/* 2. 美化底部按鈕 (設定下方的登出區) */
.profile-actions {
    display: flex;
    flex-direction: column;
    /* 改為垂直排列 */
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-action-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.logout-btn {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: #ff4757;
}

/* 3. 調整全螢幕視圖內容大小 (縮小) */
.fullscreen-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* 縮小卡片最小寬度 280 -> 200 */
    gap: 15px;
}

.fullscreen-view .author-avatar-large {
    width: 60px;
    /* 縮小頭像 */
    height: 60px;
}

.fullscreen-view .author-header h2 {
    font-size: 1.2rem;
}

/* 調整卡片內部間距 */
.fullscreen-grid .info-card {
    border-radius: 10px;
}

.fullscreen-grid .card-thumb {
    height: 120px;
    /* 縮小圖片高度 */
}

.fullscreen-grid .card-content {
    padding: 10px;
}

.fullscreen-grid .card-title {
    font-size: 14px;
    margin-bottom: 5px;
}


/* ========== 修復縮回按鈕 (獨立結構版) ========== */
.profile-collapse-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: -60px;
    /* 初始隱藏在左邊界外 */
    width: 40px;
    height: 80px;
    background: #1e1e2d;
    color: var(--primary-color);
    box-shadow: 6px 0 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    border-radius: 0 10px 10px 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: left 0.3s ease;
    /* 與側邊欄動畫一致 */
    font-size: 20px;
}

/* 當側邊欄打開時，按鈕移到側邊欄旁 */
.profile-collapse-btn.active {
    left: 380px;
    /* 側邊欄寬度 */
}

/* ========== 強制縮小全螢幕資訊卡 ========== */
.fullscreen-view .info-card {
    min-height: auto;
    /* 移除最小高度限制 */
}

.fullscreen-view .card-thumb-wrapper {
    height: 100px;
    /* 圖片更小 */
}

.fullscreen-view .card-content {
    padding: 8px;
    /* 內距更小 */
}

.fullscreen-view .card-title {
    font-size: 13px;
    /* 字體更小 */
    margin-bottom: 3px;
    line-height: 1.3;
}

.fullscreen-view .card-footer {
    font-size: 11px;
    /* 頁尾資訊更小 */
    margin-top: 5px;
}

.fullscreen-view .card-footer i {
    font-size: 10px;
}

/* 調整 Grid 間距 */
.fullscreen-grid {
    gap: 10px;
    /* 卡片間距縮小 */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* 卡片寬度縮至 160px */
}

/* ========== 最後修正 2026-01-31 V2 ========== */

/* 1. 恢復全螢幕卡片大小 (與首頁一致) */
/* 覆蓋之前的縮小設定 */
.fullscreen-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    /* 跟首頁一樣 */
    gap: 20px !important;
}

/* 還原卡片內部樣式 */
.fullscreen-view .info-card {
    min-height: initial !important;
    /* 還原 */
}

.fullscreen-view .card-thumb-wrapper {
    height: 160px !important;
    /* 還原首頁高度 */
}

.fullscreen-view .card-content {
    padding: 15px !important;
    /* 還原首頁 padding */
}

.fullscreen-view .card-title {
    font-size: 16px !important;
    /* 還原字體 */
    margin-bottom: 10px !important;
}

.fullscreen-view .card-footer {
    font-size: 14px !important;
    margin-top: auto !important;
}

/* 2. 縮回鍵不透明 */
.profile-collapse-btn:hover {
    opacity: 1 !important;
    /* 保持背景色不變或稍微變亮，但不透明 */
    background: #2a2a3e;
}

/* 3. 移除 Profile 側邊欄底部的水平捲動條 */
.profile-inner-wrapper {
    overflow-x: hidden !important;
    /* 強制隱藏 X 軸卷軸 */
}

/* 確保全螢幕視圖也不會出現水平卷軸 */
.fullscreen-view {
    overflow-x: hidden;
}

/* ========== 修復卡片比例 (移除覆蓋) ========== */
/* 重置圖片高度，確保不被之前的設定強制拉伸 */
.fullscreen-view .card-thumb-wrapper {
    height: auto !important;
    /* 讓它根據寬度自動調整，或者回歸預設 */
    aspect-ratio: 16 / 9;
    /* 強制標準比例 */
}

/* 確保圖片填滿且不變形 */
.fullscreen-view .card-thumb {
    height: 100%;
    object-fit: cover;
}

/* 如果首頁的樣式有固定高度 (例如 160px)，這裡也應該強制一致 */
/* 假設首頁 .card-thumb-wrapper 有 height: 160px */
/* 我們直接 unset 掉之前的 override */

.fullscreen-view .info-card {
    /* 確保沒有額外的高度設定 */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 確保 Grid 不會過度拉寬卡片 */
.fullscreen-grid {
    /* 這裡保持 minmax(280px, 1fr) 與首頁一致 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

/* ========== 修復卡片比例 (原始尺寸) ========== */
.fullscreen-view .card-thumb-wrapper {
    height: auto !important;
    /* 不限制高度 */
    aspect-ratio: auto !important;
    /* 移除比例限制 */
    overflow: visible;
    /* 允許顯示完整圖片 */
}

.fullscreen-view .card-thumb {
    width: 100%;
    height: auto !important;
    /* 跟隨原始比例 */
    object-fit: contain;
    /* 確保完整顯示不裁切 */
    display: block;
}

/* ========== 最終定案：全螢幕視圖樣式覆蓋 (2026-01-31 Final) ========== */

/* 1. Grid 佈局：完全比照首頁 */
.fullscreen-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
}

/* 2. 卡片內容樣式：還原首頁大小 (字體、間距) */
.fullscreen-view .info-card {
    min-height: initial !important;
    height: auto !important;
}

.fullscreen-view .card-content {
    padding: 15px !important;
    /* 標準 Padding */
}

.fullscreen-view .card-title {
    font-size: 16px !important;
    /* 標準字體 */
    margin-bottom: 10px !important;
    line-height: normal !important;
}

.fullscreen-view .card-footer {
    font-size: 14px !important;
    margin-top: 10px !important;
}

.fullscreen-view .card-footer i {
    font-size: inherit !important;
}

/* 3. 圖片顯示：原始比例，不裁切，不限高 */
.fullscreen-view .card-thumb-wrapper {
    height: auto !important;
    /* 讓圖片決定高度 */
    aspect-ratio: auto !important;
    /* 移除任何比例限制 */
    overflow: visible !important;
    margin-bottom: 0 !important;
}

.fullscreen-view .card-thumb {
    width: 100% !important;
    height: auto !important;
    /* 原始高度 */
    object-fit: contain !important;
    /* 完整顯示 */
    display: block !important;
    border-radius: 8px 8px 0 0 !important;
}

/* ========== 訂閱作者輪播樣式 ========== */
.author-worlds-carousel {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    padding: 10px 0 14px 0;
}

.author-worlds-carousel::-webkit-scrollbar {
    height: 6px;
}

.author-worlds-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.author-worlds-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

.author-worlds-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.author-worlds-carousel .carousel-track {
    display: flex;
    gap: 20px;
    padding: 0 10px;
}

.author-worlds-carousel .info-card {
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
}

.author-section {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.author-section:last-child {
    border-bottom: none;
}

.author-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.author-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.author-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.author-name {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-main);
}

/* ========== 禮物系統樣式 ========== */

/* 禮物按鈕 (Modal) */
.modal-gift-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: 0.2s;
    margin-left: 10px;
    color: #ffd700;
}

.modal-gift-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

/* 禮物步驟指示 */
.gift-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px 0;
}

.gift-steps .step {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-sub);
    font-size: 0.9em;
}

.gift-steps .step.active {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #000;
    font-weight: 600;
}

/* 禮物選擇格子 */
.gift-select-grid {
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

.gift-selectable {
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.gift-selectable.selected {
    border: 3px solid #ffd700;
    transform: scale(0.98);
}

.gift-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: #000;
}

/* 禮物卡面選擇 */
.gift-cover-section {
    max-width: 500px;
    margin: 0 auto 25px;
}

.gift-cover-section > label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-sub);
    font-size: 0.9em;
}

.gift-cover-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.gift-cover-option {
    aspect-ratio: 16/10;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    overflow: hidden;
}

.gift-cover-option:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.gift-cover-option.active {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}

.cover-emoji {
    font-size: 1.5em;
}

.upload-cover-btn {
    gap: 4px;
    font-size: 0.75em;
    color: var(--text-sub);
}

.upload-cover-btn i {
    font-size: 1.3em;
}

/* 禮物留言 */
.gift-message-box {
    max-width: 500px;
    margin: 0 auto 30px;
}

.gift-message-box label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-sub);
}

.gift-message-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    font-size: 1em;
    resize: none;
}

.gift-message-box .char-count {
    text-align: right;
    color: var(--text-sub);
    font-size: 0.8em;
    margin-top: 5px;
}

/* 禮物預覽 */
.gift-preview {
    text-align: center;
    margin-bottom: 30px;
}

.gift-preview h4 {
    margin-bottom: 15px;
    color: var(--text-sub);
}

.gift-preview-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gift-preview-card {
    width: 80px;
    height: 45px;
    border-radius: 8px;
    overflow: hidden;
}

.gift-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 禮物按鈕 */
.gift-btn-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.gift-next-btn,
.gift-done-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border: none;
    border-radius: 30px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.gift-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 禮物資料夾列表 */
.gift-folder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gift-folder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.gift-folder-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.gift-folder-item span:first-of-type {
    flex: 1;
    text-align: left;
}

.gift-folder-count {
    color: var(--text-sub);
    font-size: 0.85em;
}

.gift-folder-item .fa-chevron-right {
    color: var(--text-sub);
    font-size: 0.8em;
}

/* 資料夾全螢幕覆蓋 */
.gift-folder-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: stretch;
}

.gift-folder-overlay-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--bg-main, #14141e);
}

.gift-folder-overlay-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.gift-folder-overlay-content .gift-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: none;
    overflow-y: visible;
}

.gift-folder-overlay-content .card-thumb-wrapper {
    aspect-ratio: 16 / 9;
    height: auto;
}

.gift-folder-overlay-content .card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-folder-overlay-bottom {
    flex-shrink: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    background: rgba(15, 15, 19, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gift-folder-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.gift-folder-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.gift-back-btn {
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: white;
    cursor: pointer;
}

/* 禮物動畫區 */
.gift-animation-box {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    position: relative;
}

.gift-box {
    position: relative;
    width: 120px;
    height: 100px;
}

.gift-box-body {
    width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 5px;
    position: absolute;
    bottom: 0;
}

.gift-box-lid {
    width: 130px;
    height: 25px;
    background: linear-gradient(135deg, #c0392b, #a93226);
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: -5px;
    transition: transform 0.5s;
    z-index: 10;
}

.gift-animation-box.animating .gift-box-lid {
    transform: translateY(-20px) rotateX(30deg);
}

/* 飛入卡片 */
.flying-cards {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.flying-card {
    position: absolute;
    width: 80px;
    height: 45px;
    border-radius: 8px;
    overflow: hidden;
    animation: flyToBox 0.8s forwards;
}

.flying-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes flyToBox {
    0% {
        transform: scale(1.5) translateY(-100px);
        opacity: 1;
    }

    100% {
        transform: scale(0.3) translateY(50px);
        opacity: 0;
    }
}

/* 分享結果 */
.gift-share-result {
    text-align: center;
    margin-top: 30px;
}

.gift-share-result .success-msg {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.gift-share-result .expire-hint {
    color: var(--text-sub);
    margin-bottom: 20px;
}

.gift-link-box {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.gift-link-box input {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
}

.gift-link-box button {
    padding: 15px 25px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #000;
    cursor: pointer;
}

/* 收到的禮物列表 */
.received-gifts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.received-gift-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gift-sender-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gift-sender-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.gift-sender-name {
    font-weight: 600;
    color: var(--text-main);
}

.gift-date {
    font-size: 0.8em;
    color: var(--text-sub);
}

.gift-message {
    font-style: italic;
    color: var(--text-sub);
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.gift-worlds-preview {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.gift-world-mini {
    width: 60px;
    height: 34px;
    border-radius: 6px;
    overflow: hidden;
}

.gift-world-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-more {
    display: flex;
    align-items: center;
    color: var(--text-sub);
    font-size: 0.9em;
}

.view-gift-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
}

/* 禮物開箱 Overlay */
.gift-open-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.gift-open-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gift-open-content {
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 開箱動畫 */
.gift-open-animation {
    display: flex;
    justify-content: center;
    padding: 50px 0;
    transition: all 0.5s;
}

.gift-open-animation.opened {
    transform: scale(0.5);
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.gift-box-3d {
    width: 150px;
    height: 120px;
    position: relative;
    animation: boxShake 0.5s ease-in-out infinite;
}

@keyframes boxShake {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

/* 禮物內容 */
.gift-opened-content {
    animation: fadeInUp 0.5s forwards;
    padding-top: 10px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gift-open-message {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.gift-open-message p {
    font-size: 1.3em;
    font-style: italic;
    margin-bottom: 10px;
}

.from-sender {
    color: var(--text-sub);
}

/* 翻轉卡片 */
.gift-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px 0;
    max-width: 100%;
}

@media (max-width: 480px) {
    .gift-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.gift-flip-card {
    width: 100%;
    aspect-ratio: 16/9;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.gift-flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
}

.flip-card-back {
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back-design {
    text-align: center;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.card-back-design i {
    font-size: 3em;
    margin-bottom: 10px;
    display: block;
}

.flip-card-front {
    transform: rotateY(180deg);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.flip-card-front .card-thumb-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.flip-card-front .card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s;
}

.flip-card-front:hover .card-thumb {
    filter: brightness(0.5);
}

.flip-card-front .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0.6) 80%, transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.flip-card-front:hover .card-content {
    opacity: 1;
    transform: translateY(0);
}

.step-hint {
    text-align: center;
    color: var(--text-sub);
    margin-bottom: 20px;
}

/* 已選禮物世界清單 (新增) */
.selected-gift-worlds {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-gift-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px 5px 5px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid rgba(255, 215, 0, 0.5);
    transition: 0.2s;
}

.selected-gift-item:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.selected-gift-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.selected-gift-title {
    font-size: 0.9em;
    color: #ffd700;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-icon {
    font-size: 0.8em;
    color: #ff6b6b;
}

.selected-gift-item:hover .remove-icon {
    color: #ff4757;
}

/* 收下禮物按鈕 */
.claim-gift-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.gift-flip-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.claim-gift-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #00f3ff, #00c3ff);
    color: #000;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.3);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.claim-gift-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 243, 255, 0.5);
}

.claim-gift-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.claim-gift-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 禮物卡片容器 */
.gift-card-wrapper {
    width: 100%;
}

/* 禮物直接顯示卡片 (無翻牌) */
.gift-direct-card {
    width: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
}

.gift-direct-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    z-index: 10;
}

.gift-direct-card .card-thumb-wrapper {
    width: 100%;
    position: relative;
}

.gift-direct-card .card-thumb {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s;
}

.gift-direct-card:hover .card-thumb {
    filter: brightness(0.5);
}

.gift-direct-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 0.6) 80%, transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.gift-direct-card:hover .card-content {
    opacity: 1;
    transform: translateY(0);
}

.gift-direct-card .card-title,
.flip-card-front .card-title {
    font-size: 1em;
    margin: 0 0 6px 0;
}

.gift-direct-card .card-footer,
.flip-card-front .card-footer {
    font-size: 0.85em;
    color: var(--text-sub);
}

/* Gift Card Specific Fixes */
.modal-overlay {
    z-index: 5000 !important;
}

/* ========== 圖片裁切 Modal ========== */
.crop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.crop-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.crop-modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crop-modal-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.crop-area {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.crop-area:active {
    cursor: grabbing;
}

.crop-image {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    pointer-events: none;
}

.crop-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.crop-zoom-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.crop-cancel-btn {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.crop-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.crop-confirm-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #00f3ff, #00c3ff);
    border: none;
    border-radius: 25px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.crop-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 243, 255, 0.3);
}

/* ========== Toast 提示 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    white-space: nowrap;
}

.toast-item i {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-info {
    background: rgba(30, 30, 50, 0.9);
    border: 1px solid rgba(100, 180, 255, 0.3);
}

.toast-success {
    background: rgba(20, 50, 30, 0.9);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.toast-success i { color: #66bb6a; }

.toast-warning {
    background: rgba(50, 40, 15, 0.9);
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.toast-warning i { color: #ffb74d; }

.toast-error {
    background: rgba(50, 20, 20, 0.9);
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.toast-error i { color: #ef5350; }

.toast-enter-active {
    animation: toastIn 0.3s ease;
}

.toast-leave-active {
    animation: toastOut 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

/* ========== 側欄背景遮罩 (點擊關閉) ========== */
.profile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999; /* 低於 profile-overlay (3000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.profile-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 固定頭部搜尋列 */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 99;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.95) 0%, rgba(18, 18, 18, 0.8) 70%, rgba(18, 18, 18, 0) 100%);
    padding: 15px 15px 30px 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: -20px;
}

.sticky-header.scrolled {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    pointer-events: none;
    border-bottom: none;
    margin-bottom: -20px;
    padding-bottom: 0px;
}

.sticky-header.scrolled * {
    opacity: 0;
    transition: opacity 0.3s;
}

.sticky-header.scrolled:hover {
    background: rgba(18, 18, 18, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    pointer-events: auto;
    padding-bottom: 30px;
}

.sticky-header.scrolled:hover * {
    opacity: 1;
}

/* ========== 手機版個人頁 (全螢幕獨立頁面) ========== */
@media (max-width: 768px) {
    .profile-overlay {
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        left: 0 !important;
        top: 0 !important;
        transform: translateY(100%);
        transition: transform 0.3s ease !important;
        z-index: 3000;
        padding: 0 !important;
        padding-bottom: 60px !important;
        box-shadow: none !important;
        pointer-events: none;
        background: #14141e !important;
        overflow: hidden !important;
    }

    .profile-overlay.active {
        transform: translateY(0) !important;
        pointer-events: auto;
    }

    .profile-overlay .profile-inner-wrapper {
        height: 100% !important;
        overflow-y: auto !important;
    }

    .profile-backdrop {
        display: none !important;
    }

    .profile-inner-wrapper {
        padding: 16px;
    }

    .profile-collapse-btn {
        display: none !important;
    }

    .profile-collapse-btn.active {
        display: none !important;
    }

    /* 手機版 profile-header 去掉框框，靠左排列 */
    .profile-header {
        background: none;
        border: none;
        border-radius: 0;
        padding: 6px 4px;
        margin-bottom: 8px;
    }

    /* 頭像在上、ID 在下，垂直排列 */
    .profile-header .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* 隱藏 email */
    .profile-header .user-email {
        display: none;
    }

    /* 名字縮小 */
    .profile-header .user-name {
        font-size: 1em;
    }

    /* ========== Drill-Down 導航 ========== */

    /* 預設隱藏手機專用元素 */
    .mobile-back-header { display: none; }
    .mobile-arrow { display: none; }

    /* mobile-menu-item: 只在手機選單模式顯示 */
    .mobile-menu-item { display: none; }

    /* === 主選單模式 === */

    /* 隱藏所有大標題 h2 */
    .profile-overlay:not(.mobile-drilldown) .mobile-section-title {
        display: none;
    }

    /* 隱藏非 flat section 的內容（通知、設定用 menu-item 觸發 drill-down） */
    .profile-overlay:not(.mobile-drilldown) .profile-section:not(.mobile-flat) .section-content {
        display: none;
    }

    /* 顯示 flat section 的內容（收藏、禮物的 quick-link-btn 直接可用） */
    .profile-overlay:not(.mobile-drilldown) .mobile-flat .section-content {
        display: block;
    }

    /* 顯示 mobile-menu-item（通知、設定的精簡觸發項） */
    .profile-overlay:not(.mobile-drilldown) .mobile-menu-item {
        display: flex;
    }

    /* 選單模式下 section 無間距、無邊框 */
    .profile-overlay:not(.mobile-drilldown) .profile-section {
        margin-bottom: 0;
        padding: 0;
        border-bottom: none;
    }

    /* quick-link-btn 在選單模式去掉框框，只留文字 */
    .profile-overlay:not(.mobile-drilldown) .quick-link-btn {
        background: none;
        border: none;
        border-radius: 0;
        padding: 10px 4px;
        margin-bottom: 0;
        gap: 10px;
    }

    /* === 子頁 drill-down 模式 === */

    /* 隱藏非 active section */
    .profile-overlay.mobile-drilldown .profile-section:not(.mobile-active) {
        display: none;
    }

    /* 顯示 active section 的完整內容 */
    .profile-overlay.mobile-drilldown .profile-section.mobile-active .section-content {
        display: block;
    }

    /* 隱藏 mobile-menu-item（子頁不需要） */
    .profile-overlay.mobile-drilldown .mobile-menu-item {
        display: none;
    }

    /* 隱藏 h2 的箭頭 */
    .profile-overlay.mobile-drilldown .mobile-arrow {
        display: none;
    }

    /* 隱藏用戶頭部 */
    .profile-overlay.mobile-drilldown .profile-header {
        display: none;
    }

    /* 返回按鈕 */
    .profile-overlay.mobile-drilldown .mobile-back-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 4px 14px;
        cursor: pointer;
        color: var(--accent);
        font-size: 0.95em;
        font-weight: 500;
    }

    .profile-overlay.mobile-drilldown .mobile-back-header:active {
        opacity: 0.6;
    }
}

/* 電腦版：隱藏手機專用元素 */
@media (min-width: 769px) {
    .mobile-arrow { display: none !important; }
    .mobile-back-header { display: none !important; }
    .mobile-menu-item { display: none !important; }
    .mobile-footer-nav { display: none !important; }
    .gift-step-fixed-bottom { position: static; padding: 0; background: none; border: none; backdrop-filter: none; }
    .gift-step-bottom-spacer { display: none; }
}

/* ========== 手機版底部導航列 ========== */
@media (max-width: 768px) {
    .mobile-footer-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 56px;
        background: rgba(15, 15, 19, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 9000;
        transition: transform 0.3s ease;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-footer-nav.hidden {
        transform: translateY(100%);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background: none;
        border: none;
        color: var(--text-sub);
        font-size: 1.25em;
        height: 100%;
        cursor: pointer;
        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item.active {
        color: var(--accent);
    }

    .mobile-nav-item:active {
        color: var(--accent);
    }

    .mobile-nav-avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-nav-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 18px);
        background: var(--secondary);
        color: #fff;
        font-size: 0.5em;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        text-align: center;
        border-radius: 8px;
        padding: 0 4px;
        font-weight: 600;
    }

    /* 隱藏左上角頭像按鈕（改到 footer） */
    .profile-toggle-btn {
        display: none !important;
    }

    /* 收藏/通知/搜尋由 footer 導航，不需要 header */
    .mobile-nav-view > .fullscreen-header {
        display: none;
    }

    .mobile-nav-view > .fullscreen-content {
        padding-top: 16px;
    }

    /* 禮物步驟按鈕固定底部 */
    .gift-step-fixed-bottom {
        position: fixed;
        bottom: 56px;
        left: 0;
        right: 0;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
        background: rgba(15, 15, 19, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 8999;
        display: flex;
        justify-content: center;
    }

    .gift-step-fixed-bottom .gift-next-btn {
        width: 100%;
        padding: 14px;
        font-size: 1em;
    }

    .gift-step-bottom-spacer {
        height: 80px;
    }

    /* 隱藏桌面版搜尋欄 */
    .header-controls {
        display: none !important;
    }

    /* body 調整：頂部不再需要 header 空間，底部留空給 footer */
    body {
        padding-top: 16px;
        padding-bottom: 70px;
    }

    /* ========== 手機版搜尋全螢幕頁樣式 ========== */
    .search-view-bar {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 0 14px;
        height: 44px;
        margin-bottom: 16px;
    }

    .search-view-bar:focus-within {
        border-color: rgba(0, 243, 255, 0.4);
    }

    .search-view-icon {
        color: var(--text-sub);
        margin-right: 10px;
        font-size: 0.9em;
    }

    .search-view-input {
        flex: 1;
        background: none;
        border: none;
        outline: none;
        color: var(--text-main);
        font-size: 1em;
    }

    .search-view-input::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

    .search-view-clear {
        color: var(--text-sub);
        cursor: pointer;
        padding: 4px 0 4px 8px;
    }

    .search-view-section {
        margin-bottom: 16px;
    }

    .search-view-section-title {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 0;
        color: var(--text-sub);
        font-size: 0.95em;
        cursor: pointer;
    }

    .search-view-filters {
        padding: 12px 0;
    }

    .search-view-filters h4 {
        color: var(--text-sub);
        font-size: 0.85em;
        margin: 12px 0 8px;
    }

    .search-view-filters h4:first-child {
        margin-top: 0;
    }

    .search-view-loading {
        text-align: center;
        padding: 30px;
        color: var(--accent);
        font-size: 1.5em;
    }

    .search-result-grid {
        padding-bottom: 70px;
    }

    .search-view-empty {
        text-align: center;
        padding: 40px 0;
        color: var(--text-sub);
    }
}

/* ========== 篩選重置按鈕 ========== */
.filter-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-sub);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-reset-btn:hover {
    background: rgba(255, 42, 109, 0.15);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* ========== Discovery Feed (手機版) ========== */
.discovery-feed {
    max-width: 100%;
    padding: 0 12px 80px;
}

.discovery-section {
    margin-bottom: 24px;
}

.discovery-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 12px;
}

.discovery-section-label i {
    font-size: 0.9em;
    color: var(--accent);
}

.discovery-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discovery-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: transparent;
    border: none;
}

.discovery-card .card-thumb-wrapper {
    overflow: hidden;
}

.discovery-card .card-thumb {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 手機版卡片內容疊在圖片上 */
.discovery-card .discovery-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 1;
    transform: none;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    padding: 24px 12px 10px;
}

.discovery-card .card-title {
    font-size: 1em;
    margin: 0 0 6px 0;
}

.discovery-card .card-footer {
    font-size: 0.8em;
}

.discovery-card .card-heart {
    opacity: 0;
}

.discovery-card .card-heart.active {
    opacity: 1;
}

.discovery-card .platform-badges {
    opacity: 1;
}

.discovery-loading,
.discovery-loading-more {
    text-align: center;
    padding: 30px 0;
    color: var(--accent);
    font-size: 1.2em;
}

.discovery-loading-more {
    padding: 20px 0;
    font-size: 1em;
}

/* ========== 手機版全螢幕詳情頁 ========== */
.mobile-detail-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.mobile-detail-image-wrapper {
    position: relative;
}

.mobile-detail-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-detail-image {
    width: 100%;
    height: auto;
    display: block;
}

.mobile-detail-content {
    padding: 16px;
}

.mobile-detail-title {
    margin: 0 0 8px 0;
    font-size: 1.4em;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
}

.mobile-detail-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-detail-author a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.95em;
}

.mobile-detail-author .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.mobile-detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-detail-actions .subscribe-btn,
.mobile-detail-actions .modal-heart-btn,
.mobile-detail-actions .modal-gift-btn {
    font-size: 1.1em;
}

.mobile-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px 8px;
}

.mobile-stat {
    text-align: center;
}

.mobile-stat-value {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.mobile-stat-label {
    font-size: 0.7em;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mobile-detail-video {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.mobile-detail-video .yt-preview-card {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    position: relative;
}

.mobile-detail-video .yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.mobile-detail-desc {
    margin-bottom: 16px;
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.7;
}

.mobile-detail-desc p {
    margin: 0;
}

.mobile-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.mobile-detail-tags .big-tag {
    font-size: 0.75em;
    padding: 4px 10px;
}

.mobile-detail-launch {
    display: block;
    width: 60%;
    margin: 0 auto 32px;
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), #0099cc);
    color: #000;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 2px;
    border-radius: 12px;
    text-decoration: none;
}