/* ============================================
   一起看球 - 现代化UI样式系统
   设计理念：简洁、现代、友好、运动活力
   ============================================ */

/* CSS变量定义 - 设计系统 */
:root {
    /* 主色调 */
    --primary-color: #1e3a5f;
    --primary-light: #2d5a87;
    --primary-dark: #0f1f33;
    
    /* 强调色 */
    --accent-color: #ff6b35;
    --accent-light: #ff8c5a;
    --accent-dark: #e55a2b;
    
    /* 辅助色 */
    --secondary-color: #4ecdc4;
    --secondary-light: #6eddd6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* 中性色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* 字体 */
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 重置和基础样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-ball {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    display: inline-block;
    margin: 0 5px;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loader-ball:nth-child(1) { animation-delay: -0.32s; }
.loader-ball:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.loader p {
    margin-top: var(--space-md);
    font-size: 14px;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    padding: calc(var(--space-md) + env(safe-area-inset-top));
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-width: 600px;
    margin: 0 auto;
}

/* 全屏适配容器 */
.fullscreen-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    /* iOS安全区域适配 */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* 页面标题 - 移除大标题，改为简约设计 */
.page-header {
    margin-bottom: var(--space-md);
    padding-top: calc(var(--space-md) + env(safe-area-inset-top)); /* 状态栏安全区域 */
}

.page-title {
    display: none; /* 移除大标题，改为导航栏显示 */
}

.page-subtitle {
    display: none; /* 移除小标题 */
}

/* iOS安全区域适配 */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top); /* 为状态栏预留空间 */
    }
    
    /* 为iOS 14+灵动岛预留空间 */
    @media (min-width: 390px) and (min-height: 844px) {
        body {
            padding-bottom: calc(env(safe-area-inset-bottom) + 34px); /* 灵动岛高度 */
        }
    }
    
    /* iPhone X系列刘海屏适配 */
    @media (max-width: 428px) and (min-height: 812px) {
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* 卡片组件 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content {
    padding: var(--space-md);
}

.card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* 列表组件 */
.list {
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: var(--bg-secondary);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.list-item-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-action {
    margin-left: var(--space-md);
}

/* 按钮组件 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(255, 107, 53, 0.39);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-color));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(255, 107, 53, 0.23);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 表单组件 */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) 0;
    padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    text-decoration: none;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    min-width: 64px;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #ff3b30;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.friend-unread-badge {
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-right: var(--space-sm);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* 浮动操作按钮 - iOS安全区域适配 */
.fab {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom)); /* 为全面屏手势区域预留空间 */
    right: var(--space-md);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(255, 107, 53, 0.39);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px 0 rgba(255, 107, 53, 0.23);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* iPhone X系列刘海屏适配 */
@media (max-width: 428px) and (min-height: 812px) {
    .fab {
        bottom: calc(90px + 34px); /* 额外增加刘海屏底部空间 */
        right: calc(var(--space-md) + env(safe-area-inset-right)); /* 右侧避开刘海屏 */
    }
}

/* iPhone 14+灵动岛适配 */
@media (min-width: 390px) and (min-height: 844px) {
    .fab {
        bottom: calc(90px + 34px + env(safe-area-inset-bottom)); /* 灵动岛底部空间 */
        right: var(--space-md); /* 灵动岛在中间，不需要调整 */
    }
}

/* iPad刘海屏适配 */
@media (min-width: 820px) and (max-width: 1024px) and (min-height: 1024px) {
    .fab {
        bottom: calc(90px + 20px); /* iPad刘海屏底部空间 */
        right: var(--space-md);
    }
}

/* 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .fab {
        bottom: calc(90px + env(safe-area-inset-bottom));
        right: var(--space-md);
    }
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
}

.badge-accent {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--bg-secondary), var(--border-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    color: white;
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

/* 通知 */
.notifications {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

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

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    background: #ff6b35 !important;
    border: none !important;
    cursor: pointer !important;
    padding: 8px !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: all var(--transition-fast);
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    position: relative !important;
}

.modal-close:hover {
    background: #e55a2b !important;
    transform: scale(1.1) !important;
}

/* 强制显示模态框关闭按钮 */
.modal-overlay .modal-close {
    background: #ff6b35 !important;
    color: white !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 强制显示模态框footer按钮 */
.modal-footer .btn {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
}

.modal-footer .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-md);
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* 认证页面样式 */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    margin: -16px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-xl);
    margin: 0 auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.logo-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    animation: fadeIn 0.3s ease;
}

.auth-form.hidden {
    display: none;
}

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

/* 签到区域样式 */
.checkin-section {
    text-align: center;
}

