/* 全局禁用文本选择，但保留输入框的选择功能 */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* 允许输入框选择文本 */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.gradient-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gradient-white {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.gradient-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

.nav-active {
    color: #10b981;
    border-bottom: 2px solid #10b981;
}

/* Hero Section with Carousel */
.hero-section {
    position: relative;
    min-height: 500px;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* 宽屏优化 - 避免上下被截断 */
@media (min-width: 1920px) {
    .hero-carousel-item {
        background-size: 100% auto;
        background-position: center center;
    }
    
    .hero-section {
        min-height: 600px;
        max-height: 800px;
    }
}

/* 超宽屏优化 */
@media (min-width: 2560px) {
    .hero-carousel-item {
        background-size: contain;
        background-position: center center;
    }
    
    .hero-section {
        min-height: 700px;
        max-height: 900px;
    }
}

/* 移动端背景图适配 */
@media (max-width: 768px) {
    .hero-carousel-item {
        background-size: cover;
        background-position: center center;
    }
    
    .hero-section {
        min-height: 250px;
    }
    
    /* 减小移动端标题上移量，节省空间 */
    .hero-section h1 {
        margin-top: 0 !important;
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-section p {
        font-size: 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* 减小移动端上下内边距 */
    .hero-section > div:last-child {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* 移动端倒计时调整 */
    .hero-countdown {
        bottom: 10px;
        left: 10px;
        transform: translateX(0);
    }
    
    .hero-countdown .inline-block {
        padding: 6px 10px !important;
    }
    
    .hero-countdown p {
        font-size: 9px !important;
        margin-bottom: 4px !important;
    }
    
    .hero-countdown #countdown > div > div:first-child {
        font-size: 14px !important;
    }
    
    .hero-countdown #countdown > div > div:last-child {
        font-size: 8px !important;
    }
    
    /* 移动端圆点指示器调整 */
    .carousel-indicators-right {
        right: 10px;
        bottom: 10px;
        gap: 6px;
    }
    
    .carousel-indicator {
        width: 6px;
        height: 6px;
    }
}

.hero-carousel-item.active {
    opacity: 1;
}

/* 倒计时 - 底部中间 */
.hero-countdown {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
}

/* 轮播指示器 - 右侧底部（水平） */
.carousel-indicators-right {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 30;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.carousel-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background-color: #10b981;
    border-color: white;
    transform: scale(1.3);
}

.team-card-red {
    border-left: 4px solid #ef4444;
}

.team-card-blue {
    border-left: 4px solid #3b82f6;
}

.team-card-white {
    border-left: 4px solid #6b7280;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #10b981;
    position: absolute;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Mobile Navigation */
.mobile-menu {
    display: none;
}

.mobile-menu.active {
    display: block;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    .mobile-menu-button {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-menu-button {
        display: none;
    }
}

/* Drag and Drop Styles */
.player-card {
    user-select: none;
}

.player-card:active {
    cursor: grabbing !important;
}

.player-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drop-zone-active {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border: 2px dashed #10b981 !important;
    border-radius: 0.75rem;
}

.drop-zone {
    min-height: 100px;
    border: 2px dashed transparent;
    transition: all 0.3s ease;
}

[data-team] {
    transition: all 0.3s ease;
    min-height: 200px;
}

/* 拖拽手势提示 */
.cursor-move {
    cursor: move;
    cursor: grab;
}

.cursor-move:active {
    cursor: grabbing;
}

/* 空队伍拖放提示 */
.drop-zone:hover {
    background-color: rgba(16, 185, 129, 0.05);
}

/* 选秀模式拖拽高亮 */
.drop-zone-highlight {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border: 2px dashed #10b981 !important;
    border-radius: 0.75rem;
}

/* 待分配球员拖拽样式 */
[data-source="pending"][draggable="true"] {
    cursor: grab;
    transition: all 0.2s ease;
}

[data-source="pending"][draggable="true"]:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

[data-source="pending"][draggable="true"]:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* 待分配区域拖拽接收样式 */
#pendingPlayersList.drop-zone-active {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border: 2px dashed #10b981 !important;
    border-radius: 0.75rem;
    padding: 0.5rem;
}

/* Formation Sandbox Styles */
.formation-player {
    user-select: none;
    white-space: nowrap;
}

.formation-player:active {
    cursor: grabbing !important;
}

.formation-field-player {
    user-select: none;
    white-space: nowrap;
    z-index: 10;
    position: absolute;
}

.formation-field-player:active {
    cursor: grabbing !important;
}

#formationField {
    cursor: crosshair;
}

/* Rankings Columns - Vertical Layout */
.rankings-columns {
    column-count: 1;
    column-gap: 1rem;
}

@media (min-width: 768px) {
    .rankings-columns {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .rankings-columns {
        column-count: 3;
    }
}

.rankings-columns > div {
    break-inside: avoid;
    margin-bottom: 1rem;
}

/* Admin Data Columns - Vertical Layout */
.admin-data-columns {
    column-count: 1;
    column-gap: 0.75rem;
}

@media (min-width: 768px) {
    .admin-data-columns {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .admin-data-columns {
        column-count: 3;
    }
}

.admin-data-columns > div {
    break-inside: avoid;
    margin-bottom: 0.75rem;
}

/* Password Protection Styles */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.password-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideUpModal 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.password-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.password-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.password-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

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

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ============= 评论回复功能样式 ============= */

/* 回复列表的层级样式 */
.replies-list {
    background: linear-gradient(to right, #f9fafb 0%, #ffffff 100%);
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* 回复项 */
.reply-item {
    transition: all 0.2s ease;
}

.reply-item:hover {
    background: #f9fafb;
}

/* 回复输入框动画 */
.reply-input {
    animation: slideDown 0.3s ease-out;
}

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

/* 回复按钮悬停效果 */
.comment-item button[onclick^="showReplyInput"] {
    transition: all 0.2s ease;
}

.comment-item button[onclick^="showReplyInput"]:hover {
    transform: translateX(2px);
}

/* 层级缩进视觉优化 */
.replies-list {
    position: relative;
}

.replies-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e5e7eb 0%, transparent 100%);
}

/* 响应式：移动端减少缩进 */
@media (max-width: 640px) {
    .replies-list {
        padding-left: 1.5rem;
    }
}

/* 回复计数器样式 */
.comment-item button[onclick^="showReplyInput"] span {
    transition: all 0.2s ease;
}

.comment-item button[onclick^="showReplyInput"]:hover span {
    font-weight: 600;
}

/* 公告跑马灯样式 */
.announcement-marquee {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.announcement-marquee.scrolling {
    animation: marquee linear infinite;
    animation-duration: var(--marquee-duration, 30s);
    padding-left: 100%; /* 初始位置在右侧容器外 */
}

.announcement-marquee.scrolling:hover {
    animation-play-state: paused;
}

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

/* 当公告内容较短时，不启用跑马灯 */
.announcement-marquee.no-scroll {
    animation: none !important;
    transform: none !important;
    padding-left: 0;
}

