/* ========================================= */
/* 文件：star-bottle.css                      */
/* 功能：星空瓶 3D 记忆球体的全部样式 ——        */
/*       星点分布、球面旋转、星云卡片、         */
/*       打开/关闭动画、星星闪烁特效            */
/* ========================================= */

/* ===== Star Bottle ===== */
#starBottleOverlay {
    /* ✨ 删掉旧的 width: 100%; height: 100%; position: absolute; */
    
    /* ✨ 换成这套经过实战检验的终极四角打钉法！ */
    position: fixed !important;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    
    flex-direction: column;
    background: rgba(4,5,14,0.92);
    z-index: 1000;
    overflow: hidden;
}
/* 模糊背景图层，单独放在最底下不影响UI */
#starBottleOverlay::before {
    content: '';
    position: absolute;
    inset: -12px;
    background: url("../../../assets/星泊地.webp") no-repeat center center;
    background-size: cover;
    filter: blur(8px);
    opacity: 0.38;
    z-index: 0;
}


.sb-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 8px;
    min-height: 52px;
    position: relative; z-index: 1;
}

.sb-topbar-title {
    font-size: 11px;
    color: rgba(162,155,254,0.45);
    letter-spacing: 0.2em;
}

.sb-close-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 0.5px solid rgba(162,155,254,0.25);
    background: rgba(162,155,254,0.06);
    display: flex; align-items: center; justify-content: center;
    color: rgba(162,155,254,0.5);
    font-size: 12px; cursor: pointer; line-height: 1;
}

.sb-filter-row {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px 0 10px;
    position: relative; z-index: 1;
}

