/* ============ 捏泡泡纸 v3 ============ */
.bw-hero {
    margin-top: 28px;
    padding: 26px 28px 30px;
    border-radius: 18px;
    position: relative;
    background: linear-gradient(160deg, #eef7ff 0%, #e3f1fd 50%, #d3e9fb 100%);
    border: 1px solid #cfe3f5;
    box-shadow: 0 10px 30px rgba(70, 130, 200, 0.12);
}
[data-theme="dark"] .bw-hero {
    background: linear-gradient(160deg, #16202c 0%, #172636 50%, #182c40 100%);
    border-color: #27425e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.bw-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.bw-brand { display: flex; align-items: center; gap: 14px; }
.bw-logo {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border-radius: 14px;
    background: linear-gradient(145deg, #7fc4f5, #3f8fd8);
    box-shadow: 0 6px 14px rgba(60, 140, 215, 0.35);
}
.bw-title { font-size: 22px; font-weight: 800; color: #1e4f78; }
[data-theme="dark"] .bw-title { color: #bde1fb; }
.bw-sub { font-size: 13px; color: #6a93b5; margin-top: 2px; }
[data-theme="dark"] .bw-sub { color: #7aa4c6; }

.bw-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.bw-stat {
    min-width: 62px;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #cfe3f5;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(70, 130, 200, 0.1);
}
[data-theme="dark"] .bw-stat { background: rgba(20, 32, 46, 0.7); border-color: #27425e; }
.bw-stat b { display: block; font-size: 18px; font-weight: 800; color: #2c7bc7; }
.bw-stat span { font-size: 10.5px; color: #7b9dbd; }
[data-theme="dark"] .bw-stat span { color: #6f95b8; }

/* 进度条 */
.bw-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bw-progress-track {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #cfe3f5;
    border-radius: 999px;
    overflow: hidden;
}
[data-theme="dark"] .bw-progress-track { background: rgba(15, 25, 38, 0.7); border-color: #27425e; }
.bw-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #8fd0ff, #2c7bc7);
    border-radius: 999px;
    transition: width .25s ease;
}
.bw-progress-text { font-size: 13px; font-weight: 800; color: #2c7bc7; min-width: 44px; text-align: right; }
[data-theme="dark"] .bw-progress-text { color: #8ec9ff; }

/* 控制栏 */
.bw-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.bw-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #cfe3f5;
    border-radius: 11px;
}
[data-theme="dark"] .bw-seg { background: rgba(15, 25, 38, 0.7); border-color: #27425e; }
.bw-seg button {
    border: 0;
    background: transparent;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 700;
    color: #5c85ab;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.bw-seg button.active {
    background: #2c7bc7;
    color: #fff;
    box-shadow: 0 3px 8px rgba(44, 123, 199, 0.35);
}
[data-theme="dark"] .bw-seg button { color: #8fb3d3; }
[data-theme="dark"] .bw-seg button.active { background: #3f8fd8; }

.bw-btn {
    border: 1px solid #bfd9f0;
    background: #fff;
    color: #2c6390;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}
.bw-btn:hover { transform: translateY(-1px); border-color: #8fbfe5; }
.bw-btn.primary {
    background: linear-gradient(135deg, #5ba8e8, #2c7bc7);
    color: #fff;
    border: 0;
    box-shadow: 0 4px 12px rgba(44, 123, 199, 0.35);
}
.bw-btn.sound-btn.active { background: #eef6fd; color: #2c74b4; border-color: #a8cfe8; }
.bw-btn.sound-btn.off { opacity: .5; text-decoration: line-through; }
[data-theme="dark"] .bw-btn { background: #16202c; border-color: #27425e; color: #a7cbe9; }
[data-theme="dark"] .bw-btn.sound-btn.active { background: #16222e; color: #8ec9ff; border-color: #31587d; }

/* ---- 泡泡板（主题） ---- */
.bw-board {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 16px;
    --bw-board1: #c8dff2;
    --bw-board2: #dcebf8;
    --bw-board-border: #b8d4ec;
    --bw-glow-hi: rgba(255, 255, 255, 0.55);
    background:
        radial-gradient(circle at 30% 20%, var(--bw-glow-hi) 0%, transparent 60%),
        linear-gradient(135deg, var(--bw-board1) 0%, var(--bw-board2) 100%);
    border: 1px solid var(--bw-board-border);
    box-shadow: inset 0 2px 8px rgba(90, 140, 190, 0.18), 0 8px 22px rgba(70, 130, 200, 0.15);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.bw-board[data-theme="pink"] {
    --bw-board1: #f6d3e4;
    --bw-board2: #fbe7f0;
    --bw-board-border: #efc0d8;
    --bw-glow-hi: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 2px 8px rgba(220, 130, 175, 0.18), 0 8px 22px rgba(220, 130, 175, 0.16);
}
.bw-board[data-theme="forest"] {
    --bw-board1: #c8e6cd;
    --bw-board2: #ddf0df;
    --bw-board-border: #b3d8ba;
    --bw-glow-hi: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 2px 8px rgba(80, 160, 100, 0.18), 0 8px 22px rgba(80, 160, 100, 0.15);
}
.bw-board[data-theme="nebula"] {
    --bw-board1: #d3c9f0;
    --bw-board2: #e5ddf8;
    --bw-board-border: #c3b5e6;
    --bw-glow-hi: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 2px 8px rgba(140, 110, 210, 0.18), 0 8px 22px rgba(140, 110, 210, 0.16);
}
[data-theme="dark"] .bw-board {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
        linear-gradient(135deg, #1c2c3e 0%, #24374c 100%);
    border-color: #2c4a68;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25), 0 8px 22px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .bw-board[data-theme="pink"] {
    background: linear-gradient(135deg, #3a2230 0%, #472a3a 100%);
    border-color: #5e3649;
}
[data-theme="dark"] .bw-board[data-theme="forest"] {
    background: linear-gradient(135deg, #1e3224 0%, #263d2c 100%);
    border-color: #35523c;
}
[data-theme="dark"] .bw-board[data-theme="nebula"] {
    background: linear-gradient(135deg, #2a2440 0%, #362e4e 100%);
    border-color: #474060;
}

.bubble {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    box-sizing: border-box;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        inset 1px 2px 4px rgba(255, 255, 255, 0.95),
        inset -1px -2px 5px rgba(255, 255, 255, 0.25),
        0 2px 5px rgba(70, 120, 180, 0.22);
    transition: transform .12s ease;
}
[data-theme="dark"] .bubble {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        inset 1px 2px 4px rgba(255, 255, 255, 0.3),
        inset -1px -2px 5px rgba(0, 0, 0, 0.5),
        0 2px 5px rgba(0, 0, 0, 0.4);
}
.bubble:hover { transform: scale(1.05); }
/* 主高光（左上） */
.bubble::after {
    content: '';
    position: absolute;
    top: 12%;
    left: 16%;
    width: 36%;
    height: 28%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 72%);
    transform: rotate(-8deg);
    z-index: 2;
}
[data-theme="dark"] .bubble::after {
    background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1) 72%);
}
/* 底部小反光（右下） */
.bubble::before {
    content: '';
    position: absolute;
    bottom: 9%;
    right: 13%;
    width: 17%;
    height: 17%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    filter: blur(1px);
    z-index: 1;
    pointer-events: none;
}
[data-theme="dark"] .bubble::before {
    background: rgba(255, 255, 255, 0.3);
}
.bubble.burst { opacity: 0; pointer-events: none; }

/* 粒子飞溅 */
.particle {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    border-radius: 50%;
    animation: bwFly 0.55s ease-out forwards;
}
@keyframes bwFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--px), var(--py)) scale(0.15); opacity: 0; }
}

/* 连击浮动文字 */
.bw-combo-pop {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    font-weight: 900;
    font-size: 20px;
    color: #ff9d2e;
    text-shadow: 0 2px 8px rgba(255, 140, 20, 0.4);
    animation: bwCombo 0.8s ease-out forwards;
}
[data-theme="dark"] .bw-combo-pop { color: #ffb257; }
@keyframes bwCombo {
    0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
    20% { transform: translate(-50%, -14px) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -60px) scale(1); opacity: 0; }
}

/* 泡泡说话文案 */
.bw-phrase {
    position: fixed;
    z-index: 55;
    pointer-events: none;
    font-size: 13px;
    font-weight: 700;
    color: #3f78a5;
    background: rgba(255, 255, 255, 0.94);
    padding: 3px 11px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(70, 130, 200, 0.22);
    white-space: nowrap;
    animation: bwPhraseUp 0.9s ease-out forwards;
}
[data-theme="dark"] .bw-phrase {
    color: #cde8ff;
    background: rgba(20, 40, 60, 0.94);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
@keyframes bwPhraseUp {
    0% { transform: translate(-50%, 4px) scale(0.7); opacity: 0; }
    15% { transform: translate(-50%, 0) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -34px) scale(0.95); opacity: 0; }
}

/* 完成庆祝 */
.bw-celebrate {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 45, 70, 0.45);
    backdrop-filter: blur(3px);
    border-radius: 16px;
    z-index: 20;
}
.bw-celebrate[hidden] { display: none; }
.bw-cel-inner {
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 28px 40px;
    box-shadow: 0 18px 50px rgba(20, 60, 100, 0.35);
    animation: bwPop 0.45s cubic-bezier(.2, 1.6, .4, 1);
    max-width: 90%;
}
[data-theme="dark"] .bw-cel-inner { background: #1b2a3a; }
.bw-cel-emoji { font-size: 48px; }
.bw-cel-inner h3 { margin: 8px 0 6px; font-size: 20px; color: #1e4f78; }
[data-theme="dark"] .bw-cel-inner h3 { color: #bde1fb; }
.bw-cel-inner p { margin: 0 0 8px; color: #6a93b5; font-size: 14px; }
.bw-cel-inner b { color: #2c7bc7; }
.bw-cel-achv {
    margin: 0 0 14px;
    font-size: 13px;
    color: #b45309;
    background: #fff7e6;
    border: 1px solid #f0c98e;
    border-radius: 8px;
    padding: 6px 12px;
    animation: bwPop 0.4s ease;
}
.bw-cel-achv b { color: #b45309; }
@keyframes bwPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- 成就墙 ---- */
.bw-achv-panel {
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #cfe3f5;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(70, 130, 200, 0.12);
}
[data-theme="dark"] .bw-achv-panel { background: rgba(22, 32, 44, 0.85); border-color: #27425e; }
.bw-achv-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #1e4f78;
    margin-bottom: 14px;
}
[data-theme="dark"] .bw-achv-head { color: #bde1fb; }
.bw-achv-count { font-size: 12px; color: #6a93b5; font-weight: 700; }
.bw-achv-close {
    margin-left: auto;
    border: 0;
    background: rgba(44, 123, 199, 0.12);
    color: #2c7bc7;
    width: 28px; height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.bw-achv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.bw-achv-item {
    padding: 12px 10px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #cfe3f5;
    background: #f6fbff;
    transition: all .2s ease;
}
[data-theme="dark"] .bw-achv-item { border-color: #27425e; background: #16222e; }
.bw-achv-item.unlocked { border-color: #ffd166; background: #fffbe9; }
[data-theme="dark"] .bw-achv-item.unlocked { border-color: #8a6a1a; background: #2e2713; }
.bw-achv-item .ai-emoji { font-size: 26px; display: block; margin-bottom: 4px; filter: grayscale(1) opacity(0.45); }
.bw-achv-item.unlocked .ai-emoji { filter: none; animation: bwPop 0.4s ease; }
.bw-achv-item .ai-name { font-size: 13px; font-weight: 800; color: #5c85ab; display: block; }
[data-theme="dark"] .bw-achv-item .ai-name { color: #8fb3d3; }
.bw-achv-item.unlocked .ai-name { color: #b45309; }
[data-theme="dark"] .bw-achv-item.unlocked .ai-name { color: #ffbe6b; }
.bw-achv-item .ai-desc { font-size: 11px; color: #8aa7c2; display: block; margin-top: 2px; line-height: 1.4; }
[data-theme="dark"] .bw-achv-item .ai-desc { color: #5f86a5; }

.bw-records {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #4a6b8a;
}
[data-theme="dark"] .bw-records { color: #7aa4c6; }
.bw-records span {
    background: rgba(44, 123, 199, 0.1);
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 600;
}
.bw-records b { color: #2c7bc7; }

/* toast */
.bw-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    background: #1b2a3a;
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: bwToastIn .35s ease, bwToastOut .4s ease 2.6s forwards;
}
.bw-toast[hidden] { display: none; }
@keyframes bwToastIn {
    from { transform: translateX(-50%) translateY(-24px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes bwToastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}

/* ---- 信息区 ---- */
.bw-info { margin-top: 30px; }
