/* 用户界面优化样式 - 金茂府：打假风暴 */

/* ========== 现代化设计改进 ========== */

/* 全局样式增强 */
:root {
    --primary-color: #ff4757;
    --secondary-color: #667eea;
    --accent-color: #ffa502;
    --success-color: #2ed573;
    --warning-color: #ff6b35;
    --dark-color: #2f3542;
    --light-color: #f1f2f6;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.25);
    --border-radius: 15px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 毛玻璃效果增强 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-medium);
}

/* 卡片样式现代化 */
.modern-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left var(--transition-slow);
}

.modern-card:hover::before {
    left: 100%;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

/* ========== 动画效果增强 ========== */

/* 淡入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 发光效果 */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

/* 旋转加载动画 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 弹跳动画 */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* 页面加载动画 */
.page-enter {
    animation: fadeInUp 0.6s ease-out;
}

.card-enter {
    animation: fadeInUp 0.4s ease-out;
}

.button-hover {
    transition: all var(--transition-fast);
}

.button-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ========== 增强的点击特效 ========== */

.enhanced-click-effect {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.click-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.points-particle {
    position: absolute;
    font-weight: bold;
    font-size: 1.4rem;
    pointer-events: none;
    animation: particleFloat 1.2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
    }
    50% {
        transform: scale(1.3) translateY(-20px) rotate(10deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px) rotate(-10deg);
    }
}

/* ========== 移动端优化 ========== */

/* 触摸优化 */
.touch-optimized {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-target {
    min-height: 44px; /* iOS推荐的最小触摸目标 */
    min-width: 44px;
    cursor: pointer;
    touch-action: manipulation;
}

/* 移动端响应式布局 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .anger-meter {
        justify-content: center;
        font-size: 1.1rem;
    }
    
    .progress-container {
        width: 100%;
    }
    
    .scenes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .scene-card {
        padding: 20px 15px;
    }
    
    .click-target {
        min-height: 50px;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .comments-section {
        padding: 15px;
    }
    
    .comment-form textarea {
        min-height: 80px;
    }
    
    .tool-btn, .action-btn, .btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
        font-size: 1rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .game-title i {
        margin-right: 5px;
    }
    
    .click-target {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .scene-description {
        font-size: 0.9rem;
    }
    
    .modern-card {
        border-radius: 12px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .game-header {
        padding: 10px 0;
    }
    
    .game-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .scenes-grid {
        gap: 10px;
    }
    
    .scene-card {
        padding: 15px;
    }
}

/* ========== 音效控制按钮 ========== */

.audio-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.audio-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.audio-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.audio-toggle.muted {
    background: rgba(255, 71, 87, 0.7);
}

.audio-toggle.muted:hover {
    background: rgba(255, 71, 87, 0.9);
}

/* ========== 进度指示器增强 ========== */

.enhanced-progress {
    position: relative;
    overflow: hidden;
}

.progress-fill {
    transition: width var(--transition-medium);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========== 通知样式 ========== */

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.notification.success {
    background: var(--success-color);
}

.notification.warning {
    background: var(--warning-color);
}

.notification.error {
    background: var(--primary-color);
}

/* ========== 加载状态优化 ========== */

.loading-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: loadingBounce 1.4s infinite both;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ========== 分享功能样式 ========== */

/* 分享文本编辑容器 */
.editable-text-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 10px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 分享文本输入框 */
.share-text-input {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    color: #333;
    font-size: 14px;
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.5;
    resize: vertical;
    transition: all var(--transition-medium);
    backdrop-filter: blur(5px);
}

.share-text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

.share-text-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
}

/* 分享文本控制区域 */
.text-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.filter-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.filter-btn.has-sensitive {
    background: #ff4757;
    animation: pulse 2s infinite;
}

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

.regenerate-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.regenerate-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 敏感词警告提示样式 */
.sensitive-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

.sensitive-warning.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* 分享图片容器优化 */
#share-image {
    max-width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#share-image canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

/* 分享模态框内容优化 */
.share-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.share-content::-webkit-scrollbar {
    width: 6px;
}

.share-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.share-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.share-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 分享内容文本框优化 */
#share-content {
    width: 100%;
    min-height: 100px;
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    transition: all var(--transition-medium);
}

#share-content:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

/* 分享文本显示区域 */
#share-text {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 排序控件样式 */
.comment-sort-controls {
    margin: 15px 0;
    padding: 0 20px;
}

.sort-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.sort-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sort-btn.active {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
    font-weight: 500;
}

/* 点赞按钮样式优化 */
.comment-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 15px;
    background: transparent;
}

.comment-likes:hover {
    background: rgba(255, 71, 87, 0.1);
}

.comment-likes i {
    font-size: 16px;
    color: #adb5bd;
    transition: all 0.3s ease;
}

.comment-likes.liked i {
    color: #ff4757;
    animation: heartBeat 0.6s ease;
}

.comment-likes .like-count {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

.comment-likes.liked .like-count {
    color: #ff4757;
}

.comment-likes.like-animation {
    transform: scale(1.1);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 加载状态样式 */
.loading-comments {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

.loading-comments::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #dee2e6;
    border-top-color: #ff4757;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .comment-sort-controls {
        padding: 0 10px;
    }
    
    .sort-buttons {
        gap: 8px;
    }
    
    .sort-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 50px;
    }
    
    .comment-likes {
        padding: 3px 6px;
    }
    
    .comment-likes i {
        font-size: 14px;
    }
    
    .comment-likes .like-count {
        font-size: 11px;
    }
}
