:root {
    --bg-gradient: linear-gradient(160deg, #4a6a9f 0%, #5a8ada 50%, #3a5080 100%);
    --card-bg: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.35);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.75);
    --accent-blue: #5b9cff;
    --accent-green: #4ade80;
    --accent-red: #f87171;
    --accent-gold: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-touch-callout: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 28px;
}

@media (min-width: 768px) {
    .subtitle { font-size: 1.125rem; }
}

.refresh-btn {
    background: var(--accent-blue);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 0.9375rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
    font-family: inherit;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 156, 255, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.refreshing {
    pointer-events: none;
    opacity: 0.7;
}

.refresh-btn.refreshing::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* ========== 卡片网格 ========== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 48px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* ========== 卡片容器 ========== */
.card-wrapper {
    perspective: 1200px;
    height: 340px;
    animation: cardIn 0.5s ease forwards;
    opacity: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    transition: filter 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    will-change: filter;
}

.card-wrapper:hover {
    z-index: 10;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.3));
}

@media (min-width: 768px) {
    .card-wrapper { height: 360px; }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-wrapper:nth-child(1) { animation-delay: 0.05s; }
.card-wrapper:nth-child(2) { animation-delay: 0.1s; }
.card-wrapper:nth-child(3) { animation-delay: 0.15s; }
.card-wrapper:nth-child(4) { animation-delay: 0.2s; }
.card-wrapper:nth-child(5) { animation-delay: 0.25s; }
.card-wrapper:nth-child(6) { animation-delay: 0.3s; }
.card-wrapper:nth-child(7) { animation-delay: 0.35s; }
.card-wrapper:nth-child(8) { animation-delay: 0.4s; }
.card-wrapper:nth-child(9) { animation-delay: 0.45s; }

/* ========== 卡片主体 ========== */
.card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform;
    transform: translateZ(0);
}

.card:active {
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-6px);
    }
}

.card.flipped {
    transform: rotateY(180deg);
}

@media (hover: hover) {
    .card.flipped:hover {
        transform: rotateY(180deg) translateY(-6px);
    }
}

/* ========== 卡片面 ========== */
.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    padding: 28px;
    background: linear-gradient(145deg, var(--city-bg1, var(--card-bg)), var(--city-bg2, var(--card-bg)));
    border: 1px solid var(--city-border, var(--card-border));
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
    transform: translateZ(0);
}

@media (min-width: 768px) {
    .card-face {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

@media (hover: hover) {
    .card:hover .card-face {
        border-color: rgba(255, 255, 255, 0.45);
    }
}

.card-front {
    justify-content: space-between;
    position: relative;
}

.temperature {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--city-text, var(--accent-gold));
}

@media (min-width: 768px) {
    .temperature { font-size: 4rem; }
}

.weather-description {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    margin-top: 8px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: var(--city-text, var(--text-primary));
}

/* ========== 卡片头部 ========== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 12px;
}

.city-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.city-name {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 8px;
}

.city-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--city-text, var(--accent-gold)), transparent);
    border-radius: 2px;
}

@media (min-width: 768px) {
    .city-name { font-size: 1.75rem; }
}

.update-time {
    position: absolute;
    right: 28px;
    bottom: 10px;
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ========== 天气图标区域 ========== */
.weather-center {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
    padding: 0;
    margin-top: -10px;
}

.weather-icon {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

@media (min-width: 768px) {
    .weather-icon { width: 100px; height: 100px; }
}

/* 不同天气的图标动画 */
.weather-icon.icon-sunny {
    animation: sunPulse 3s ease-in-out infinite;
}

.weather-icon.icon-cloudy {
    animation: cloudFloat 4s ease-in-out infinite;
}

.weather-icon.icon-rainy {
    animation: rainBounce 2s ease-in-out infinite;
}

.weather-icon.icon-snowy {
    animation: snowFall 3s ease-in-out infinite;
}

.weather-icon.icon-stormy {
    animation: stormShake 0.5s ease-in-out infinite;
}

.weather-icon.icon-foggy {
    animation: fogFade 4s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 12px rgba(255, 200, 50, 0.5)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 6px 20px rgba(255, 200, 50, 0.7)); }
}

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

