/* 重置和基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-cyan: #00FFFF;
    --primary-purple: #FF00FF;
    --primary-green: #00FF88;
    --accent-blue: #00D4FF;
    --accent-orange: #FF6B35;
    --bg-dark: #0A0A0F;
    --bg-darker: #050508;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* 全屏容器 */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 动态背景层 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 增强的矩阵背景 */
.matrix-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(0, 255, 255, 0.1) 25%, rgba(0, 255, 255, 0.1) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.1) 75%, rgba(0, 255, 255, 0.1) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 255, 255, 0.1) 25%, rgba(0, 255, 255, 0.1) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.1) 75%, rgba(0, 255, 255, 0.1) 76%, transparent 77%, transparent),
        radial-gradient(circle at 25% 25%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
    background-size: 50px 50px, 50px 50px, 200px 200px, 200px 200px;
    animation: matrix-move 15s linear infinite, matrix-pulse 8s ease-in-out infinite;
}

@keyframes matrix-move {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 50px); }
}

@keyframes matrix-pulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.15; }
}

/* 增强的粒子效果 */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particles::before,
.particles::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
}

.particles::before {
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.3) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.3) 0%, transparent 20%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 136, 0.2) 0%, transparent 15%),
        radial-gradient(circle at 70% 20%, rgba(0, 212, 255, 0.2) 0%, transparent 15%);
    animation: particle-float 20s ease-in-out infinite;
    filter: blur(1px);
}

.particles::after {
    background:
        radial-gradient(circle at 60% 40%, rgba(255, 107, 53, 0.2) 0%, transparent 18%),
        radial-gradient(circle at 30% 60%, rgba(0, 255, 255, 0.25) 0%, transparent 22%),
        radial-gradient(circle at 85% 50%, rgba(255, 0, 255, 0.15) 0%, transparent 12%);
    animation: particle-float 25s ease-in-out infinite reverse;
    filter: blur(0.5px);
}

@keyframes particle-float {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1) rotate(0deg) translateX(0px);
    }
    33% {
        opacity: 0.25;
        transform: scale(1.2) rotate(120deg) translateX(30px);
    }
    66% {
        opacity: 0.2;
        transform: scale(0.9) rotate(240deg) translateX(-20px);
    }
}

/* 增强的网格覆盖 */
.grid-overlay {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        linear-gradient(rgba(0, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(45deg, rgba(255, 0, 255, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px, 160px 160px, 160px 160px;
    animation: grid-pan 25s linear infinite, grid-pulse 10s ease-in-out infinite;
    filter: blur(0.3px);
}

@keyframes grid-pan {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(80px, 80px) rotate(1deg); }
}

@keyframes grid-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 新增：流动光线效果 */
.bg-layer::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 30%, rgba(0, 255, 255, 0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 0, 255, 0.08) 60%, transparent 80%),
        linear-gradient(90deg, transparent 20%, rgba(0, 255, 136, 0.05) 40%, transparent 60%);
    background-size: 300px 300px, 400px 400px, 200px 200px;
    animation: flow-light 15s linear infinite;
    mix-blend-mode: screen;
}

@keyframes flow-light {
    from { transform: translateX(-300px) translateY(-300px); }
    to { transform: translateX(300px) translateY(300px); }
}

/* 顶部状态栏 */
.top-bar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(180deg, var(--bg-darker) 0%, transparent 100%);
    backdrop-filter: blur(20px);
}

.status-group {
    display: flex;
    gap: 40px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    font-size: 1.5rem;
}

.status-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.status-text span {
    color: var(--primary-cyan);
    font-weight: 600;
}

.time-display {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 1.2rem;
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan);
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    padding: 0 40px 20px;
    position: relative;
    z-index: 10;
}

/* 左侧问题区 */
.question-section {
    display: flex;
    flex-direction: column;
}

.question-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 40px;
    backdrop-filter: blur(25px) saturate(1.2);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(0, 255, 255, 0.1) inset,
        0 0 80px rgba(255, 0, 255, 0.05) inset;
    transition: all 0.4s ease;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 35px 100px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 60px rgba(0, 255, 255, 0.15) inset,
        0 0 100px rgba(255, 0, 255, 0.08) inset;
    border-color: rgba(0, 255, 255, 0.3);
}

.question-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(0, 255, 255, 0.1),
        transparent,
        rgba(255, 0, 255, 0.1),
        transparent
    );
    animation: rotate 20s linear infinite;
    z-index: -1;
}

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

.question-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.question-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-blue));
    color: var(--bg-dark);
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.6rem;
    box-shadow:
        0 15px 40px rgba(0, 255, 255, 0.4),
        0 0 60px rgba(0, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.question-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

.question-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    letter-spacing: -0.5px;
}

/* 二维码区域 */
.qr-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-frame {
    position: relative;
    width: 220px;
    height: 220px;
    background: var(--bg-darker);
    border: 2px solid var(--primary-cyan);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-corners {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary-cyan);
}

