/* ===== Comment Section ===== */
.comment-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.comment-title { font-weight: 700; font-size: 1rem; margin-bottom: 12px; color: var(--text-primary); }
.comment-textarea { resize: none; font-size: .88rem; }
.comment-list { margin-top: 8px; }
.comment-item {
    display: flex; gap: 10px; padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    animation: commentSlideIn .3s ease-out;
}
@keyframes commentSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar { font-size: 1.6rem; width: 36px; text-align: center; flex-shrink: 0; line-height: 1; padding-top: 2px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-nick { font-weight: 600; font-size: .85rem; color: var(--text-primary); }
.comment-time { font-size: .75rem; color: var(--text-muted); }
.comment-del-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: .78rem; padding: 0 4px; margin-left: auto; opacity: .5; transition: opacity .15s, color .15s;
}
.comment-del-btn:hover { opacity: 1; color: #dc3545; }
.comment-content { font-size: .88rem; color: var(--text-primary); line-height: 1.6; word-break: break-word; white-space: pre-wrap; }

/* ===== Game Rank Panel ===== */
.game-rank-panel {
    padding: 16px;
    background: var(--bg-result);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.rank-list .table { font-size: .85rem; margin-bottom: 0; }
.rank-list .table th { font-weight: 600; font-size: .78rem; color: var(--text-muted); border-bottom-width: 1px; }
.rank-list .table td { vertical-align: middle; }
.game-over-score { font-size: 1.1rem; color: var(--text-secondary); }

.game-over-bar {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; margin-top: 10px; border-radius: 10px;
    background: var(--bg-result); border: 1px solid var(--border-color);
}
.game-over-bar-text { font-size: .95rem; color: var(--text-primary); }

/* ===== About Modal – Feature Cards ===== */
.about-feat-card {
    position: relative;
    padding: 12px 12px 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    border-left: 3px solid var(--afc-accent, #6366f1);
    background: linear-gradient(135deg, var(--afc-bg-from, rgba(99,102,241,.06)) 0%, var(--afc-bg-to, rgba(99,102,241,.02)) 100%);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.about-feat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--afc-shadow, rgba(99,102,241,.12));
    border-left-color: var(--afc-accent, #6366f1);
}
.about-feat-card .fw-semibold { font-size: .82rem; }
.about-feat-card .text-muted  { font-size: .78rem; line-height: 1.6; }

.afc-primary   { --afc-accent:#4f6ef7; --afc-bg-from:rgba(79,110,247,.07); --afc-bg-to:rgba(79,110,247,.02); --afc-shadow:rgba(79,110,247,.13); }
.afc-info      { --afc-accent:#0dcaf0; --afc-bg-from:rgba(13,202,240,.07); --afc-bg-to:rgba(13,202,240,.02); --afc-shadow:rgba(13,202,240,.13); }
.afc-success   { --afc-accent:#198754; --afc-bg-from:rgba(25,135,84,.07);  --afc-bg-to:rgba(25,135,84,.02);  --afc-shadow:rgba(25,135,84,.13);  }
.afc-danger    { --afc-accent:#dc3545; --afc-bg-from:rgba(220,53,69,.06);  --afc-bg-to:rgba(220,53,69,.02);  --afc-shadow:rgba(220,53,69,.12);  }
.afc-warning   { --afc-accent:#e68a00; --afc-bg-from:rgba(230,138,0,.07);  --afc-bg-to:rgba(230,138,0,.02);  --afc-shadow:rgba(230,138,0,.12);  }
.afc-purple    { --afc-accent:#7c3aed; --afc-bg-from:rgba(124,58,237,.07); --afc-bg-to:rgba(124,58,237,.02); --afc-shadow:rgba(124,58,237,.12); }

/* ===== Auth Modal ===== */
.glass-modal, .auth-modal-content {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.05) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
}
.auth-modal-brand {
    padding: 32px 24px 16px;
    text-align: center;
    position: relative;
    background: transparent;
    color: #212529;
}
.auth-brand-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4f46e5;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 12px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}
.auth-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.5px;
}
.auth-close-btn {
    position: absolute;
    top: 16px; right: 16px;
    opacity: .4;
    transition: opacity .2s, transform .2s;
}
.auth-close-btn:hover { opacity: 1; transform: scale(1.1); }

.auth-tabs {
    display: flex;
    position: relative;
    margin: 0 24px 20px;
    background: #f1f3f5;
    border-radius: 12px;
    padding: 4px;
}
.auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: .9rem;
    font-weight: 600;
    color: #868e96;
    border-radius: 10px;
    cursor: pointer;
    transition: color .2s;
    position: relative;
    z-index: 2;
}
.auth-tab-btn.active { color: #212529; }
.auth-tab-indicator {
    position: absolute;
    top: 4px; bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}

.auth-modal-body { padding: 0 24px 32px; }
.auth-pane { display: none; }
.auth-pane.active { display: block; animation: authFadeIn .3s ease; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.auth-field:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.auth-field-icon {
    padding: 0 12px 0 16px;
    color: #adb5bd;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color .2s;
}
.auth-field:focus-within .auth-field-icon { color: #4f46e5; }
.auth-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px 12px 0;
    font-size: .95rem;
    color: #212529;
    outline: none;
}
.auth-input::placeholder { color: #adb5bd; font-weight: 400; }
.auth-eye-btn {
    border: none;
    background: transparent;
    padding: 0 14px;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color .2s;
}
.auth-eye-btn:hover { color: #495057; }

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .85rem;
    color: #dc2626;
    margin-bottom: 16px;
    display: flex; align-items: center;
}
.auth-error::before {
    content: "\F33B";
    font-family: bootstrap-icons;
    margin-right: 8px;
    font-size: 1rem;
}

.auth-submit-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.auth-submit-btn:active { transform: translateY(1px); }
.auth-submit-login {
    background: #212529;
    color: #fff;
    box-shadow: 0 4px 12px rgba(33,37,41,.15);
}
.auth-submit-login:hover { background: #343a40; box-shadow: 0 6px 16px rgba(33, 37, 41, .2); }
.auth-submit-register {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79,70,229,.15);
}
.auth-submit-register:hover { background: #4338ca; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    font-size: .8rem;
    margin: 20px 0 16px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e9ecef;
}
.auth-divider:not(:empty)::before { margin-right: .5em; }
.auth-divider:not(:empty)::after { margin-left: .5em; }

.auth-sso-btn {
    border-radius: 12px;
    font-weight: 500;
    font-size: .9rem;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    border: none;
    cursor: pointer;
}
.auth-sso-qq { background: #f1f3f5; color: #495057; }
.auth-sso-qq:hover { background: #e9ecef; color: #212529; }
.auth-sso-wx { background: #ebfbee; color: #2b8a3e; }
.auth-sso-wx:hover { background: #d3f9d8; color: #2b8a3e; }

.auth-switch-hint {
    text-align: center;
    font-size: .85rem;
    color: #868e96;
    margin-top: 16px;
}
.auth-switch-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}
.auth-switch-link:hover { text-decoration: underline; color: #4338ca; }

/* ===== Coins Badge ===== */
.nav-coins-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 200, 0, 0.18);
    border: 1px solid rgba(255, 200, 0, 0.45);
    color: #ffd700;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: default;
    white-space: nowrap;
    transition: background .2s;
}
.nav-coins-badge i { font-size: .9rem; transition: transform .2s ease; }
.nav-coins-badge:hover { background: rgba(255, 200, 0, 0.28); }
.nav-coins-badge:hover i { transform: rotate(15deg) scale(1.15); }

.nav-vip-badge {
    font-size: .6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.25);
    border: 1px solid rgba(156, 163, 175, 0.4);
}
.nav-vip-badge.active {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
}

/* ===== Avatar Picker ===== */
.user-dropdown-avatar {
    cursor: pointer;
    position: relative;
}
.avatar-edit-hint {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s;
}
.user-dropdown-avatar:hover .avatar-edit-hint { opacity: 1; }

.avatar-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: fadeIn .15s ease;
}
.avatar-picker-panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
    width: 340px;
    max-width: calc(100vw - 32px);
    animation: slideUp .18s cubic-bezier(.2,.8,.2,1);
    overflow: hidden;
}
.avatar-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 700;
    font-size: .95rem;
    color: #111827;
}
.avatar-picker-header i.bi-emoji-smile { color: var(--primary); }
.avatar-picker-close {
    width: 30px; height: 30px;
    border: none; background: #f3f4f6;
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #6b7280; font-size: .82rem;
    transition: all .15s;
}
.avatar-picker-close:hover { background: #e5e7eb; color: #111827; }
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    padding: 14px 14px 10px;
}
.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    background: transparent;
    line-height: 1;
}
.avatar-option:hover {
    background: #f3f4f6;
    transform: scale(1.15);
}
.avatar-option.current {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), .08);
    transform: scale(1.1);
}
.avatar-picker-footer {
    padding: 6px 18px 14px;
    font-size: .8rem;
    text-align: center;
    min-height: 28px;
    color: #6b7280;
}

/* ===== Coin Float Animation ===== */
.coin-float-toast {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-size: .82rem;
    font-weight: 700;
    color: #b45309;
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(245,158,11,.25);
    animation: coinFloatUp 1.4s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes coinFloatUp {
    0%   { opacity: 0; transform: translateY(0)    scale(.8); }
    20%  { opacity: 1; transform: translateY(-8px)  scale(1.05); }
    80%  { opacity: 1; transform: translateY(-32px) scale(1); }
    100% { opacity: 0; transform: translateY(-48px) scale(.9); }
}
@keyframes coinBadgePulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.22); }
    70%  { transform: scale(.95); }
    100% { transform: scale(1); }
}
.coin-badge-pulse { animation: coinBadgePulse .5s cubic-bezier(.2,.8,.2,1); }

/* ===== User Dropdown ===== */
.user-dropdown-menu {
    min-width: 220px;
    padding: 8px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
    background: #ffffff;
    animation: userDropdownIn .18s cubic-bezier(.2,.8,.2,1) both;
    transform-origin: top right;
}
@keyframes userDropdownIn {
    from { opacity: 0; transform: scale(.94) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}
.user-dropdown-menu:not(.show) { animation: none; }

.user-dropdown-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 12px;
}
.user-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.12), rgba(var(--primary-rgb),.2));
    border: 2px solid rgba(var(--primary-rgb),.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}
