/* Color Palette and Variables */
:root {
    --bg-color: #f7f3f0;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary-color: #ff8c69; /* Warm Coral */
    --primary-hover: #ff754d;
    --secondary-color: #f4c055; /* Gold */
    --accent-color: #4bd3b8; /* Mint */
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-width: 260px;
    --border-radius: 24px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'Outfit', sans-serif;
    background: var(--bg-color);
    /* Subtle background gradient */
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 235, 217, 0.4) 0%, rgba(215, 240, 235, 0.4) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    padding: 24px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

/* Buttons */
button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(255, 140, 105, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(255, 140, 105, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 22px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar-close-btn {
    display: none;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    padding: 0 32px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
}

.brand i {
    font-size: 1.8rem;
    animation: paw-wave 2s infinite ease-in-out;
}

@keyframes paw-wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    padding: 16px 32px;
    margin: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    transition: all var(--transition-speed);
}

.nav-links li:hover {
    background: rgba(255, 140, 105, 0.05);
    color: var(--primary-color);
}

.nav-links li.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 105, 0.3);
}

.user-profile {
    padding: 24px 32px 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .name {
    font-weight: 700;
}

.user-profile .level {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 48px;
    max-width: 1400px;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page-section.active {
    display: block;
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-weight: 800;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
}

.balance-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 245, 230, 0.8));
}

.card-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.balance-amount {
    font-size: 4rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    margin: 8px 0 24px;
}

.transaction-list {
    list-style: none;
    margin-top: 16px;
}

.transaction-list li {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.transaction-list li:last-child {
    border-bottom: none;
}

.full-page-list {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 8px;
}
/* Scrollbar for full-page-list */
.full-page-list::-webkit-scrollbar {
    width: 6px;
}
.full-page-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.trans-desc { font-weight: 500; }
.trans-date { font-size: 0.85rem; color: var(--text-muted); }
.trans-amt.positive { color: var(--accent-color); font-weight: 700; }
.trans-amt.negative { color: var(--text-main); font-weight: 700; }

/* Chatrooms */
.chat-container {
    display: flex;
    height: 600px;
    padding: 0;
    overflow: hidden;
}
.chat-sidebar {
    width: 250px;
    background: rgba(255,255,255,0.4);
    border-right: 1px solid var(--glass-border);
    padding: 16px;
    overflow-y: auto;
}
.expert-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.expert-tab:hover { background: rgba(255,255,255,0.6); }
.expert-tab.active {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
}

.expert-tab img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.expert-tab h4 { font-size: 1rem; }
.expert-tab span { font-size: 0.8rem; color: var(--text-muted); }

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.2);
}