.corner.tl {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.corner.tr {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.corner.bl {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.corner.br {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

#qrCode {
    width: 180px;
    height: 180px;
    border-radius: 8px;
}

.scan-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scan-line {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-cyan), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    from { top: 0; }
    to { top: calc(100% - 3px); }
}

.scan-tip {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--primary-cyan);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0); }
}

.vote-url {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', monospace;
    text-align: center;
}

/* 平均选择数 */
.avg-selection {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 20px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
}

.avg-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.avg-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-cyan);
    text-shadow: 0 0 30px var(--primary-cyan);
}

.avg-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 中央词云图区 */
.wordcloud-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wordcloud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wordcloud-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #FF3366;
    border-radius: 20px;
    font-size: 0.9rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #FF3366;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.wordcloud-container {
    flex: 1;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 25px;
    backdrop-filter: blur(30px) saturate(1.3);
    overflow: hidden;
    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 50px rgba(0, 255, 255, 0.08) inset,
        0 0 100px rgba(255, 0, 255, 0.04) inset;
    transition: all 0.4s ease;
}

.wordcloud-container:hover {
    transform: scale(1.01);
    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 70px rgba(0, 255, 255, 0.12) inset,
        0 0 140px rgba(255, 0, 255, 0.06) inset;
    border-color: rgba(0, 255, 255, 0.2);
}

#wordCloudCanvas {
    width: 100%;
    height: 100%;
    min-height: 450px;
}

.hot-topics {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(
        0deg,
        rgba(10, 10, 15, 0.98) 0%,
        rgba(10, 10, 15, 0.85) 40%,
        rgba(10, 10, 15, 0.6) 80%,
        transparent 100%
    );
    border-top: 1px solid rgba(0, 255, 255, 0.4);
    backdrop-filter: blur(15px) saturate(1.1);
}

.hot-title {
    font-size: 1.2rem;
    color: var(--accent-orange);
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-title::before {
    content: '🔥';
    font-size: 1.4rem;
}

#hotRanking {
    list-style: none;
    display: flex;
    gap: 15px;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

#hotRanking::-webkit-scrollbar {
    display: none;
}

#hotRanking li {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    padding: 15px 12px;
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

#hotRanking li:hover {
    background: rgba(255, 107, 53, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

#hotRanking li::before {
    content: attr(data-rank);
    position: absolute;
    top: -12px;
    background: linear-gradient(135deg, var(--accent-orange), #FF6B35);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
}

#hotRanking li .option-name {
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
}

