/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* ==================== 隐藏工具类 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 注册/登录弹窗 ==================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: linear-gradient(160deg, #1e2a4a 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-logo {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
}

.auth-box h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 22px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 22px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.auth-tab.active {
    background: rgba(102, 126, 234, 0.35);
    color: #fff;
    font-weight: 600;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.auth-form.active {
    display: flex;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.auth-field input {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    border-color: rgba(102, 126, 234, 0.7);
    background: rgba(102, 126, 234, 0.08);
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.field-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

.field-ok {
    font-size: 12px;
    color: #2ed573;
}

.field-error {
    font-size: 12px;
    color: #ff6b6b;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 4px;
}

.auth-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-cancel {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.auth-cancel:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.auth-notice {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin-top: 4px;
}

.preset-hint {
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
}

/* auth-overlay 右上角关闭按钮 */
.auth-overlay-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.auth-overlay-close:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* ==================== PC端左侧边栏 ==================== */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 18px 16px 14px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    overflow: hidden;          /* 禁止侧边栏滚动 */
}

.sidebar-header {
    text-align: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.logo {
    font-size: 34px;
    margin-bottom: 6px;
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.sidebar-nav .nav-icon {
    font-size: 17px;
}

.sidebar-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-stats .stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-stats .stat-item:last-child {
    border-bottom: none;
}

.sidebar-stats .stat-value {
    display: inline;
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
}

.sidebar-stats .stat-label {
    font-size: 12px;
    opacity: 0.7;
    order: -1;          /* 标签在左，数字在右 */
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px;
    padding-bottom: 100px;
    min-width: 0;
    width: calc(100% - 280px);
}

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

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.date-display {
    font-size: 14px;
    opacity: 0.7;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ==================== 比赛卡片网格 ==================== */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.match-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.match-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.match-card.voted {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    opacity: 0.8;
}

.match-group-tag {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 12px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.match-time {
    color: #ffd700;
    font-weight: 500;
}

.match-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.match-status.upcoming {
    background: rgba(102, 126, 234, 0.3);
    color: #a8b4ff;
}

.match-status.live {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

.match-status.ended {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
}

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

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

.team-brief {
    text-align: center;
    flex: 1;
}

.team-flag {
    font-size: 40px;
    margin-bottom: 8px;
}

.team-name {
    font-size: 15px;
    font-weight: 500;
}

.vs {
    font-size: 13px;
    opacity: 0.5;
    padding: 0 15px;
}

.vote-preview {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vote-bar-mini {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.vote-bar-mini .home {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.vote-bar-mini .draw {
    background: linear-gradient(90deg, #ffd700, #ffed4a);
}

.vote-bar-mini .away {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
}

.vote-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* 卡片底部：去投票 CTA */
.card-vote-cta {
    margin-top: 14px;
    padding: 9px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #ffd700;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.3px;
    opacity: 0.9;
}

/* 卡片底部：已投票标志（进行中/即将开始） */
.card-voted-badge {
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #52e06a;
    font-weight: 600;
}

/* 卡片底部：已结束猜中/猜错 */
.card-result-badge {
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}
.card-result-badge.correct {
    color: #52e06a;
    background: rgba(82, 224, 106, 0.12);
}
.card-result-badge.wrong {
    color: #ff7b7b;
    background: rgba(255, 123, 123, 0.12);
}
.card-result-badge.voted {
    color: #adb5d0;
    background: rgba(173, 181, 208, 0.1);
}

/* 暂无投票数据提示 */
.vote-empty-tip {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.45;
    text-align: center;
}

/* ==================== 比赛详情页 ==================== */
.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.match-group {
    margin-left: 20px;
    font-size: 16px;
    opacity: 0.8;
}

.match-detail-container {
    width: 100%;
    max-width: 100%;
}

.match-card-detail {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.match-card-detail .match-time {
    font-size: 16px;
    margin-bottom: 25px;
}

.teams-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.team {
    text-align: center;
}

.team .team-flag {
    font-size: 64px;
    margin-bottom: 15px;
}

.team .team-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.team .team-rank {
    font-size: 13px;
    opacity: 0.6;
}

.vs-text {
    font-size: 24px;
    font-weight: 700;
    opacity: 0.5;
}

.detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 投票区域 */
.voting-section, .vote-result-section, .bottle-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.voting-section h3, .vote-result-section h3, .bottle-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.vote-buttons {
    display: flex;
    gap: 12px;
}

.vote-btn {
    flex: 1;
    padding: 18px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vote-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.vote-btn.vote-home:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.3);
}

.vote-btn.vote-draw:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.vote-btn.vote-away:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
}

.team-flag-small {
    font-size: 28px;
}

/* 投票统计 */
.vote-stats {
    margin-bottom: 15px;
}

.vote-bar-container {
    margin-bottom: 18px;
}

.vote-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 15px;
}

.vote-bar {
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    border-radius: 14px;
    transition: width 0.5s ease;
}

.vote-bar-fill.home {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.vote-bar-fill.draw {
    background: linear-gradient(90deg, #ffd700, #ffed4a);
}

.vote-bar-fill.away {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
}

.vote-count {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 5px;
}

.my-vote {
    text-align: center;
    padding: 12px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 15px;
}

/* 漂流瓶列表 */
.bottle-list {
    max-height: 300px;
    overflow-y: auto;
}

.bottle-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
}

.bottle-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.bottle-type-tag {
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.3);
}

.bottle-item-content {
    font-size: 15px;
    line-height: 1.6;
}

.empty-tip {
    text-align: center;
    opacity: 0.5;
    padding: 30px;
    font-size: 14px;
}

/* ==================== 漂流瓶页面 ==================== */
.bottle-page-container {
    width: 100%;
    max-width: 100%;
}

.ocean-animation {
    height: 250px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f3460 100%);
    border-radius: 20px;
    margin-bottom: 30px;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23667eea' fill-opacity='0.3' d='M0,160L48,170.7C96,181,192,203,288,192C384,181,480,139,576,138.7C672,139,768,181,864,186.7C960,192,1056,160,1152,144C1248,128,1344,128,1392,128L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    animation: wave 10s linear infinite;
}

.wave2 {
    animation-delay: -5s;
    opacity: 0.5;
}

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

.bottles-floating {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 40px;
}

.floating-bottle {
    font-size: 50px;
    animation: float 3s ease-in-out infinite;
}

.floating-bottle:nth-child(2) {
    animation-delay: -1s;
}

.floating-bottle:nth-child(3) {
    animation-delay: -2s;
}

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

.bottle-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.throw-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.pick-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
}

.btn-icon {
    display: block;
    font-size: 40px;
    margin-bottom: 12px;
}

.btn-text {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.btn-desc {
    display: block;
    font-size: 13px;
    opacity: 0.7;
}

.my-bottles-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
}

.my-bottles-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* ==================== 个人中心 ==================== */
.profile-container {
    width: 100%;
    max-width: 100%;
}

.profile-card {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-radius: 20px;
    margin-bottom: 30px;
}

.avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    margin: 0 auto 20px;
}

.username {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.user-level {
    font-size: 15px;
    opacity: 0.7;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stats-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.stats-icon {
    font-size: 32px;
}

.stats-number {
    font-size: 28px;
    font-weight: 700;
    color: #ffd700;
}

.stats-label {
    font-size: 13px;
    opacity: 0.7;
}

.achievements-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
}

.achievements-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.achievement {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement.locked {
    opacity: 0.5;
}

.achievement.unlocked {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid #ffd700;
}

.achievement-icon {
    display: block;
    font-size: 36px;
    margin-bottom: 10px;
}

.achievement-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-desc {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

/* ==================== 移动端底部导航 ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.bottom-nav .nav-item {
    background: none;
    border: none;
    color: #fff;
    opacity: 0.6;
    cursor: pointer;
    padding: 5px 20px;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item.active {
    opacity: 1;
}

.bottom-nav .nav-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 4px;
}

.bottom-nav .nav-text {
    display: block;
    font-size: 12px;
}

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

.bottle-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.bottle-type {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 15px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.bottle-type:hover, .bottle-type.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.type-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
}

.type-name {
    display: block;
    font-size: 13px;
}

textarea {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-size: 15px;
    resize: none;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.char-count {
    text-align: right;
    font-size: 13px;
    opacity: 0.6;
    margin-top: 8px;
}

.match-select {
    margin-top: 20px;
}

.match-select label {
    display: block;
    font-size: 15px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.match-select select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
}

.match-select select option {
    background: #1a1a2e;
}

.modal-footer {
    padding: 25px;
    display: flex;
    gap: 12px;
}

.submit-btn, .secondary-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 收到的瓶子 */
.picked-bottle {
    text-align: center;
}

.bottle-animation {
    font-size: 70px;
    margin-bottom: 25px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.bottle-content-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    text-align: left;
}

.bottle-type-badge {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 15px;
}

.bottle-content-display p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.bottle-meta {
    font-size: 13px;
    opacity: 0.6;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

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

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* 隐藏PC侧边栏 */
    .sidebar {
        display: none;
    }
    
    /* 显示移动端底部导航 */
    .bottom-nav {
        display: flex;
    }
    
    /* 主内容区适配 */
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
        padding-bottom: 90px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 20px;
    }
    
    /* 比赛卡片 */
    .match-grid {
        grid-template-columns: 1fr;
    }
    
    .team-flag {
        font-size: 32px;
    }
    
    .team-name {
        font-size: 14px;
    }
    
    /* 比赛详情 */
    .match-card-detail {
        padding: 25px;
    }
    
    .team .team-flag {
        font-size: 48px;
    }
    
    .team .team-name {
        font-size: 18px;
    }
    
    .vs-text {
        font-size: 18px;
    }
    
    /* 漂流瓶页面 */
    .bottle-actions {
        grid-template-columns: 1fr;
    }
    
    .ocean-animation {
        height: 180px;
    }
    
    /* 个人中心 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-card {
        padding: 18px;
    }
    
    .stats-number {
        font-size: 22px;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 弹窗 */
    .modal-content {
        max-width: 100%;
        margin: 10px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .vote-buttons {
        flex-direction: column;
    }

    .vote-btn {
        flex-direction: row;
        justify-content: center;
    }

    .bottle-types {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stats-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* ==================== 海洋漂流瓶计数徽章 ==================== */
.ocean-count-badge {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
}

.ocean-count-badge strong {
    color: #ffd700;
    font-size: 16px;
}

/* ==================== 侧边栏用户区 & 账号操作 ==================== */
.sidebar-user {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    overflow: hidden;
}

.sidebar-user-info span:first-child {
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-user-info span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.user-action-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
}

.user-action-btn.danger {
    color: #ff8585;
    border-color: rgba(255,100,100,0.18);
}

.user-action-btn.danger:hover {
    background: rgba(255,80,80,0.14);
    color: #ff5c5c;
}

/* ==================== 个人中心账号操作按钮组 ==================== */
.profile-account-actions {
    display: none; /* 默认隐藏，移动端显示 */
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
    max-width: 260px;
}

.profile-action-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.profile-action-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.profile-action-btn.danger {
    color: #ff8585;
    border-color: rgba(255,100,100,0.25);
}

.profile-action-btn.danger:hover {
    background: rgba(255,80,80,0.15);
}

@media (max-width: 768px) {
    .profile-account-actions {
        display: flex;
    }
}

/* ==================== 投票预测结果展示 ==================== */
.predict-result {
    margin-top: 12px;
}

.predict-correct {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(46, 213, 115, 0.1));
    border: 1px solid rgba(46, 213, 115, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    color: #2ed573;
    font-size: 14px;
    animation: pulse-green 0.6s ease;
}

.predict-wrong {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ff6b6b;
    font-size: 14px;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); opacity: 0.6; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==================== 重新投票按钮 ==================== */
.vote-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.vote-result-header h3 {
    margin-bottom: 0;
}

.revote-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 214, 0, 0.12);
    border: 1px solid rgba(255, 214, 0, 0.35);
    color: #ffd600;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.revote-btn:hover {
    background: rgba(255, 214, 0, 0.22);
    transform: scale(1.03);
}

/* ==================== 漂流瓶回复弹窗内的回复条目 ==================== */
.reply-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

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

.reply-avatar {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.reply-content-wrap {
    flex: 1;
    min-width: 0;
}

.reply-nickname {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    display: block;
    margin-bottom: 4px;
}

.reply-text {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    word-break: break-word;
    margin: 0 0 4px 0;
}

.reply-time {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

/* ==================== 回复数徽章 ==================== */
.reply-count-badge {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}

/* ==================== 比赛详情页-得分显示优化 ==================== */
.match-result-badge {
    background: linear-gradient(135deg, #ffd700, #ff9500);
    color: #1a1a2e;
    font-size: 22px;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: 20px;
    margin-top: 6px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}

/* ==================== 漂流瓶海洋区域布局修正 ==================== */
.ocean-animation {
    position: relative;
}

/* ==================== 让 sidebar 底部正确布局 ==================== */
.sidebar {
    overflow-y: auto;
}

.sidebar-nav {
    flex: 1;
}

/* ==================== 移动端：隐藏侧边栏用户操作，profile页已有 ==================== */
@media (max-width: 768px) {
    .sidebar-user {
        display: none;
    }
}

/* ==================== 漂流瓶回复弹窗：瓶子原文区块 ==================== */
.bottle-origin-block {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
}

.bottle-origin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bottle-origin-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.bottle-origin-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0 0 6px 0;
    word-break: break-word;
}

.bottle-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
}

.replies-divider {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 0 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.vs-center {
    text-align: center;
    padding: 0 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ==================== 移动端全面适配修正 ==================== */

/* 防止任何元素撑破视口宽度 */
*, *::before, *::after {
    max-width: 100%;
}
img, video, canvas, svg { max-width: 100%; }

/* 修正 main-content 在移动端的宽度残留 */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px 14px 90px !important;
        overflow-x: hidden;
    }

    /* 页头：标题+日期竖排 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 18px;
    }
    .page-header h2 { font-size: 20px; }
    .date-display { font-size: 12px; }

    /* 比赛卡片：单列 */
    .match-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .match-card { padding: 16px; }
    .match-header { font-size: 12px; }
    .team-flag { font-size: 30px; margin-bottom: 6px; }
    .team-name { font-size: 13px; }
    .match-score { font-size: 20px; }

    /* 比赛详情页 */
    .detail-header { margin-bottom: 16px; }
    .back-btn { font-size: 13px; padding: 8px 14px; }
    .match-group { font-size: 13px; margin-left: 10px; }

    .match-card-detail {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 16px;
    }
    .match-card-detail .match-time { font-size: 13px; margin-bottom: 16px; }

    /* 队伍展示：三栏保持横排，收窄间距 */
    .teams-display {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    .team { flex: 1; }
    .team .team-flag { font-size: 44px; margin-bottom: 10px; }
    .team .team-name { font-size: 15px; }
    .team .team-rank { font-size: 11px; }
    .vs-text { font-size: 16px; }
    .vs-center { text-align: center; padding: 0 4px; flex-shrink: 0; }
    .match-result-badge { font-size: 16px; padding: 4px 10px; }

    /* 详情双列 → 单列 */
    .detail-columns {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 投票区 */
    .voting-section, .vote-result-section, .bottle-section {
        padding: 18px 16px;
        border-radius: 14px;
    }
    .voting-section h3, .vote-result-section h3, .bottle-section h3 {
        font-size: 16px;
        margin-bottom: 14px;
    }
    .vote-buttons { gap: 8px; }
    .vote-btn { padding: 14px 10px; font-size: 14px; }
    .team-flag-small { font-size: 22px; }

    /* 漂流瓶 */
    .ocean-animation { height: 160px; margin-bottom: 20px; }
    .floating-bottle { font-size: 36px; }
    .bottle-actions {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    .action-btn { padding: 20px 12px; border-radius: 14px; }
    .btn-icon { font-size: 30px; margin-bottom: 8px; }
    .btn-text { font-size: 15px; }
    .btn-desc { font-size: 12px; }
    .my-bottles-section { padding: 18px 16px; border-radius: 14px; }

    /* 个人中心 */
    .profile-card { padding: 28px 20px; border-radius: 16px; }
    .avatar { width: 80px; height: 80px; font-size: 40px; }
    .username { font-size: 20px; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stats-card { padding: 16px 12px; gap: 10px; border-radius: 14px; }
    .stats-icon { font-size: 26px; }
    .stats-number { font-size: 22px; }
    .stats-label { font-size: 12px; }
    .achievements-section { padding: 18px 16px; }
    .achievements-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .achievement { padding: 14px; }

    /* 弹窗全屏化 */
    .modal { padding: 0; align-items: flex-end; }
    .modal-content {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }
    .modal-header { padding: 18px 20px; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 16px 20px; }

    /* 底部导航激活色 */
    .bottom-nav .nav-item.active .nav-icon,
    .bottom-nav .nav-item.active .nav-text {
        color: #ffd700;
    }
    .bottom-nav .nav-item.active {
        opacity: 1;
    }
    .bottom-nav { padding: 10px 0 max(10px, env(safe-area-inset-bottom)); }
}

/* 超小屏（≤390px，如 iPhone SE / 13 mini） */
@media (max-width: 390px) {
    .main-content { padding: 12px 10px 88px !important; }
    .match-card { padding: 14px 12px; }
    .team .team-flag { font-size: 36px; }
    .team .team-name { font-size: 13px; }
    .vote-btn { padding: 12px 6px; font-size: 13px; }
    .bottle-actions { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-vote-cta { font-size: 12px; }
}