.checkin-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.checkin-streak {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.streak-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.streak-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.checkin-status {
    text-align: right;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .main-content {
        padding: calc(var(--space-xl) + env(safe-area-inset-top));
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
        min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

@media (max-width: 767px) {
    .modal-header, .modal-body, .modal-footer {
        padding: var(--space-md);
    }
    
    /* 移动端安全区域适配 */
    .main-content {
        padding-top: calc(var(--space-md) + max(var(--space-md), env(safe-area-inset-top)));
        padding-bottom: calc(100px + max(var(--space-sm), env(safe-area-inset-bottom)));
        min-height: calc(100vh - max(var(--space-md), env(safe-area-inset-top)) - max(var(--space-sm), env(safe-area-inset-bottom)));
    }
    
    .chat-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .fullscreen-container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-header {
        min-height: calc(44px + env(safe-area-inset-top));
        padding-top: calc(var(--space-md) + env(safe-area-inset-top));
    }
    
    .chat-messages {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-input-area {
        padding-bottom: calc(var(--space-md) + max(var(--space-sm), env(safe-area-inset-bottom)));
    }
}

/* 开关按钮样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-normal);
    border-radius: 28px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background-color: var(--accent-color);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* 球队详情样式 */
.team-detail-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
}

.team-detail-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.team-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 14px;
    opacity: 0.9;
}

.team-detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.team-stat-item {
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.team-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
}

.team-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.team-members-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 200px; /* 限制最大高度，约显示2个队员 */
    overflow-y: auto; /* 超出部分滚动查看 */
    padding-right: 8px; /* 为滚动条留出空间 */
}

.team-member-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.team-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.team-member-info {
    flex: 1;
}

.team-member-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.team-member-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.team-member-role.owner {
    color: var(--accent-color);
    font-weight: 600;
}

/* iOS-style Chat Interface */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* 减去底部导航栏高度 */
}

.chat-page-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh; /* 全屏高度 */
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--bg-primary);
}

/* iOS-style Navigation Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-nav-left {
    flex: 0 0 auto;
}

.chat-back-btn {
    background: none;
    border: none;
    color: white;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-nav-center {
    flex: 1;
    text-align: center;
}

.chat-nav-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-nav-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.chat-nav-right {
    flex: 0 0 auto;
}

.chat-nav-btn {
    background: none;
    border: none;
    color: white;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Chat Content Area */
.chat-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* iOS-style Message Input */
.chat-input-container {
    padding: var(--space-md);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: var(--space-xs) var(--space-sm);
}

.chat-input-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-xs);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
}

.chat-input-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.chat-input-btn.send-btn {
    background: var(--primary-color);
    color: white;
}

.chat-input-btn.send-btn:hover {
    background: var(--primary-dark);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: var(--space-sm);
    font-size: 16px;
    outline: none;
    color: var(--text-primary);
}

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

/* Loading Skeleton */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    flex-direction: column;
    gap: var(--space-md);
}