.sb-ftag {
    font-size: 10px; padding: 4px 14px;
    border-radius: 20px;
    border: 0.5px solid rgba(162,155,254,0.2);
    color: rgba(162,155,254,0.4);
    cursor: pointer; background: transparent;
    transition: all 0.2s; letter-spacing: 0.05em;
}
.sb-ftag.active { border-color: rgba(162,155,254,0.6); color: #cbbbf9; background: rgba(162,155,254,0.1); }
.sb-ftag.sb-gold.active { border-color: rgba(255,179,122,0.5); color: #ffb37a; background: rgba(255,179,122,0.07); }

.sb-starfield {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

@keyframes sbDrift { from{transform:translate(0,0);}to{transform:translate(var(--tx,4px),var(--ty,6px));} }

.sb-star-topic {
    position: absolute;
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; transition: transform 0.3s ease;
}
.sb-star-topic:active { transform: scale(0.92); }

.sb-nebula-wrap { position: relative; display: flex; align-items: center; justify-content: center; }

.sb-nebula-ring {
    position: absolute; border-radius: 50%;
    border: 0.5px solid rgba(162,155,254,0.18);
    animation: sbRingPulse var(--rp,4s) ease-in-out infinite;
}
@keyframes sbRingPulse { 0%,100%{transform:scale(1);opacity:0.5;}50%{transform:scale(1.3);opacity:0.1;} }

.sb-nebula-core {
    border-radius: 50%; position: relative; z-index: 2;
    background: radial-gradient(circle at 50% 50%,
        rgba(220,215,255,0.6) 0%, rgba(162,155,254,0.25) 35%,
        rgba(120,100,220,0.08) 60%, transparent 100%);
    box-shadow: 0 0 10px rgba(162,155,254,0.5),
                0 0 24px rgba(162,155,254,0.2),
                0 0 50px rgba(130,110,230,0.1);
}
.sb-nebula-core::after {
    content:''; position:absolute; top:50%; left:50%;
    transform:translate(-50%,-50%); width:28%; height:28%;
    border-radius:50%; background:rgba(230,225,255,0.85);
    box-shadow:0 0 6px rgba(200,195,255,0.8);
}

.sb-topic-label {
    font-size: 10px; color: rgba(162,155,254,0.7);
    margin-top: 7px; max-width: 65px;
    text-align: center; line-height: 1.3;
}

.sb-star-gold {
    position: absolute;
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
    animation: sbFloatStar var(--fs,5s) ease-in-out infinite alternate;
}
@keyframes sbFloatStar { from{transform:translateY(0);}to{transform:translateY(-8px);} }
.sb-star-gold:active { transform: scale(0.9); }
.sb-gold-icon {
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 0 4px rgba(203,187,249,0.7)) drop-shadow(0 0 9px rgba(255,179,122,0.45));
}
.sb-gold-icon .sb-shine-icon {
    background: linear-gradient(135deg, #cbbbf9 0%, #ffb37a 100%);
    -webkit-mask: url('../../../tubiao/shining-2-fill.svg') center/contain no-repeat;
    mask: url('../../../tubiao/shining-2-fill.svg') center/contain no-repeat;
}
.sb-gold-label {
    font-size: 9px; color: rgba(255,190,100,0.55);
    margin-top: 5px; max-width: 58px;
    text-align: center; line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-bottle-zone {
    flex-shrink: 0;
    height: 40px;
    position: relative;
    display: flex; align-items: flex-end; justify-content: center;
    pointer-events: none;
}
.sb-bottle-ellipse {
    position: relative; width: 260px; height: 36px;
}
.sb-glow-line {
    position: absolute; bottom: 2px; left: 50%;
    transform: translateX(-50%);
    width: 180px; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%, rgba(162,155,254,0.6) 30%,
        rgba(200,195,255,1) 50%, rgba(162,155,254,0.6) 70%, transparent 100%);
    box-shadow: 0 0 8px 2px rgba(162,155,254,0.4),
                0 0 20px 6px rgba(162,155,254,0.15),
                0 0 40px 12px rgba(162,155,254,0.06);
    animation: sbGlowBreathe 3s ease-in-out infinite;
}
@keyframes sbGlowBreathe { 0%,100%{width:160px;opacity:0.7;}50%{width:220px;opacity:1;} }

.sb-bottle-arc {
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%);
    width: 220px; height: 30px;
}

.sb-bottom-bar {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 0 max(32px, env(safe-area-inset-bottom));
    position: relative; z-index: 1;
}
.sb-bottom-actions { display: flex; gap: 12px; }
.sb-action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.sb-action-icon {
    width: 44px; height: 44px; border-radius: 50%;
    border: 0.5px solid rgba(162,155,254,0.25);
    background: rgba(162,155,254,0.06);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.sb-action-icon:hover { background: rgba(162,155,254,0.14); border-color: rgba(162,155,254,0.5); }
.sb-action-label { font-size: 9px; color: rgba(162,155,254,0.4); letter-spacing: 0.05em; }

.sb-mem-card {
    position: absolute;
    background: url("../../../assets/星泊地.webp") no-repeat center center / cover;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 0.5px solid rgba(162,155,254,0.28);
    border-radius: 16px; padding: 14px 16px; width: 215px;
    display: none; z-index: 100;
    box-shadow: -1px -1px 6px rgba(162,155,254,0.15),
                1px 1px 6px rgba(255,179,122,0.08),
                0 8px 20px rgba(0,0,0,0.3);
}
.sb-mem-card.show { display: block; animation: sbCardIn 0.18s ease; }
@keyframes sbCardIn { from{opacity:0;transform:translateY(8px) scale(0.95);}to{opacity:1;transform:translateY(0) scale(1);} }
.sb-mc-type { font-size: 9px; color: rgba(203,187,249,0.6); letter-spacing: 0.08em; margin-bottom: 8px; }
.sb-mc-content { font-size: 11px; color: rgba(255,255,255,0.82); line-height: 1.65; }
.sb-mc-time { font-size: 9px; color: rgba(255,255,255,0.22); margin-top: 10px; }
.sb-mc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sb-mc-tag { font-size: 8px; color: rgba(203,187,249,0.6); background: rgba(162,155,254,0.08); border-radius: 20px; padding: 2px 8px; border: 0.5px solid rgba(162,155,254,0.15); }

.sb-drawer {
    position: absolute; top: 0; right: -265px; width: 265px; height: 100%;
    background: linear-gradient(135deg, rgba(140, 120, 240, 0.18), rgba(70, 60, 120, 0.08));
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border-left: 0.5px solid rgba(162,155,254,0.28);
    z-index: 40; transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
}
.sb-drawer.sb-open { right: 0; }
.sb-drawer-head { padding: max(56px, calc(env(safe-area-inset-top) + 20px)) 18px 14px; border-bottom: 0.5px solid rgba(255,255,255,0.06); }
.sb-drawer-title { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; background: linear-gradient(90deg,#cbbbf9,#ffb37a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px; }
.sb-drawer-sub { font-size: 9px; color: rgba(162,155,254,0.3); }
.sb-drawer-body { 
    flex: 1; 
    overflow-y: auto; 
    padding: 8px 0; 
    
    /* ✨ 减震海绵：保证滑动星空瓶分类抽屉时，绝不扯动整个界面！ */
    overscroll-behavior-y: none;
    touch-action: pan-y;
}
.sb-drawer-item { display: flex; align-items: center; gap: 10px; padding: 11px 18px; cursor: pointer; transition: background 0.15s; }
.sb-drawer-item:hover { background: rgba(162,155,254,0.05); }
.sb-drawer-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-drawer-name { font-size: 12px; color: rgba(255,255,255,0.65); flex: 1; }
.sb-drawer-count { font-size: 10px; color: rgba(162,155,254,0.3); }
.sb-drawer-edit { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; cursor: pointer; }
.sb-drawer-item:hover .sb-drawer-edit { opacity: 1; }
.sb-drawer-divider { height: 0.5px; background: rgba(255,255,255,0.06); margin: 4px 18px; }
.sb-drawer-add { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; }
.sb-drawer-add-icon { width: 22px; height: 22px; border-radius: 50%; border: 0.5px solid rgba(162,155,254,0.3); display: flex; align-items: center; justify-content: center; }
.sb-drawer-add-label { font-size: 11px; color: rgba(162,155,254,0.45); }

.sb-bottom-panel {
    position: absolute; left: 0; right: 0; z-index: 50;
    background: linear-gradient(135deg, rgba(140, 120, 240, 0.18), rgba(70, 60, 120, 0.08));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 0.5px solid rgba(162,155,254,0.28);
    border-radius: 20px 20px 0 0;
    transition: bottom 0.3s cubic-bezier(0.4,0,0.2,1);
    padding: 14px 20px max(36px, calc(env(safe-area-inset-bottom) + 16px));
}
.sb-panel-handle { width: 36px; height: 3px; background: rgba(162,155,254,0.2); border-radius: 2px; margin: 0 auto 14px; }
.sb-panel-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.sb-panel-star { display: inline-block; animation: sbTwinkleStar 4s ease-in-out infinite; }
@keyframes sbTwinkleStar { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:0.4;transform:scale(0.85);} }
.sb-panel-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; background: linear-gradient(90deg,#cbbbf9,#ffb37a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sb-panel-label { font-size: 10px; color: rgba(203,187,249,0.4); margin-bottom: 8px; letter-spacing: 0.05em; padding-left: 5%; }

.sb-settings-panel {
    position: absolute; left: 0; right: 0; bottom: -230px; height: 230px;
    background: linear-gradient(135deg, rgba(140, 120, 240, 0.18), rgba(70, 60, 120, 0.08));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 0.5px solid rgba(162,155,254,0.28);
    border-radius: 20px 20px 0 0;
    z-index: 40; transition: bottom 0.3s cubic-bezier(0.4,0,0.2,1);
    padding: 20px 24px max(32px, env(safe-area-inset-bottom));
}
.sb-settings-panel.sb-open { bottom: 0; }
.sb-sp-handle { width: 36px; height: 3px; background: rgba(162,155,254,0.25); border-radius: 2px; margin: 0 auto 18px; }
.sb-sp-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; background: linear-gradient(90deg,#cbbbf9,#ffb37a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 18px; }
.sb-sp-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sb-sp-label { font-size: 12px; color: rgba(255,255,255,0.55); }
.sb-sp-val { font-size: 12px; color: #cbbbf9; font-weight: 600; min-width: 20px; text-align: right; }
.sb-sp-slider { width: 120px; height: 2px; background: rgba(162,155,254,0.2); border-radius: 1px; position: relative; cursor: pointer; }
.sb-sp-fill { height: 100%; background: linear-gradient(90deg,#cbbbf9,rgba(255,179,122,0.8)); border-radius: 1px; }
.sb-sp-thumb { width: 12px; height: 12px; border-radius: 50%; background: #cbbbf9; position: absolute; top: -5px; box-shadow: 0 0 6px rgba(203,187,249,0.7); }

/* 标签面板和添加记忆面板 */
.sb-add-tag-panel,
.sb-add-modal {
    position: absolute;
    left: 0; right: 0;
    z-index: 50;
    background: linear-gradient(135deg, rgba(140, 120, 240, 0.18), rgba(70, 60, 120, 0.08));
    backdrop-filter: blur(24px) saturate(160%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08); /* 加一条顶部极细的玻璃反光 */
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 0.5px solid rgba(162,155,254,0.28);
    border-radius: 20px 20px 0 0;
    transition: bottom 0.3s cubic-bezier(0.4,0,0.2,1);
    padding: 14px 20px max(36px, calc(env(safe-area-inset-bottom) + 16px));
}
.sb-add-tag-panel { bottom: -215px; height: 215px; }
.sb-add-tag-panel.sb-open { bottom: 0; }
.sb-add-modal { bottom: -345px; height: 345px; }
.sb-add-modal.sb-open { bottom: 0; }

.sb-modal-handle { width: 36px; height: 3px; background: rgba(162,155,254,0.2); border-radius: 2px; margin: 0 auto 14px; }
.sb-modal-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.sb-modal-star { display: inline-block; animation: sbTwinkleStar 4s ease-in-out infinite; }
.sb-modal-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; background: linear-gradient(90deg,#cbbbf9,#ffb37a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sb-modal-label { font-size: 10px; color: rgba(203,187,249,0.4); margin-bottom: 8px; letter-spacing: 0.05em; }

.sb-modal-textarea {
    width: 100%; height: 80px;
    background: rgba(162,155,254,0.08);
    border: 1px solid rgba(162,155,254,0.4);
    box-shadow: 0 0 8px rgba(162,155,254,0.2);
    border-radius: 16px;
    color: rgba(255,255,255,0.82); font-size: 12px;
    padding: 12px 14px; resize: none; outline: none;
    font-family: inherit; line-height: 1.6; margin-bottom: 12px;
}
.sb-modal-textarea::placeholder { color: rgba(255,255,255,0.2); }
.sb-modal-textarea:focus { border-color: rgba(255,179,122,0.4); box-shadow: 0 0 10px rgba(255,179,122,0.1); }

.sb-tag-input {
    width: 90%; margin: 0 auto 14px; display: block;
    background: rgba(162,155,254,0.08);
    border: 1px solid rgba(162,155,254,0.4);
    box-shadow: 0 0 8px rgba(162,155,254,0.2);
    border-radius: 30px;
    color: rgba(255,255,255,0.82); font-size: 12px;
    padding: 10px 16px; outline: none; font-family: inherit;
}
.sb-tag-input::placeholder { color: rgba(255,255,255,0.2); }

.sb-select-row { display: flex; gap: 8px; margin-bottom: 16px; }
.sb-custom-select {
    flex: 1; position: relative;
    background: rgba(162,155,254,0.06);
    border: 0.5px solid rgba(162,155,254,0.25);
    border-radius: 30px; overflow: hidden;
}
.sb-custom-select select {
    width: 100%; appearance: none; -webkit-appearance: none;
    background: transparent; border: none; outline: none;
    color: rgba(203,187,249,0.8); font-size: 11px;
    padding: 9px 28px 9px 14px; font-family: inherit; cursor: pointer;
}
.sb-custom-select select option { background: #0a0818; color: rgba(255,255,255,0.8); }
.sb-custom-select::after { content: '\25BE'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 10px; color: rgba(162,155,254,0.4); pointer-events: none; }

.sb-modal-btn-row { display: flex; gap: 8px; }
.sb-modal-btn {
    flex: 1; height: 38px; border-radius: 30px;
    font-size: 11px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s; letter-spacing: 0.05em; border: none;
}
.sb-modal-btn:hover { transform: translateY(-2px); }
.sb-cancel { background: transparent; color: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.12) !important; }
.sb-save { background: linear-gradient(90deg,rgba(162,155,254,0.15),rgba(255,179,122,0.15)); color: #ffb37a; border: 1px solid rgba(255,179,122,0.3) !important; box-shadow: inset 0 0 10px rgba(162,155,254,0.1); }

@media (min-width: 450px) {
    .sb-topbar { padding-top: 16px; min-height: 52px; }
    .sb-drawer-head { padding-top: 20px; }
}


/* ===== Star Bottle 专场动画 ===== */
.sb-flash {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(200,190,255,0.45) 0%,
        rgba(162,155,254,0.2) 40%,
        transparent 100%);
    pointer-events: none;
    z-index: 9999;
    animation: sbFlashBurst 0.8s ease-out forwards;
}
@keyframes sbFlashBurst {
    0%   { transform: translate(-50%,-50%) scale(0);  opacity: 0.9; }
    25%  { transform: translate(-50%,-50%) scale(2);  opacity: 0.7; }
    60%  { transform: translate(-50%,-50%) scale(7);  opacity: 0.3; }
    100% { transform: translate(-50%,-50%) scale(14); opacity: 0; }
}

/* 关灯收缩光效 */
.sb-close-flash {
    position: absolute;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(200,190,255,0.5) 0%,
        rgba(162,155,254,0.2) 45%,
        transparent 100%);
    pointer-events: none;
    z-index: 9999;
    animation: sbCloseContract 0.55s ease-in forwards;
}
@keyframes sbCloseContract {
    0%   { transform: translate(-50%,-50%) scale(14); opacity: 0; }
    15%  { transform: translate(-50%,-50%) scale(8);  opacity: 0.5; }
    55%  { transform: translate(-50%,-50%) scale(2);  opacity: 0.7; }
    85%  { transform: translate(-50%,-50%) scale(0.4); opacity: 0.9; }
    100% { transform: translate(-50%,-50%) scale(0);  opacity: 0; }
}

/* 星星逐颗亮起 */
.sb-entry-star {
    position: absolute;
    width: 2px; height: 2px;
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    animation: sbStarAppear 0.6s ease-out forwards;
}
@keyframes sbStarAppear {
    0%   { opacity: 0; transform: scale(0); }
    40%  { opacity: 1; transform: scale(1.8); }
    100% { opacity: 0.55; transform: scale(1); }
}

/* 星星熄灭 */
.sb-die-star {
    animation: sbStarDie 0.45s ease-in forwards !important;
}
@keyframes sbStarDie {
    0%   { opacity: 0.6; transform: scale(1); }
    60%  { opacity: 0.8; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(0); }
}