@keyframes rainBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes snowFall {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(5px) rotate(5deg); }
}

@keyframes stormShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes fogFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== 卡片底部信息 ========== */
.weather-footer {
    padding-top: 16px;
    padding-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-footer-labels,
.weather-footer-values {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.weather-footer-labels span,
.weather-footer-values span {
    flex: 1;
    text-align: center;
}

.weather-footer-labels {
    margin-bottom: 12px;
}

.weather-footer-labels span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.weather-footer-values span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== 卡片背面 ========== */
.card-back {
    transform: rotateY(180deg);
    overflow: hidden;
    justify-content: flex-start;
    padding: 20px;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 50%),
                radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.06), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.card-back::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.4;
    animation: patternMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes patternMove {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

.back-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.back-city-name {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0;
    color: var(--text-primary);
}

.location-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.detail-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 60px;
    position: relative;
    isolation: isolate;
    transform: translateZ(0);
}

@media (min-width: 768px) {
    .detail-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.detail-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1.5px;
    background: linear-gradient(135deg,
        rgba(147, 197, 253, 0.8),
        rgba(167, 139, 250, 0.7),
        rgba(249, 168, 212, 0.8)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.detail-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.detail-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    opacity: 0.9;
}

.detail-icon.temp-low {
    color: #7dd3fc;
}

.detail-icon.temp-high {
    color: #f9a8d4;
}

.detail-icon.sunrise {
    color: #fbbf24;
}

.detail-icon.sunset {
    color: #fb923c;
}

.detail-icon.pressure {
    color: #a78bfa;
}

.detail-icon.visibility {
    color: #93c5fd;
}

.detail-icon.cloud {
    color: #cbd5e1;
}

.detail-icon.wind {
    color: #a5b4fc;
}

.sparkle-decoration {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: rotate(0deg) scale(1); }
    50% { opacity: 0.6; transform: rotate(180deg) scale(1.1); }
}

/* ========== 卡片按钮 ========== */
.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

@media (hover: hover) {
    .delete-btn {
        opacity: 0;
    }

    .card:hover .delete-btn {
        opacity: 1;
    }

    .delete-btn:hover {
        background: var(--accent-red);
        color: white;
    }
}

@media (hover: none) {
    .delete-btn {
        opacity: 0.7;
    }
}

.card-refresh-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

@media (hover: hover) {
    .card-refresh-btn {
        opacity: 0;
    }

    .card:hover .card-refresh-btn {
        opacity: 1;
    }

    .card-refresh-btn:hover {
        background: var(--accent-blue);
        color: white;
    }
}

@media (hover: none) {
    .card-refresh-btn {
        opacity: 0.7;
    }
}

.card-refresh-btn.spinning {
    animation: spinBtn 0.8s linear infinite;
}

@keyframes spinBtn {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 骨架卡片样式 ========== */
.skeleton-card .card-face {
    background: var(--card-bg);
}

.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.skeleton-city {
    width: 80px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.skeleton-desc {
    width: 60px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    margin-top: 8px;
}

.skeleton-temp {
    width: 70px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.skeleton-icon {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.skeleton-footer-item {
    width: 40px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.skeleton-footer-value {
    width: 35px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ========== 页脚表单 ========== */
footer {
    text-align: center;
}

.add-city-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.city-input {
    padding: 12px 20px;
    font-size: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    min-width: 240px;
    transition: all 0.25s ease;
    font-family: inherit;
}

.city-input::placeholder {
    color: var(--text-muted);
}

.city-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(91, 156, 255, 0.25);
}

.add-btn {
    background: var(--accent-green);
    border: none;
    color: #0a1628;
    padding: 12px 24px;
    font-size: 0.9375rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    font-family: inherit;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.4);
}

/* ========== 模态框 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.22));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 18px 22px;
    max-width: 280px;
    width: 85%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    text-align: center;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

@keyframes modalIn {
    from { transform: scale(0.9) translateY(-10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.modal p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 0.8125rem;
}

.modal p strong {
    color: #FF6B6B;
    font-weight: 600;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.modal-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-family: inherit;
    min-width: 70px;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.modal-btn-confirm:active {
    transform: translateY(0);
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ========== 加载和错误状态 ========== */
.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 60px 20px;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.error {
    color: var(--accent-red);
    text-align: center;
    font-weight: 500;
    padding: 20px;
}

.card-wrapper.refreshing .card {
    pointer-events: none;
}

.refresh-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 100;
    display: none;
}

.card-wrapper.refreshing .refresh-indicator {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== 助手提示 ========== */
.helper-container {
    position: fixed;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.helper-boy-container {
    right: -65px;
    top: 80px;
}

.helper-boy-container.active {
    right: 20px;
}

.helper-girl-container {
    left: -65px;
    bottom: 80px;
}

.helper-girl-container.active {
    left: 20px;
}

.helper-avatar-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    animation: helperBreathing 3s ease-in-out infinite;
}

.helper-container.active .helper-avatar-wrapper {
    animation: none;
}

@keyframes helperBreathing {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.4);
        transform: scale(1);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.8);
        transform: scale(1.05);
    }
}

.helper-boy-wrapper {
    background: linear-gradient(135deg, #5b9cff, #7dd3fc, #93c5fd);
    box-shadow: 0 4px 20px rgba(91, 156, 255, 0.4);
}

@keyframes boyBreathing {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(91, 156, 255, 0.3);
    }
    50% {
        box-shadow: 0 6px 28px rgba(91, 156, 255, 0.6);
    }
}

.helper-boy-container:not(.active) .helper-boy-wrapper {
    animation: helperBreathing 3s ease-in-out infinite, boyBreathing 3s ease-in-out infinite;
}

.helper-boy-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(91, 156, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
}

.helper-girl-wrapper {
    background: linear-gradient(135deg, #f9a8d4, #fbcfe8, #fce7f3);
    box-shadow: 0 4px 20px rgba(249, 168, 212, 0.4);
}

@keyframes girlBreathing {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(249, 168, 212, 0.3);
    }
    50% {
        box-shadow: 0 6px 28px rgba(249, 168, 212, 0.6);
    }
}

.helper-girl-container:not(.active) .helper-girl-wrapper {
    animation: helperBreathing 3s ease-in-out infinite, girlBreathing 3s ease-in-out infinite;
}

.helper-girl-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(249, 168, 212, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
}

.helper-avatar-wrapper:active {
    transform: scale(0.95);
}

.helper-avatar {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    object-fit: contain;
}

.helper-tip {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 12px;
    color: #2c3e50;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.helper-boy-container .helper-tip {
    right: 90px;
}

.helper-boy-container .helper-tip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid rgba(255, 255, 255, 0.95);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.helper-girl-container .helper-tip {
    left: 90px;
    transform: translateX(-10px);
}

.helper-girl-container .helper-tip::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 8px solid rgba(255, 255, 255, 0.95);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.helper-container.active .helper-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .helper-boy-container {
        right: -50px;
        top: 60px;
    }

    .helper-boy-container.active {
        right: 10px;
    }

    .helper-girl-container {
        left: -50px;
        bottom: 60px;
    }

    .helper-girl-container.active {
        left: 10px;
    }

    .helper-avatar-wrapper {
        width: 70px;
        height: 70px;
        border-width: 2px;
        padding: 4px;
    }

    .helper-avatar {
        width: 54px;
        height: 54px;
    }

    .helper-tip {
        font-size: 0.75rem;
        padding: 10px 14px;
    }

    .helper-boy-container .helper-tip {
        right: 80px;
    }

    .helper-girl-container .helper-tip {
        left: 80px;
    }
}