.chat-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.6);
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg {
    max-width: 70%;
    padding: 14px 20px;
    border-radius: 20px;
    line-height: 1.5;
    position: relative;
    animation: msgFadeIn 0.3s ease-out forwards;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.ai {
    background: white;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.msg.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(255, 140, 105, 0.2);
}

.msg.expert-human {
    background: transparent;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; box-shadow: 0 0 15px #10B981; }
    100% { opacity: 1; }
}

.chat-input-area {
    padding: 16px;
    background: rgba(255,255,255,0.8);
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-input-area input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    background: white;
    border-color: rgba(255, 140, 105, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 140, 105, 0.1);
}

.send-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.send-choice-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.send-choice-btn.ai-btn {
    background: rgba(255, 140, 105, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(255, 140, 105, 0.3);
}

.send-choice-btn.ai-btn:hover {
    background: rgba(255, 140, 105, 0.2);
}

.send-choice-btn.expert-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.send-choice-btn.expert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
}

/* Bulletin Grid */
.bulletin-grid {
    column-width: 320px;
    column-gap: 32px;
    display: block;
}

.event-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 32px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.event-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.event-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--secondary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.event-badge.new { background: var(--accent-color); }
.event-badge.promo { background: #e74c3c; }
.event-badge.new_arrival { background: #ec4899; }
.event-badge.member_only { background: #8b5cf6; }
.event-badge.holiday_special { background: #ef4444; }
.event-badge.expert_tips { background: #10b981; }
.event-badge.partnership { background: #64748b; }

.event-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-content h3 { margin-bottom: 12px; }
.event-content p { color: var(--text-muted); margin-bottom: 24px; flex: 1; line-height: 1.6; }

/* Passport */
.passport-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
}

.add-pet-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.add-pet-card input {
    padding: 14px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    outline: none;
}

.pet-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.pet-item {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
}

.pet-item h4 { font-size: 1.4rem; color: var(--primary-color); margin-bottom: 8px; }
.pet-item p { color: var(--text-muted); margin-bottom: 4px; }
.delete-pet-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    color: #e74c3c;
    padding: 8px;
    box-shadow: none;
}
.delete-pet-btn:hover { background: rgba(231, 76, 60, 0.1); transform: none; }

/* Tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.tool-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.tool-content { margin-top: 24px; }

/* Age Calc */
#pet-type-calc {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 16px;
    font-family: inherit;
    background: white;
}

#pet-actual-age {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-bottom: 16px;
    font-family: inherit;
}

.calc-result {
    margin-top: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    min-height: 28px;
}

/* Photo share */
.photo-post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.photo-post img { width: 100%; height: auto; display: block; }
.post-actions { padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.like-btn { background: transparent; color: #ccc; font-size: 1.4rem; padding: 0; box-shadow: none; }
.like-btn.liked { color: #e74c3c; }

/* TV */
.video-container { border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.tv-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-controls button { font-size: 0.9rem; padding: 8px 16px; }

/* Mobile Navigation (Hidden on Desktop) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    justify-content: space-around;
    padding: 10px 0;
    padding-bottom: env(safe-area-inset-bottom, 10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.mobile-nav-item i {
    font-size: 1.2rem;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid, .passport-container { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        right: -280px;
        left: auto;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--glass-border);
        border-right: none;
    }
    .sidebar.open {
        right: 0;
    }
    
    .sidebar-close-btn {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.05);
        color: var(--text-muted);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        z-index: 1010;
        box-shadow: none;
    }
    .sidebar-close-btn:hover {
        background: rgba(0, 0, 0, 0.1);
        color: var(--text-main);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-bottom: 40px;
    }
    
    /* Mobile Header Styling */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 16px 0;
        margin: 0 0 16px 0;
        border-bottom: none;
        box-shadow: none;
        position: relative;
        z-index: 999;
    }
    
    .mobile-header-left {
        display: flex;
        align-items: center;
    }
    
    .mobile-header-left .user-profile-mobile {
        display: flex;
        align-items: center;
    }
    .mobile-header-left .user-profile-mobile .avatar {
        width: 38px;
        height: 38px;
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.4);
        color: var(--text-main);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 0.95rem;
    }

    .menu-toggle-btn {
        background: rgba(255, 140, 105, 0.1);
        color: var(--primary-color);
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        border-radius: 10px;
        box-shadow: none;
    }
    .menu-toggle-btn:hover {
        background: var(--primary-color);
        color: white;
    }

    /* Make chat area stack on mobile */
    .chat-container {
        flex-direction: column;
        height: 700px;
        max-height: 85vh;
    }
    
    .chat-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 8px 16px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        flex-shrink: 0;
        gap: 12px;
        background: rgba(255, 255, 255, 0.3);
    }
    
    .expert-tab {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 6px 12px;
        margin: 0;
        min-width: 75px;
        border-radius: 12px;
        background: transparent;
    }
    .expert-tab.active {
        background: rgba(255, 255, 255, 0.8);
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
        border-radius: 12px 12px 0 0;
    }
    
    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0; /* Crucial for nested flex scrolling */
    }
    .chat-messages {
        flex: 1;
        overflow-y: auto;
    }
    .chat-input-area {
        flex-shrink: 0;
    }
    }
    .expert-tab img {
        width: 38px;
        height: 38px;
    }
    .expert-tab h4 {
        font-size: 0.8rem;
        font-weight: 700;
    }
    .expert-tab span {
        display: none;
    }
    .chat-area {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .chat-header {
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.4);
    }
    .chat-header h3 {
        font-size: 0.95rem;
    }
    .chat-messages {
        padding: 16px;
        gap: 12px;
    }
    .msg {
        padding: 10px 14px;
        font-size: 0.9rem;
        max-width: 85%;
    }
    .chat-input-area {
        padding: 12px;
        gap: 8px;
    }
    .chat-input-area input {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    .send-actions {
        gap: 8px;
    }
    .send-choice-btn {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    /* Adjust grid */
    .dashboard-grid, .passport-container, .tools-grid { grid-template-columns: 1fr; }
    .bulletin-grid { column-count: 1; }
    
    /* Adjust section headers */
    .section-header h2 { font-size: 1.8rem; }
}

/* Modal Overlay & Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: var(--bg-color, #ffffff);
    padding: 32px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 105, 0.2);
}


/* --- Grand Expert Profile --- */
.expert-grand-profile {
    display: none;
    margin-top: 40px;
    padding: 40px;
    background: linear-gradient(145deg, #ffffff, #fdfbf7);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

.expert-grand-profile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, #d4af37, #f3e5ab, #d4af37);
}

.grand-profile-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

.grand-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #2c3e50;
    color: #d4af37;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    margin-bottom: 15px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.grand-name {
    font-size: 2.2rem;
    color: #1a1a1a;
    font-weight: 900;
    margin: 0;
    letter-spacing: 1px;
}

.grand-title {
    display: block;
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
    margin-top: 5px;
    letter-spacing: 0;
}

.grand-decoration {
    width: 60px;
    height: 3px;
    background: #d4af37;
    margin: 20px auto 0;
    border-radius: 2px;
}

.grand-profile-body {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.grand-column {
    flex: 1 1 calc(50% - 15px);
    min-width: 280px;
}

.grand-column.full-width {
    flex: 1 1 100%;
}

.grand-section-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    height: 100%;
}

.grand-section-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.highlight-gold {
    color: #b8860b;
    font-weight: 700;
    position: relative;
    padding-left: 12px;
}
.highlight-gold::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: #d4af37;
    border-radius: 2px;
}

.grand-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
}

.grand-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.grand-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
}