#hotRanking li .vote-count {
    color: var(--primary-cyan);
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* 右上角设置按钮 */
.settings-trigger {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.settings-trigger:hover {
    transform: scale(1.1);
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
    box-shadow: 0 8px 30px rgba(0, 255, 255, 0.3);
}

.settings-icon {
    font-size: 1.5rem;
    color: var(--primary-cyan);
    transition: transform 0.3s ease;
}

.settings-trigger:hover .settings-icon {
    transform: rotate(90deg);
}

/* 浮动控制面板 */
.floating-control-panel {
    position: fixed;
    top: 50%;
    right: -400px;
    transform: translateY(-50%);
    width: 380px;
    max-height: 80vh;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    z-index: 200;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.floating-control-panel.active {
    right: 30px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #FF3366;
    color: #FF3366;
    transform: rotate(90deg);
}

.panel-content {
    padding: 20px 30px 30px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* 控制面板内容样式 */
.switcher-group {
    margin-bottom: 30px;
}

.switcher-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.question-switcher {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.switch-btn {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.switch-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.switch-btn:hover::before {
    left: 100%;
}

.switch-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
    transform: translateX(5px);
    color: var(--primary-cyan);
}

.switch-btn.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 212, 255, 0.2));
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:active::after {
    width: 300px;
    height: 300px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

.action-btn.reset {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 85, 85, 0.1));
    border-color: rgba(255, 107, 53, 0.3);
}

.action-btn.reset:hover {
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.btn-icon {
    font-size: 1.2rem;
}

.shortcuts {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.shortcut-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.shortcut-item:hover {
    color: var(--primary-cyan);
}

kbd {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    color: var(--primary-cyan);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 底部进度条 */
.progress-bar {
    position: relative;
    height: 3px;
    background: var(--glass-border);
    overflow: hidden;
    z-index: 10;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--accent-blue));
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: -25px;
    right: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 响应式调整 */
@media (max-width: 1600px) {
    .main-content {
        grid-template-columns: 320px 1fr 240px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .question-section {
        grid-row: 1;
    }

    .wordcloud-section {
        grid-row: 2;
    }

    .settings-trigger {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .floating-control-panel.active {
        right: 20px;
        width: 320px;
    }
}

/* 词云图容器增强 */
.wordcloud-container {
    flex: 1;
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0;
    backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow:
        0 0 50px rgba(0, 255, 255, 0.1),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

/* CSS词云展示区域 */
.wordcloud-display {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 500px;
    padding: 30px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.02) 0%, transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 词云容器 - 绝对定位布局 */
.wordcloud-container-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 词云占位符 */
.wordcloud-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    animation: placeholderPulse 2s ease-in-out infinite;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.placeholder-text {
    font-size: 1.2rem;
    opacity: 0.5;
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* 词云词语基础样式 - 增强版 */
.word-item {
    position: absolute;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-shadow:
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 30px rgba(0, 255, 255, 0.5);
    backdrop-filter: blur(3px);
    user-select: none;
    transform-origin: center;
    animation: wordFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.3s);
    z-index: var(--z-index); /* 直接使用z-index变量 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 20px rgba(0, 0, 0, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.05);
}

/* 词语悬浮效果 - 增强版 */
.word-item:hover {
    transform: scale(1.3) translateY(-12px) rotate(3deg);
    z-index: 999; /* 悬浮时确保在最高层 */
    filter: brightness(1.5) saturate(1.4);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px currentColor,
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 词语大小级别 - 更明显的层次感 */
.word-size-xs {
    font-size: 0.9rem;
    opacity: 0.6;
    z-index: 10;
}

.word-size-sm {
    font-size: 1.2rem;
    opacity: 0.7;
    z-index: 20;
}

.word-size-md {
    font-size: 1.6rem;
    opacity: 0.85;
    z-index: 30;
}

.word-size-lg {
    font-size: 2.1rem;
    opacity: 1;
    z-index: 40;
    font-weight: 700;
}

.word-size-xl {
    font-size: 2.8rem;
    opacity: 1;
    font-weight: 800;
    z-index: 50;
    filter: drop-shadow(0 0 15px currentColor);
    text-shadow:
        0 0 15px currentColor,
        0 0 30px currentColor,
        0 0 45px rgba(0, 255, 255, 0.6);
}

/* 系统词特殊样式 - 简化版本 */
.system-word {
    position: relative;
    background: rgba(0, 255, 255, 0.1) !important;
    border: 2px solid rgba(0, 255, 255, 0.5) !important;
    animation: systemPulse 4s ease-in-out infinite;
    font-size: inherit !important; /* 确保使用JavaScript设置的字体大小 */
    z-index: 999 !important; /* 确保在最上层 */
}

@keyframes systemPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 词语颜色级别 */
.word-color-1 {
    color: #FF6666;
    background: rgba(255, 102, 102, 0.1);
    border: 1px solid rgba(255, 102, 102, 0.3);
}

.word-color-2 {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.word-color-3 {
    color: #00FF88;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.word-color-4 {
    color: #FF00FF;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.3);
}

.word-color-5 {
    color: #00FFFF;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* 词语浮动动画 - 更复杂的3D运动轨迹 */
@keyframes wordFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
        filter: brightness(1) hue-rotate(0deg);
    }
    25% {
        transform: translateY(-12px) translateX(5px) rotate(2deg) scale(1.02);
        filter: brightness(1.1) hue-rotate(5deg);
    }
    50% {
        transform: translateY(-20px) translateX(-3px) rotate(-1deg) scale(0.98);
        filter: brightness(1.2) hue-rotate(-3deg);
    }
    75% {
        transform: translateY(-10px) translateX(-5px) rotate(1deg) scale(1.01);
        filter: brightness(1.05) hue-rotate(2deg);
    }
}

/* 词语入场动画 - 增强版 */
@keyframes wordFadeIn {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg) translateZ(-100px);
        filter: blur(10px) brightness(2);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(90deg) translateZ(50px);
        filter: blur(2px) brightness(1.5);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg) translateZ(0px);
        filter: blur(0px) brightness(1);
    }
}

/* 新增：词语脉冲动画 */
@keyframes wordPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 0, 0, 0.2),
            inset 0 0 15px rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow:
            0 0 30px currentColor,
            0 0 50px rgba(0, 255, 255, 0.3),
            inset 0 0 25px rgba(255, 255, 255, 0.1);
    }
}

/* 新增：词语呼吸动画 */
@keyframes wordBreathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 为词云词语添加额外的动画层 */
.word-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 25px;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.5s);
}

.word-item:hover::after {
    opacity: 1;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.5;
        transform: translateX(100%);
    }
}

/* 词云整体动画 */
@keyframes wordCloudPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 词语发光效果 */
.word-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, currentColor, transparent);
    border-radius: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(3px);
    z-index: -1;
}

.word-item:hover::before {
    opacity: 0.6;
    animation: glowRotate 2s linear infinite;
}

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

/* 词云图背景效果 */
.wordcloud-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* 弹窗动画 */
@keyframes detailPopup {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes detailFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* 词云加载动画 */
@keyframes wordCloudLoad {
    0% {
        opacity: 0;
        transform: scale(0.95) rotate(1deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02) rotate(-0.5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-cyan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}