/* ================================
   Components.css - 通用组件样式
   ================================ */

/* 内容网格布局 */
.content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 360px;
    align-content: flex-start;
}

.game-grid {
    /* 继承.content-grid的样式 */
}

.news-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: auto;
}

/* 现代化游戏卡片样式 */
.game-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    /* 分层阴影效果 */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: calc(20% - 8px);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card .game-img {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 宽高比 */
    overflow: hidden;
    background-color: #f0f0f0;
}

.game-card .game-img img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    /* 默认设置，会被JavaScript动态调整 */
    object-fit: cover;
    object-position: center;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* 现代化游戏评分标签 */
.game-score {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.game-score:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-score.score-high {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.game-score.score-medium {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.game-score.score-average {
    background: linear-gradient(135deg, #fd7e14, #e74c3c);
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.4);
}

.game-score.score-low {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* 游戏卡片信息区域 */
.game-card-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-card-info h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: break-word;
    hyphens: auto;
}

.game-card-info .game-tags {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}

.game-card-info .game-release-date {
    margin: 0;
    font-size: 11px;
    color: #999;
    margin-top: auto;
}

.game-card .game-title {
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    min-height: 54px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
}

.game-card .game-desc {
    padding: 0 8px 8px;
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

.game-card .game-date {
    padding: 0 8px 8px;
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #777;
    padding: 0 8px 8px;
}

.game-meta .game-author,
.game-meta .game-created-at {
    display: flex;
    align-items: center;
}

.game-meta i {
    margin-right: 4px;
}

/* 新闻卡片样式 */
.news-card {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e9e9e9;
    background-color: #fff;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    transition: background-color 0.2s;
}

.news-card:last-child {
    border-bottom: none;
}

.news-card:hover {
    background-color: #f9f9f9;
    transform: none;
}

.news-card .game-img {
    flex: 0 0 120px;
    height: 80px;
    padding-top: 0;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.news-card .game-img.no-image {
    background-image: none !important;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card .game-img.no-image::after {
    content: '📰';
    font-size: 24px;
    color: #ccc;
}

.news-card .game-img img {
    display: none; /* 隐藏img标签，使用背景图 */
}

.news-card .news-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.news-card .game-title {
    font-size: 17px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    padding: 0;
    min-height: auto;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-card .game-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 6px;
    padding: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-card .news-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.news-author,
.news-date,
.news-author-date {
    display: flex;
    align-items: center;
}

.news-author i,
.news-date i,
.news-author-date i {
    margin-right: 4px;
    margin-left: 8px;
}

/* 抽奖卡片样式 */
.lottery-grid {
    /* 使用.content-grid样式 */
}

.lottery-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    width: calc(25% - 7.5px);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    justify-content: space-between;
    min-height: 150px;
}

.lottery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lottery-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lottery-title {
    font-size: 16px;
    font-weight: bold;
    color: #3366cc;
    margin-bottom: 10px;
    line-height: 1.3;
}

.lottery-prize {
    font-size: 14px;
    color: #495057;
    margin-bottom: 15px;
    flex-grow: 1;
}

.lottery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: auto;
}

.lottery-meta span {
    display: flex;
    align-items: center;
}

.lottery-meta i {
    margin-right: 5px;
}

/* 评分圆圈组件 */
.score-circle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
    stroke-dasharray: 2, 3;
}

.score-circle-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.score-text {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

/* 现代化按钮组件 */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

/* 表单组件 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3366cc;
    box-shadow: 0 0 0 2px rgba(51, 102, 204, 0.2);
}

/* 模态框组件 */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal.show,
.modal.is-open {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close,
.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    float: right;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.modal-close:hover,
.close-button:hover,
.close-button:focus {
    color: #333;
}

/* 认证模态框（登录/注册）*/
.auth-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.auth-modal .modal-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    color: #333;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.modal-content .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content .form-actions {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.modal-content .form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-content .form-actions button[type="submit"] {
    background-color: #3366cc;
    color: white;
}

.modal-content .form-actions button[type="submit"]:hover {
    background-color: #2654a3;
}

.modal-content .form-actions button[type="button"] {
    background-color: #6c757d;
    color: white;
}

.modal-content .form-actions button[type="button"]:hover {
    background-color: #5a6268;
}

.modal-content p {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.modal-content p a {
    color: #3366cc;
    text-decoration: none;
}

.modal-content p a:hover {
    text-decoration: underline;
}

/* 忘记密码弹窗特定样式 */
.forgot-step {
    transition: opacity 0.3s ease;
}

.countdown-text {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modal-content .form-actions button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-content .form-actions button:disabled:hover {
    background-color: #ccc;
}

/* 下拉菜单组件 */
.nav-item.dropdown {
    position: relative;
    padding: 0;
}

.dropdown-toggle {
    cursor: pointer;
    display: block;
    padding: 10px 15px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 0;
    min-width: 160px;
    z-index: 1001;
    border: 1px solid #eee;
}

/* 显示下拉菜单 */
.nav-item.dropdown.open .dropdown-menu {
    display: block;
}

/* 用户下拉菜单显示规则 */
.user-dropdown.open .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
}

/* 用户下拉菜单特殊样式 */
.user-dropdown .dropdown-menu {
    left: auto;
    right: 0;
    min-width: 120px;
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #333;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background-color: #f0f0f0;
    color: #3366cc;
}

/* 未读消息指示器 */
.unread-indicator::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 积分中心样式 */
.points-positive {
    color: #28a745;
    font-weight: bold;
}

.points-negative {
    color: #dc3545;
    font-weight: bold;
}

#points-modal .modal-content {
    max-width: 600px;
    padding: 30px;
}

#points-modal h2 {
    text-align: center;
    margin-bottom: 20px;
}

#points-modal #rewards-section .reward-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

#points-modal .reward-item-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

#points-modal .reward-icon {
    width: 50px;
    height: 50px;
    border-radius: 4px;
}

#points-modal .reward-item p {
    margin: 0;
    font-size: 16px;
}

#points-modal .reward-button {
    background-color: #ff6600;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#points-modal .reward-button:hover {
    background-color: #e65c00;
}

#points-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f2f5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#points-info p {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

#modal-check-in-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

#modal-check-in-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

#modal-check-in-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#rewards-section h3 {
    text-align: center;
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    background: none;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 每日答题样式 */
#daily-quiz-modal .modal-content {
    width: 90%;
    max-width: 600px;
}

#daily-quiz-modal #quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: none;
}

#daily-quiz-modal #question-container {
    margin-bottom: 1rem;
}

#daily-quiz-modal #options-container button {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

#daily-quiz-modal #options-container button:hover {
    background: #e9e9e9;
}

#daily-quiz-modal #timer {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

#daily-quiz-modal #result-container {
    text-align: center;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

#timer {
    font-size: 1.5em;
    font-weight: bold;
    color: #d9534f;
}

#progress {
    font-size: 1em;
    color: #555;
}

#question-container {
    padding: 20px;
    font-size: 1.2em;
    text-align: center;
    min-height: 80px;
}

#options-container {
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-btn {
    padding: 15px;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background-color: #5cb85c;
    color: white;
    border-color: #4cae4c;
}

.option-btn.incorrect {
    background-color: #d9534f;
    color: white;
    border-color: #d43f3a;
}

.quiz-button {
    background-color: #337ab7;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

.quiz-button:hover {
    background-color: #286090;
}