.chat-skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.chat-skeleton-lines {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    width: 200px;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line.short {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* iOS-style Friend Detail */
.friend-chat-ios {
    padding: var(--space-md);
    max-width: 100%;
    margin: 0 auto;
}

.friend-header-ios {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.friend-avatar-ios {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.friend-info-ios {
    flex: 1;
    min-width: 0;
}

.friend-name-ios {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-email-ios {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-since-ios {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* iOS-style Sections */
.invitations-section-ios {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header-ios {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.section-title-ios {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-count-ios {
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.invitations-list-ios {
    max-height: 200px;
    overflow-y: auto;
}

.invitation-item-ios {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.invitation-item-ios:last-child {
    border-bottom: none;
}

.invitation-info-ios {
    flex: 1;
    min-width: 0;
}

.invitation-title-ios {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invitation-time-ios {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invitation-status-ios {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    white-space: nowrap;
}

.invitation-status-ios.status-accepted {
    background: var(--success-color);
    color: white;
}

.invitation-status-ios.status-rejected {
    background: var(--error-color);
    color: white;
}

.invitation-status-ios.status-pending {
    background: var(--warning-color);
    color: white;
}

/* iOS-style Empty States */
.empty-state-ios {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-chat-ios {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

/* iOS-style Chat Messages */
.chat-messages-ios {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.message-ios {
    display: flex;
    margin-bottom: var(--space-md);
}

.message-ios.sent {
    justify-content: flex-end;
}

.message-ios.received {
    justify-content: flex-start;
}

.message-bubble-ios {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.message-ios.sent .message-bubble-ios {
    align-items: flex-end;
}

.message-ios.received .message-bubble-ios {
    align-items: flex-start;
}

.message-content-ios {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    margin-bottom: 2px;
}

.message-ios.sent .message-content-ios {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: var(--radius-xs);
}

.message-ios.received .message-content-ios {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: var(--radius-xs);
}

.message-time-ios {
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 var(--space-xs);
}

/* Simplified Navigation Header */
.chat-header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-simple .chat-nav-left,
.chat-header-simple .chat-nav-right {
    flex: 0 0 auto;
}

.chat-header-simple .chat-nav-center {
    flex: 1;
    text-align: center;
}

.chat-header-simple .chat-nav-title {
    font-size: 17px;
    font-weight: 600;
}

/* Expanded Chat Content */
.chat-content-expanded {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: var(--space-md);
}

/* Replaced Input Area */
.chat-input-replacement {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.chat-input-replacement .chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: var(--space-xs) var(--space-sm);
    max-width: 600px;
    margin: 0 auto;
}

/* Invitation History Modal */
.invitation-history-modal {
    max-height: 80vh;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-page {
        height: calc(100vh - 60px);
    }
    
    .chat-page-fullscreen {
        height: 100vh;
    }
    
    .friend-header-ios {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .friend-info-ios {
        text-align: center;
    }
    
    .message-bubble-ios {
        max-width: 80%;
    }
    
    .chat-content-expanded {
        padding: var(--space-sm);
    }
    
    .chat-input-replacement {
        padding: var(--space-sm);
    }
    
    /* 隐藏聊天页面的底部导航 */
    .chat-page-fullscreen ~ .bottom-nav {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .chat-header-simple {
        padding: var(--space-sm) var(--space-md);
    }
    
    .chat-nav-title {
        font-size: 16px;
    }
    
    .friend-name-ios {
        font-size: 16px;
    }
    
    .message-content-ios {
        font-size: 13px;
    }
    
    .chat-input-replacement .chat-input {
        font-size: 16px;
    }
}

/* 隐藏聊天页面时的底部导航 */
.chat-page-fullscreen-active .bottom-nav {
    display: none !important;
}

/* 聊天页面响应式优化 */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        height: 100dvh;
    }
    
    .chat-header {
        padding: 8px 12px;
        min-height: 44px; /* iOS标准导航栏高度 */
    }
    
    .chat-messages {
        padding: 8px 12px;
        min-height: calc(100vh - 44px - 60px); /* 减去头部和输入区域高度 */
    }
    
    .chat-input-area {
        padding: 8px 12px;
        min-height: 60px; /* 确保输入区域有足够高度 */
    }
    
    .input-container {
        max-width: 100%;
        margin: 0;
    }
    
    .message-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 10px 12px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-bubble {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .chat-username {
        font-size: 16px;
    }
    
    /* 确保模态框在移动端正常显示 */
    .history-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .history-modal-header {
        padding: 12px 16px;
    }
    
    .history-tab {
        padding: 12px 8px;
    }
    
    .tab-content {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 6px 8px;
        min-height: 40px;
    }
    
    .chat-messages {
        padding: 6px 8px;
        min-height: calc(100vh - 40px - 56px);
    }
    
    .chat-input-area {
        padding: 6px 8px;
        min-height: 56px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-bubble {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .chat-username {
        font-size: 15px;
    }
    
    .input-btn, .send-btn {
        width: 36px;
        height: 36px;
    }
    
    .message-input {
        font-size: 16px;
        padding: 8px 10px;
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-container {
        height: 100vh;
    }
    
    .chat-header {
        min-height: 40px;
        padding: 6px 12px;
    }
    
    .chat-messages {
        min-height: calc(100vh - 40px - 50px);
    }
    
    .chat-input-area {
        min-height: 50px;
        padding: 6px 12px;
    }
    
    .message-bubble {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    .chat-input-area {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .chat-messages {
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    }
}

/* 成熟的聊天界面 - iOS标准兼容性优化 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* 使用动态视口高度 */
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--bg-primary);
    overflow: hidden; /* 防止内容溢出 */
    /* 移除容器的padding，避免挤压主内容 */
}

/* 聊天内容包装器 - iOS标准优化 */
.chat-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: none; /* 确保没有最大宽度限制 */
    padding: 0; /* 移除所有内边距 */
    margin: 0; /* 移除所有外边距 */
    /* 移除padding，改为在具体组件上适配安全区域 */
}

/* 聊天头部 - iOS安全区域适配 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    
    /* iOS安全区域适配 */
    padding-top: calc(12px + env(safe-area-inset-top)); /* 原有padding + 状态栏安全区域 */
    padding-left: calc(16px + env(safe-area-inset-left)); /* 原有padding + 刘海屏左侧安全区域 */
    padding-right: calc(16px + env(safe-area-inset-right)); /* 原有padding + 刘海屏右侧安全区域 */
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #ff6b35;
}

.back-btn:hover {
    background-color: #f0f0f0;
}

.chat-user-info {
    display: flex;
    flex-direction: column;
}

.chat-username {
    font-size: 16px;
    font-weight: 600;
    color: #ff6b35;
    line-height: 1.2;
}

.chat-status {
    font-size: 12px;
    color: #52c41a;
    line-height: 1;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #ff6b35;
}

.chat-action-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 聊天消息区域 - iOS安全区域适配 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    background: #171e2b;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 确保flex子元素能正确收缩 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    
    /* iOS安全区域适配 */
    padding-left: calc(16px + env(safe-area-inset-left)); /* 原有padding + 刘海屏左侧安全区域 */
    padding-right: calc(16px + env(safe-area-inset-right)); /* 原有padding + 刘海屏右侧安全区域 */
}

.chat-messages #friendDetailContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 加载动画 */
.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
}

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

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1890ff;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-text {
    font-size: 14px;
    color: #999;
}

/* 消息气泡 */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-bubble {
    background: #1890ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-time {
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

/* 输入区域 - iOS安全区域适配 */
.chat-input-area {
    background: #1e293b;
    border-top: 1px solid #e5e5e5;
    padding: 12px 16px;
    
    /* iOS安全区域适配 */
    padding-bottom: calc(12px + max(34px, env(safe-area-inset-bottom))); /* 原有padding + 灵动岛/底部安全区域 */
    padding-left: calc(16px + env(safe-area-inset-left)); /* 原有padding + 刘海屏左侧安全区域 */
    padding-right: calc(16px + env(safe-area-inset-right)); /* 原有padding + 刘海屏右侧安全区域 */
}

.input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.input-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #666;
    flex-shrink: 0;
}

.input-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fd693612;
    border-radius: 20px;
    padding: 0 12px;
    border: 1px solid #e5e5e5;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: #1890ff;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
    color: #fbfbfb;
}

.message-input::placeholder {
    color: #999;
}

.emoji-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #666;
    margin-left: 4px;
}

.emoji-btn:hover {
    background-color: #e5e5e5;
    color: #333;
}

.send-btn {
    background: #fe6a36;
    border: none;
    /* padding: 8px; */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #40a9ff;
}

.send-btn:active {
    background: #096dd9;
}

/* 空状态 */
.empty-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}

/* 历史模态框 - iOS标准兼容性优化 */
.history-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    
    /* iOS安全区域适配 */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.history-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.history-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* iOS安全区域内容适配 */
    margin-top: calc(44px + env(safe-area-inset-top)); /* iOS导航栏高度 + 安全区域 */
    margin-bottom: calc(max(34px, env(safe-area-inset-bottom)) + 20px); /* 灵动岛/底部安全区域 + 额外空间 */
}

.history-modal-overlay.active .history-modal {
    transform: scale(1);
}

/* 历史模态框头部 */
.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.history-modal-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    margin-bottom: 4px;
    color: white;
}

.history-modal-subtitle {
    font-size: 14px;
    opacity: 0.8;
    color: white;
}

/* 通用模态框白色文字 */
.modal-header {
    color: white;
}

.modal-title {
    color: white;
}

.modal-close {
    color: white;
}

/* 标签页文字颜色 */
.history-tab {
    color: #6c757d;
}

.history-tab.active {
    color: #667eea;
}

.tab-icon {
    color: inherit;
}

.tab-text {
    color: inherit;
}

/* 内容区域文字颜色 */
.tab-content {
    color: #333;
}

.history-empty-state h4 {
    color: #495057;
}

.history-empty-state p {
    color: #6c757d;
}

/* 选项按钮文字 */
.chat-option-btn {
    color: #333;
}

.option-text {
    color: #333;
}

.option-icon {
    color: inherit;
}

/* 删除确认文字 */
.delete-confirmation h4 {
    color: #333;
}

.delete-confirmation p {
    color: #666;
}

.warning-icon {
    color: #ffc107;
}


/* 标签页 */
.history-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.history-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.history-tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.history-tab.active {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.tab-text {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.tab-badge {
    background: #667eea;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.history-tab:not(.active) .tab-badge {
    background: #6c757d;
}

/* 内容区域 */
.history-modal-content {
    flex: 1;
    overflow-y: auto;
    background: #1e293b;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* 空状态 */
.history-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.history-empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.history-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* 邀请卡片 */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invitation-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.invitation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.invitation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.match-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-name {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.vs-separator {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
}

.invitation-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.invitation-status.accepted {
    background: #d4edda;
    color: #155724;
}

.invitation-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

.invitation-status.pending {
    background: #fff3cd;
    color: #856404;
}

.invitation-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-time, .match-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
}

.match-time svg, .match-location svg {
    opacity: 0.6;
}

/* 聊天历史 */
.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-history-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.chat-history-item.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-history-item.sent .message-avatar {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.chat-history-item.sent .message-content {
    text-align: right;
}

.message-text {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
    word-wrap: break-word;
    color: #333;
    border: 1px solid #e9ecef;
}

.chat-history-item.sent .message-text {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
}

/* 底部按钮 */
.history-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.history-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.history-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.history-btn.secondary {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.history-btn.secondary:hover {
    background: #f8f9fa;
}

/* 响应式设计 */

/* 平板端优化 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .chat-content-wrapper {
        padding: 0; /* 移除容器内边距，确保满屏 */
        width: 100%; /* 确保满宽度 */
    }
    
    .team-members-list {
        max-height: 210px; /* 平板端高度，约显示2个队员 */
        overflow-y: auto; /* 超出部分滚动查看 */
        padding-right: 8px; /* 为滚动条留出空间 */
    }
    
    .chat-header {
        padding: 12px 24px; /* 增加头部内边距 */
    }
    
    .chat-messages {
        padding: 20px 24px; /* 增加消息区域内边距 */
    }
    
    .chat-input-area {
        padding: 16px 24px; /* 增加输入区域内边距 */
    }
    
    .message {
        max-width: 70%; /* 平板端稍微减少最大宽度 */
    }
    
    .message-bubble {
        font-size: 15px; /* 平板端稍微增大字体 */
        padding: 10px 14px; /* 增加内边距 */
    }
    
    .chat-username {
        font-size: 17px; /* 平板端增大用户名字体 */
    }
    
    .history-modal {
        width: 85%; /* 平板端稍微减小宽度 */
        max-height: 80vh;
        max-width: 600px; /* 限制最大宽度 */
    }
    
    .history-modal-header {
        padding: 20px 28px; /* 增加平板端头部内边距 */
    }
    
    .history-modal-title h3 {
        font-size: 19px; /* 平板端增大标题字体 */
    }
    
    .history-tab {
        padding: 18px 14px; /* 增加平板端标签页内边距 */
    }
    
    .tab-icon {
        font-size: 20px; /* 平板端增大图标 */
    }
    
    .tab-text {
        font-size: 13px; /* 平板端增大文字 */
    }
    
    .tab-content {
        padding: 24px; /* 增加平板端内容内边距 */
    }
    
    .invitation-card {
        padding: 16px; /* 增加平板端卡片内边距 */
    }
    
    .message-content {
        max-width: 70%; /* 平板端调整消息宽度 */
    }
}

/* 中等屏幕优化 (601px - 768px) - 修复600x951以上尺寸问题 */
@media (min-width: 601px) and (max-width: 768px) {
    .chat-content-wrapper {
        padding: 0; /* 移除内边距，确保满屏显示 */
        width: 100%; /* 确保满宽度 */
        height: 100%;
    }
    
    .team-members-list {
        max-height: 190px; /* 中等屏幕高度，约显示2个队员 */
        overflow-y: auto; /* 超出部分滚动查看 */
        padding-right: 7px; /* 为滚动条留出空间 */
    }
    
    .chat-header {
        padding: 12px 16px; /* 使用标准内边距 */
    }
    
    .chat-messages {
        padding: 16px; /* 使用标准内边距 */
    }
    
    .chat-input-area {
        padding: 12px 16px; /* 使用标准内边距 */
    }
    
    .message {
        max-width: 70%; /* 减少消息宽度，确保在大屏幕上不会过宽 */
    }
    
    .message-bubble {
        font-size: 14px; /* 稍微增大字体，提高可读性 */
        padding: 8px 12px; /* 增加内边距，改善视觉效果 */
    }
    
    .chat-username {
        font-size: 16px; /* 增大用户名字体 */
    }
    
    .history-modal {
        width: 85%; /* 稍微减小模态框宽度 */
        max-height: 85vh; /* 限制最大高度 */
    }
    
    .history-modal-header {
        padding: 18px 24px; /* 增加头部内边距 */
    }
    
    .history-tab {
        padding: 16px 12px; /* 增加标签页内边距 */
    }
    
    .tab-content {
        padding: 20px; /* 增加内容内边距 */
    }
    
    .invitation-card {
        padding: 14px; /* 增加卡片内边距 */
    }
    
    .message-content {
        max-width: 70%; /* 与消息气泡保持一致 */
    }
    
    .input-container {
        gap: 10px; /* 增加输入框间距 */
    }
    
    .input-btn, .send-btn {
        width: 44px; /* 增大按钮尺寸 */
        height: 44px;
    }
    
    .message-input {
        font-size: 15px; /* 增大输入框字体 */
        padding: 12px 16px; /* 增加输入框内边距 */
    }
}

/* 小屏幕手机优化 (≤600px) */
@media (max-width: 600px) {
    .chat-content-wrapper {
        /* padding: 0 16px; 小屏幕减少内边距 - 注释掉以优化iOS兼容性 */
        max-width: none;
    }
    
    .team-members-list {
        max-height: 180px; /* 小屏幕稍微减小高度，约显示2个队员 */
        overflow-y: auto; /* 超出部分滚动查看 */
        padding-right: 6px; /* 为滚动条留出空间 */
    }
    
    .chat-header {
        padding: 10px 16px;
    }
    
    .chat-messages {
        padding: 12px 16px;
    }
    
    .chat-input-area {
        padding: 10px 16px;
    }
    
    .message {
        max-width: 80%;
    }
    
    .message-bubble {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .chat-username {
        font-size: 15px;
    }
    
    .history-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .history-modal-header {
        padding: 16px 20px;
    }
    
    .history-tab {
        padding: 14px 8px;
    }
    
    .tab-content {
        padding: 16px;
    }
    
    .invitation-card {
        padding: 12px;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .input-container {
        gap: 8px;
    }
    
    .input-btn, .send-btn {
        width: 40px;
        height: 40px;
    }
    
    .message-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .day-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 8px;
    }
    
    .day-btn {
        padding: 12px 8px;
    }
    
    .day-emoji {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .day-name {
        font-size: 11px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    
    .emoji-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
        padding: 6px;
    }
    
    .chat-options {
        max-width: 280px;
    }
    
    .chat-option-btn {
        padding: 12px 14px;
    }
    
    .option-icon {
        font-size: 16px;
    }
    
    .option-text {
        font-size: 13px;
    }
}

/* 小屏手机优化 (≤480px) */
@media (max-width: 480px) {
    .chat-header {
        padding: 12px 12px;
    }
    
    .chat-messages {
        padding: 8px;
    }
    
    .chat-input-area {
        padding: 8px 12px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-bubble {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .chat-username {
        font-size: 14px;
    }
    
    .history-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .history-modal-header {
        padding: 12px 16px;
    }
    
    .history-modal-title h3 {
        font-size: 16px;
    }
    
    .history-tab {
        padding: 12px 6px;
    }
    
    .tab-icon {
        font-size: 16px;
    }
    
    .tab-text {
        font-size: 11px;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .invitation-card {
        padding: 10px;
    }
    
    .team-name {
        font-size: 13px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    .message-text {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .history-modal-footer {
        padding: 12px 16px;
    }
    
    .history-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .input-container {
        gap: 6px;
    }
    
    .input-btn, .send-btn {
        width: 36px;
        height: 36px;
    }
    
    .message-input {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .day-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 0 4px;
    }
    
    .day-btn {
        padding: 10px 6px;
        border-radius: 8px;
    }
    
    .day-emoji {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .day-name {
        font-size: 10px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        padding: 0 4px;
    }
    
    .emoji-item {
        width: 35px;
        height: 35px;
        font-size: 18px;
        padding: 4px;
        border-radius: 6px;
    }
    
    .chat-options {
        max-width: 100%;
        margin: 0 16px;
    }
    
    .chat-option-btn {
        padding: 10px 12px;
    }
    
    .option-icon {
        font-size: 14px;
        width: 20px;
    }
    
    .option-text {
        font-size: 12px;
    }
    
    .delete-confirmation {
        padding: 16px;
    }
    
    .warning-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .delete-confirmation h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .delete-confirmation p {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .delete-confirmation-actions {
        gap: 8px;
    }
    
    .btn-danger {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 超小屏优化 (≤320px) */
@media (max-width: 320px) {
    .chat-header {
        padding: 6px 8px;
    }
    
    .chat-messages {
        padding: 6px;
    }
    
    .chat-input-area {
        padding: 6px 8px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-bubble {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .chat-username {
        font-size: 13px;
    }
    
    .day-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .day-btn {
        padding: 8px 4px;
    }
    
    .day-emoji {
        font-size: 16px;
    }
    
    .day-name {
        font-size: 9px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }
    
    .emoji-item {
        width: 30px;
        height: 30px;
        font-size: 16px;
        padding: 3px;
    }
    
    .input-btn, .send-btn {
        width: 32px;
        height: 32px;
    }
    
    .message-input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* iPad 横屏优化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .history-modal {
        width: 80%;
        max-height: 80vh;
        max-width: 600px;
    }
    
    .history-modal-content {
        max-height: 60vh;
    }
    
    .day-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 12px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 10px;
        max-height: 200px;
    }
    
    .chat-options {
        max-width: 400px;
    }
}

/* iPad 竖屏优化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .history-modal {
        width: 90%;
        max-height: 85vh;
        max-width: 500px;
    }
    
    .day-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .day-btn:hover {
        transform: none;
    }
    
    .emoji-item:hover {
        transform: none;
    }
    
    .chat-option-btn:hover {
        transform: none;
    }
    
    .day-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .emoji-item:active {
        transform: scale(0.9);
        transition: transform 0.1s ease;
    }
    
    .chat-option-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .day-emoji, .emoji-item {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .message-text {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 星期选择器样式 */
.day-selector {
    text-align: center;
}

.day-selector-header {
    margin-bottom: 24px;
}

.day-selector-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.day-selector-header p {
    color: #666;
    font-size: 14px;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.day-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.day-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.day-emoji {
    font-size: 24px;
    margin-bottom: 8px;
}

.day-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

/* 表情选择器样式 */
.emoji-picker {
    text-align: center;
}

.emoji-picker-header {
    margin-bottom: 20px;
}

.emoji-picker-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
    padding: 8px;
}

.emoji-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(0.95);
}


/* 日期显示样式 */
.day-display {
    font-size: 18px;
    line-height: 1;
}

/* 夜间模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        /* 夜间模式主色调 */
        --primary-color: #2d5a87;
        --primary-light: #3d6ba7;
        --primary-dark: #1e3a5f;
        
        /* 夜间模式强调色 - 保持橙色但调整亮度 */
        --accent-color: #ff8c5a;
        --accent-light: #ffa573;
        --accent-dark: #ff6b35;
        
        /* 夜间模式辅助色 */
        --secondary-color: #6eddd6;
        --secondary-light: #8eede6;
        --success-color: #34d058;
        --warning-color: #f1a40b;
        --error-color: #ea4a5a;
        
        /* 夜间模式中性色 */
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-card: #21262d;
        --text-primary: #f0f6fc;
        --text-secondary: #8b949e;
        --text-muted: #6e7681;
        --border-color: #30363d;
        
        /* 夜间模式阴影 */
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
    
    /* 夜间模式背景和文字 */
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .fullscreen-container {
        background: var(--bg-primary);
    }
    
    /* 夜间模式卡片 */
    .card {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
    }
    
    .card-header {
        border-bottom-color: var(--border-color);
    }
    
    .card-footer {
        background: var(--bg-secondary);
        border-top-color: var(--border-color);
    }
    
    /* 夜间模式列表 */
    .list-item {
        border-bottom-color: var(--border-color);
    }
    
    .list-item:hover {
        background-color: var(--bg-secondary);
    }
    
    /* 夜间模式表单 */
    .form-input,
    .form-select,
    .form-textarea {
        background: var(--bg-card);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(45, 90, 135, 0.2);
    }
    
    .form-input::placeholder {
        color: var(--text-muted);
    }
    
    /* 夜间模式按钮 */
    .btn-secondary {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .btn-secondary:hover:not(:disabled) {
        background: var(--border-color);
    }
    
    .btn-ghost {
        color: var(--text-secondary);
    }
    
    .btn-ghost:hover:not(:disabled) {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    /* 夜间模式底部导航 */
    .bottom-nav {
        background: var(--bg-card);
        border-top-color: var(--border-color);
    }
    
    /* 夜间模式模态框 */
    .modal-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .modal {
        background: var(--bg-card);
    }
    
    .modal-header {
        border-bottom-color: var(--border-color);
    }
    
    .modal-footer {
        border-top-color: var(--border-color);
    }
    
    /* 夜间模式统计卡片 */
    .stat-card {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
    
    .stat-value {
        color: var(--accent-color); /* 保持橙色数字 */
    }
    
    .streak-number {
        color: var(--accent-color); /* 保持橙色数字 */
    }
    
    .team-stat-value {
        color: var(--accent-color); /* 保持橙色数字 */
    }
    
    /* 夜间模式标签 */
    .badge-primary {
        background: rgba(255, 140, 90, 0.2);
        color: var(--accent-color);
    }
    
    .badge-accent {
        background: rgba(255, 140, 90, 0.2);
        color: var(--accent-color);
    }
    
    /* 夜间模式英雄区域 */
    .hero {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    }
    
    /* 夜间模式通知 */
    .notification {
        background: var(--bg-card);
        border-left-color: var(--border-color);
    }
    
    /* 夜间模式空状态 */
    .empty-state-icon {
        background: linear-gradient(135deg, var(--bg-secondary), var(--border-color));
    }
    
    .empty-state-icon svg {
        color: var(--text-muted);
    }
    
    .empty-state-title {
        color: var(--text-primary);
    }
    
    .empty-state-description {
        color: var(--text-secondary);
    }
    
    /* 夜间模式开关 */
    .switch-slider {
        background-color: var(--border-color);
    }
    
    .switch input:checked + .switch-slider {
        background-color: var(--accent-color);
    }
    
    .switch-slider:before {
        background-color: white;
    }
    
    /* 夜间模式球队详情 */
    .team-detail-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    }
    
    .team-stat-item {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
    
    .team-member-item {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
    
    .team-member-role.owner {
        color: var(--accent-color);
    }
    
    /* 夜间模式聊天界面 */
    .chat-header {
        background: linear-gradient(135deg, #1e293b, #282828);
    }
    
    .chat-content {
        background: var(--bg-primary);
    }
    
    .chat-input-container {
        background: var(--bg-card);
        border-top-color: var(--border-color);
    }
    
    .chat-input-wrapper {
        background: var(--bg-secondary);
    }
    
    .chat-input {
        color: var(--text-primary);
    }
    
    .chat-input::placeholder {
        color: var(--text-muted);
    }
    
    .chat-input-btn {
        color: var(--text-secondary);
    }
    
    .chat-input-btn:hover {
        background-color: var(--bg-hover);
        color: var(--text-primary);
    }
    
    .chat-input-btn.send-btn {
        background: var(--primary-color);
        color: white;
    }
    
    /* 夜间模式消息 */
    .message-ios.received .message-content-ios {
        background: var(--bg-card);
        color: var(--text-primary);
        border-bottom-left-radius: var(--radius-xs);
    }
    
    .message-ios.sent .message-content-ios {
        background: var(--primary-color);
        color: white;
        border-bottom-right-radius: var(--radius-xs);
    }
    
    .message-time-ios {
        color: var(--text-muted);
    }
    
    /* 夜间模式历史模态框 */
    .history-modal {
        background: var(--bg-card);
    }
    
    .history-modal-header {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
    }
    
    .history-tabs {
        background: var(--bg-secondary);
        border-bottom-color: var(--border-color);
    }
    
    .history-tab {
        color: var(--text-secondary);
    }
    
    .history-tab:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .history-tab.active {
        background: var(--bg-card);
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }
    
    .tab-content {
        background: var(--bg-card);
        color: var(--text-primary);
    }
    
    .invitation-card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .chat-history-item.sent .message-text {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .chat-history-item.received .message-text {
        background: var(--bg-card);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .history-modal-footer {
        background: var(--bg-secondary);
        border-top-color: var(--border-color);
    }
    
    .history-btn.secondary {
        background: var(--bg-card);
        color: var(--text-secondary);
        border-color: var(--border-color);
    }
    
    .history-btn.secondary:hover {
        background: var(--bg-secondary);
    }
    
    /* 夜间模式选项 */
    .chat-option-btn {
        color: var(--text-primary);
    }
    
    /* 夜间模式删除确认 */
    .delete-confirmation h4 {
        color: var(--text-primary);
    }
    
    .delete-confirmation p {
        color: var(--text-secondary);
    }
    
    /* 夜间模式星期选择器 */
    .day-btn {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
    
    .day-btn:hover {
        border-color: var(--primary-color);
        background: var(--bg-secondary);
    }
    
    .day-name {
        color: var(--text-primary);
    }
    
    .day-selector-header h4 {
        color: var(--text-primary);
    }
    
    .day-selector-header p {
        color: var(--text-secondary);
    }
    
    /* 夜间模式表情选择器 */
    .emoji-picker-header h4 {
        color: var(--text-primary);
    }
    
    .emoji-item {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
    
    .emoji-item:hover {
        background: var(--bg-secondary);
        border-color: var(--primary-color);
    }
    
    /* 夜间模式滚动条 */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .day-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .day-btn {
        padding: 12px 8px;
    }
    
    .day-emoji {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .day-name {
        font-size: 11px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    
    .emoji-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
        padding: 6px;
    }
    
    .chat-options {
        max-width: 100%;
    }
}