.user-dropdown-info {
    flex: 1;
    min-width: 0;
}
.user-dropdown-name {
    font-size: .88rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.user-dropdown-coins {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .76rem;
    font-weight: 600;
    color: #b45309;
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 2px 8px;
}
.user-dropdown-coins i { color: #f59e0b; font-size: .82rem; }
.user-dropdown-vip-tag {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.35);
    border-radius: 4px;
    padding: 2px 6px;
}
.user-dropdown-vip-tag.active {
    color: #92400e;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.user-dropdown-divider {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 2px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: .855rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background .14s, color .14s;
    cursor: pointer;
}
.user-dropdown-item:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}
.user-dropdown-item:active { transform: scale(.98); }
.user-dropdown-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #6b7280;
    flex-shrink: 0;
    transition: background .14s, color .14s;
}
.user-dropdown-item:hover .user-dropdown-item-icon {
    background: rgba(var(--primary-rgb),.1);
    color: var(--primary);
}
.user-dropdown-item .checkin-icon { background: #ecfdf5; color: #059669; }
.user-dropdown-item .vip-icon     { background: #fef9c3; color: #d97706; }
.user-dropdown-item .ai-icon      { background: #ede9fe; color: #7c3aed; }
.user-dropdown-item:hover .checkin-icon { background: #d1fae5; color: #047857; }
.user-dropdown-item:hover .vip-icon     { background: #fef08a; color: #b45309; }
.user-dropdown-item:hover .ai-icon      { background: #ddd6fe; color: #6d28d9; }

.user-dropdown-logout { color: #6b7280; }
.user-dropdown-logout:hover { background: #fef2f2; color: #dc2626; }
.user-dropdown-logout:hover .user-dropdown-item-icon { background: #fee2e2; color: #dc2626; }

.user-dropdown-badge {
    margin-left: auto;
    background: #22c55e;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

/* ===== VIP Modal ===== */
.vip-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: #fffbeb;
}
.vip-modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}
.vip-modal-gem-wrap {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.vip-modal-gem-icon {
    font-size: 1.4rem;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.vip-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.vip-modal-sub {
    font-size: .78rem;
    opacity: .85;
    margin-top: 2px;
}
.vip-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 18px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    font-size: .86rem;
    font-weight: 600;
    color: #92400e;
    transition: background .3s, border-color .3s;
}
.vip-status-card.is-vip {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}
.vip-status-icon { font-size: 1.1rem; }
.vip-status-card.is-vip .vip-status-icon { color: #059669; }
.vip-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 18px 0;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.2);
    font-size: .82rem;
    color: #78350f;
}
.vip-balance-val {
    font-weight: 700;
    color: #b45309;
    display: flex; align-items: center; gap: 4px;
}
.vip-balance-val i { color: #f59e0b; }
.vip-tabs-wrap {
    display: flex;
    gap: 4px;
    margin: 14px 18px 0;
    background: rgba(0,0,0,.05);
    border-radius: 10px;
    padding: 3px;
}
.vip-tab-btn {
    flex: 1;
    padding: 7px;
    font-size: .82rem;
    font-weight: 600;
    color: #92400e;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
}
.vip-tab-btn.active {
    background: #fff;
    color: #d97706;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.vip-tab-pane {
    display: none;
    padding: 14px 18px 0;
}
.vip-tab-pane.active { display: block; }
.vip-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.vip-plan {
    position: relative;
    border: 2px solid #fde68a;
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all .18s;
    overflow: hidden;
}
.vip-plan:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245,158,11,.2);
    transform: translateY(-2px);
}
.vip-plan.selected {
    border-color: #d97706;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow: 0 4px 16px rgba(217,119,6,.25);
    transform: translateY(-2px);
}
.vip-plan-badge {
    position: absolute;
    top: 0; right: 0;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0 10px 0 10px;
}
.vip-plan-months {
    font-size: .82rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 6px;
}
.vip-plan.selected .vip-plan-months { color: #92400e; }
.vip-plan-price {
    font-size: .9rem;
    font-weight: 700;
    color: #b45309;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.vip-plan-price i { color: #f59e0b; font-size: .85rem; }
.vip-plan-save {
    margin-top: 4px;
    font-size: .7rem;
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    border-radius: 20px;
    padding: 1px 6px;
    display: inline-block;
}
.vip-buy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(217,119,6,.3);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-bottom: 16px;
}
.vip-buy-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(217,119,6,.4);
    transform: translateY(-1px);
}
.vip-buy-btn:active { transform: scale(.97); }
.vip-buy-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.vip-buy-btn .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.vip-redeem-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .88rem;
    color: #374151;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 12px;
}
.vip-redeem-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.vip-msg {
    min-height: 28px;
    text-align: center;
    font-size: .82rem;
    padding: 4px 18px 14px;
    font-weight: 500;
}

/* ===== Changelog Timeline ===== */
.changelog-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
    border-radius: 2px;
}
.cl-item {
    position: relative;
    margin-bottom: 1.25rem;
}
.cl-item:last-child { margin-bottom: 0; }
.cl-dot {
    position: absolute;
    left: -1.5rem;
    top: 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    border: 2px solid var(--bg-body, #fff);
    box-shadow: 0 0 0 2px var(--bs-primary, #0d6efd);
    z-index: 1;
}
.cl-card {
    background: var(--bg-result, #f8f9fa);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: .85rem 1.1rem;
    transition: box-shadow .15s;
}
.cl-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.cl-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.cl-version {
    font-weight: 700;
    font-size: .95rem;
    color: var(--bs-primary, #0d6efd);
}
.cl-date {
    font-size: .8rem;
    color: var(--text-muted, #6c757d);
}
.cl-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.badge-new    { background: #d1e7dd; color: #0a6640; }
.badge-fix    { background: #f8d7da; color: #842029; }
.badge-improve{ background: #fff3cd; color: #856404; }
.cl-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .875rem;
    color: var(--text-primary, #212529);
    line-height: 1.7;
}
.cl-list li + li { margin-top: .15rem; }

/* ===== About Modal ===== */
.about-header {
    background: linear-gradient(135deg, rgba(59,91,219,0.85) 0%, rgba(25,113,194,0.85) 100%);
    padding: 24px 28px 18px;
    color: #fff;
    position: relative;
}
.about-header p { font-size: .85rem; opacity: .85; }
.about-body {
    padding: 20px 28px;
    max-height: 70vh;
    font-size: .88rem;
    line-height: 1.7;
}

/* ===== Modal Gradient Close Button ===== */
.modal-grad-close { top: 12px; right: 14px; }

/* ===== AI Settings Modal ===== */
#aiSettingsModal .modal-content {
    border-radius: 24px;
    overflow: hidden;
    border: none;
    box-shadow: 0 24px 64px rgba(0,0,0,0.14);
}
.ai-settings-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.85) 0%, rgba(139,92,246,0.85) 100%);
    padding: 20px 24px 14px;
    color: #fff;
    position: relative;
}
.ai-settings-header p { font-size: .82rem; opacity: .85; }
.ai-settings-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}
.ai-tab-btn {
    flex: 1;
    padding: 10px;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.ai-tab-btn.active {
    border-bottom-color: #6366f1;
    color: #6366f1;
}
.ai-settings-body {
    padding: 16px 20px;
    max-height: 480px;
    overflow-y: auto;
}
.ai-config-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-cfg-form {
    margin-top: 14px;
    padding: 14px;
    background: #f8f9ff;
    border-radius: 18px;
    border: 1px solid #e0e7ff;
}
.ai-cfg-form-title {
    font-size: .82rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 10px;
}
.ai-cfg-form .form-label {
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.ai-cfg-msg { min-height: 18px; }
.ai-binding-desc {
    font-size: .82rem;
    color: #6b7280;
    margin-bottom: 12px;
}
.ai-binding-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== AI Global Panel ===== */
.ai-global-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    z-index: 1050;
    font-size: 1.4rem;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99,102,241,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    animation: aiBtnFloat 3s ease-in-out infinite, aiBtnGradient 5s ease infinite;
}
.ai-global-btn:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 32px rgba(99,102,241,0.4), 0 0 0 1px rgba(255,255,255,0.2) inset;
    animation: aiBtnGradient 5s ease infinite; /* pause float on hover for stability */
}
.ai-global-btn:active {
    transform: scale(0.95);
}
@keyframes aiBtnFloat {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}
@keyframes aiBtnGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ai-global-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 540px;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.5) inset, 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    flex-direction: column;
    display: flex;
    transform-origin: bottom right;
    animation: aiPanelScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes aiPanelScaleIn {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.ai-panel-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px 24px;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    flex-shrink: 0;
}
.ai-panel-header-title {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.ai-panel-header-title i {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.15rem;
}
.ai-panel-vip-hint { font-size: .65rem; border-radius: 999px; padding: 0.35em 0.65em; }
.ai-panel-close { 
    font-size: 1.1rem; 
    color: #6b7280 !important;
    background: #f9fafb;
    border-radius: 14px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}
.ai-panel-close:hover {
    background: #f3f4f6;
    color: #111827 !important;
}
.ai-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 250px;
    max-height: 400px;
    font-size: .95rem;
    line-height: 1.65;
    background: #fdfdfd;
    scroll-behavior: smooth;
}
.ai-panel-messages::-webkit-scrollbar { width: 5px; }
.ai-panel-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 999px; }
.ai-panel-messages::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.2); }

.ai-global-msg {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    animation: aiMsgIn .4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-global-msg-user {
    align-items: flex-end;
}
.ai-global-msg-ai {
    align-items: flex-start;
}
.ai-global-bubble {
    display: inline-block;
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 28px;
    font-size: .95rem;
    line-height: 1.6;
    word-break: break-word;
}
.ai-global-msg-user .ai-global-bubble {
    background: #f3f4f6;
    color: #111827;
    border-bottom-right-radius: 18px;
}
.ai-global-msg-ai .ai-global-bubble {
    background: transparent;
    color: #111827;
    padding: 4px 0;
}
.ai-global-msg-ai-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 8px;
}
.ai-global-msg-ai-icon i {
    color: #8b5cf6;
    font-size: 1.1rem;
}
.ai-global-msg-ai pre {
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 16px;
    font-size: .85rem;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'JetBrains Mono', "SFMono-Regular", Consolas, monospace;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ai-global-msg-ai code {
    font-family: 'JetBrains Mono', "SFMono-Regular", Consolas, monospace;
    font-size: .85em;
    color: #e06c75;
    background: #f3f4f6;
    padding: 3px 6px;
    border-radius: 10px;
}

.ai-panel-footer {
    padding: 16px 24px 24px;
    background: #fdfdfd;
    flex-shrink: 0;
    position: relative;
    border-top: none;
}
.ai-panel-footer::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, #fdfdfd, transparent);
    pointer-events: none;
}
.ai-panel-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    padding: 6px;
    transition: all .2s ease;
}
.ai-panel-input-wrapper:focus-within {
    border-color: rgba(99,102,241, 0.4);
    box-shadow: 0 4px 24px rgba(99,102,241, 0.08);
    transform: translateY(-1px);
}
.ai-panel-footer .form-control {
    border: none;
    border-radius: 22px;
    font-size: .95rem;
    padding: 10px 14px;
    background: transparent;
    box-shadow: none !important;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    flex: 1;
    line-height: 1.5;
}
.ai-panel-send-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 4px;
    border-radius: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(99,102,241,.2);
    flex-shrink: 0;
}
.ai-panel-send-btn:hover:not(:disabled) { 
    box-shadow: 0 6px 16px rgba(99,102,241,.3); 
    transform: translateY(-2px);
}
.ai-panel-send-btn:disabled { 
    opacity: .4; cursor: not-allowed; background: #e5e7eb; box-shadow: none; color: #9ca3af; 
}
.ai-panel-send-btn:not(:disabled):active { transform: scale(.95); }

/* ===== VIP Redeem Hint ===== */
.vip-redeem-hint {
    font-size: .82rem;
    color: #92400e;
    margin-bottom: 12px;
}
html[data-theme="dark"] .vip-redeem-hint { color: #fbbf24; }

/* Dark mode: AI Settings & Panel */
html[data-theme="dark"] .ai-settings-tabs {
    border-color: var(--border-color);
    background: var(--bg-card);
}
html[data-theme="dark"] .ai-tab-btn { color: var(--text-muted); }
html[data-theme="dark"] .ai-tab-btn.active {
    border-bottom-color: #818cf8;
    color: #818cf8;
}
html[data-theme="dark"] .ai-cfg-form {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--border-color);
}
html[data-theme="dark"] .ai-cfg-form-title { color: #818cf8; }
html[data-theme="dark"] .ai-binding-desc { color: var(--text-muted); }
html[data-theme="dark"] .ai-global-panel {
    background: rgba(30, 41, 59, 0.85);
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 0 1px rgba(0,0,0,.5);
}
html[data-theme="dark"] .ai-panel-header {
    background: rgba(30, 41, 59, 0.85);
    border-bottom-color: var(--border-color);
}
html[data-theme="dark"] .ai-panel-header-title {
    color: #f8fafc;
}
html[data-theme="dark"] .ai-panel-close {
    background: rgba(255,255,255,0.05);
    color: #9ca3af !important;
}
html[data-theme="dark"] .ai-panel-close:hover {
    background: rgba(255,255,255,0.1);
    color: #f8fafc !important;
}
html[data-theme="dark"] .ai-panel-messages {
    background: var(--bg-body);
}
html[data-theme="dark"] .ai-global-msg-user .ai-global-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
html[data-theme="dark"] .ai-global-msg-ai .ai-global-bubble {
    color: var(--text-primary);
}
html[data-theme="dark"] .ai-panel-footer {
    background: var(--bg-body);
}
html[data-theme="dark"] .ai-panel-footer::before {
    background: linear-gradient(to top, var(--bg-body), transparent);
}
html[data-theme="dark"] .ai-panel-input-wrapper {
    background: var(--bg-card);
    border-color: var(--border-color);
}
html[data-theme="dark"] .ai-panel-footer .form-control {
    color: var(--text-primary);
}
html[data-theme="dark"] .ai-panel-send-btn:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
}

/* ===== Responsive (Features) ===== */
@media (max-width: 575.98px) {
    .nav-coins-badge {
        padding: 2px 7px;
        font-size: .74rem;
    }
    .nav-coins-badge i {
        font-size: .8rem;
    }
    .changelog-timeline { padding: 0; }
}