.grand-list li::before {
    content: '❖';
    position: absolute;
    left: 0;
    color: #d4af37;
    font-size: 0.8rem;
    top: 2px;
}

.grand-list.highlight-list li {
    padding-left: 24px;
}
.grand-list.highlight-list li::before {
    content: '✓';
    color: #27ae60;
    font-weight: bold;
    font-size: 1rem;
    top: 0;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

@media (max-width: 768px) {
    .two-cols {
        grid-template-columns: 1fr;
    }
    .expert-grand-profile {
        padding: 25px 20px;
    }
}

/* ===== 本人諮詢 Styles ===== */
.consult-form-card {
    padding: 28px;
    margin-bottom: 24px;
}

.consult-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.consult-form-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.consult-form-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.consult-form-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.consult-expert-select {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.consult-expert-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.5);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
}

.consult-expert-btn img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
}

.consult-expert-btn span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.consult-expert-btn small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.consult-expert-btn.active {
    border-color: var(--primary-color);
    background: rgba(255,140,105,0.08);
    box-shadow: 0 4px 12px rgba(255,140,105,0.15);
}

.consult-expert-btn.active img {
    border-color: var(--primary-color);
}

.consult-textarea {
    width: 100%;
    background: rgba(247,243,240,0.8);
    border: 1.5px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-main);
    resize: vertical;
    transition: border-color 0.2s;
    margin-bottom: 14px;
}

.consult-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.consult-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.consult-hint {
    font-size: 0.83rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.consult-hint i { color: var(--secondary-color); }

#consult-submit-status {
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 20px;
}

.consult-history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 14px;
}

.consult-history-header i { color: var(--primary-color); }
.consult-history-header h3 { font-size: 1rem; font-weight: 700; }

.consult-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    transition: box-shadow 0.2s;
}

.consult-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.consult-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.consult-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.consult-card-meta img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.consult-card-meta .expert-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.consult-card-meta .consult-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.consult-status-badge {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.consult-status-badge.pending {
    background: rgba(244,192,85,0.15);
    color: #b8860b;
    border: 1px solid rgba(244,192,85,0.4);
}

.consult-status-badge.answered {
    background: rgba(75,211,184,0.15);
    color: #1a7a65;
    border: 1px solid rgba(75,211,184,0.4);
}

.consult-status-badge.overdue {
    background: rgba(255,80,80,0.1);
    color: #c0392b;
    border: 1px solid rgba(255,80,80,0.3);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.consult-question-text {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.consult-answer-box {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(75,211,184,0.07);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.consult-answer-box .answer-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.consult-answer-box .answer-text {
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.65;
}

/* ===== Escalation UI ===== */
.escalate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,140,105,0.07);
    border-top: 1px solid rgba(255,140,105,0.15);
    gap: 12px;
    flex-wrap: wrap;
}

.escalate-bar span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.escalate-btn {
    background: linear-gradient(135deg, var(--primary-color), #e05a30);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: 'Noto Sans TC', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    box-shadow: 0 3px 12px rgba(255,140,105,0.35);
}

.escalate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(255,140,105,0.45);
}

.expert-escalate-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(244,192,85,0.1);
    border-top: 1px solid rgba(244,192,85,0.25);
    font-size: 0.87rem;
    color: #8a6d00;
    animation: pulse-gold 2.5s infinite;
}

@keyframes pulse-gold {
    0%, 100% { background: rgba(244,192,85,0.1); }
    50%       { background: rgba(244,192,85,0.18); }
}

.escalate-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(244,192,85,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8860b;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.expert-reply-card {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(75,211,184,0.08), rgba(75,211,184,0.03));
    border-top: 2px solid var(--accent-color);
}

.expert-reply-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.expert-reply-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
}

/* --- Responsive Grid Fixes for Desktop vs Mobile --- */
@media (min-width: 1025px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        align-items: start;
    }
    .passport-container {
        grid-template-columns: 1fr 2fr;
    }
    .bulletin-grid {
        column-count: 2;
        column-gap: 20px;
    }
    /* Restrict max width of cards so they don't look like stretched banners */
    .event-card {
        max-width: 480px;
    }
}

@media (max-width: 1024px) {
    .tools-grid, .passport-container {
        grid-template-columns: 1fr !important;
    }
    .bulletin-grid {
        column-count: 1 !important;
    }
    .event-card {
        max-width: 100%;
    }
}

/* ===== Upgraded Pet Age Calculator Widget Styles ===== */
.age-calculator-widget {
    background: var(--glass-bg);
}

.age-calculator-widget .form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.age-calculator-widget input[type="text"]:focus,
.age-calculator-widget input[type="number"]:focus,
.age-calculator-widget select:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 140, 105, 0.2);
}

.toggle-group input[type="radio"]:checked + label {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Locked badge for prevented tampering */
.locked-badge {
    background-color: #f1f3f5;
    color: #495057;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e9ecef;
}

.locked-badge i {
    font-size: 0.65rem;
    color: #868e96;
}

/* Adjustments for pet items in passport when locked */
.pet-item {
    position: relative;
}

.pet-item .locked-badge {
    position: absolute;
    right: 20px;
    top: 20px;
}

/* ===== Pet Fusion Lab Specific Styles ===== */
.fusion-lab-card {
    background: var(--glass-bg);
}

.upload-zone:hover {
    border-color: var(--primary-color) !important;
    background-color: var(--primary-light) !important;
    transform: scale(1.02);
}

.upload-zone img {
    animation: fadeIn 0.4s ease-out;
}

.toggle-group label {
    transition: background 0.3s, color 0.3s;
}

.fusion-progress-bar div {
    animation: progressMoving 1.5s infinite linear;
    background-size: 30px 30px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
}

@keyframes progressMoving {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.radar-stats div {
    margin-bottom: 5px;
}

.radar-stats div:last-child {
    margin-bottom: 0;
}

.radar-stats span {
    font-family: 'Outfit', sans-serif;
}

/* Pet Fusion Lab Enhancements */
.btn-primary:disabled {
    background: #cccccc !important;
    color: #888888 !important;
    border-color: #bbbbbb !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

@keyframes floatWand {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(4deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

#fusion-empty-state i.fa-wand-magic-sparkles {
    animation: floatWand 3s ease-in-out infinite;
}

@keyframes pulseOrange {
    0% { box-shadow: 0 0 0 0 rgba(255, 140, 105, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 140, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 140, 105, 0); }
}

.btn-pulse-orange {
    animation: pulseOrange 2s infinite;
}

/* Responsive layout for Fusion Lab */
.fusion-workspace {
    display: grid;
    grid-template-columns: 1fr; /* Stack vertically on both desktop and mobile */
    gap: 30px;
}

@media (max-width: 768px) {
    .fusion-workspace {
        gap: 20px;
    }
    
    .fusion-inputs {
        gap: 15px !important;
    }
    
    /* On mobile, place Pet Fusion Lab before the Age Calculator */
    .tools-grid {
        display: grid;
        grid-template-columns: 1fr !important;
    }
    
    .fusion-lab-card {
        order: 1;
    }
    
    .age-calculator-widget {
        order: 2;
    }
}

/* Album Item and Social Share Micro-animations */
.album-item img {
    transition: transform 0.3s ease;
}
.album-item:hover img {
    transform: scale(1.12);
}
.share-btn {
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease !important;
}
.share-btn:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}
.share-passport-btn {
    transition: transform 0.2s ease;
}
.share-passport-btn:hover {
    transform: scale(1.2);
}
