/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题样式 */
.title-icon {
    text-align: center;
    margin-bottom: 10px;
}

.title-icon i {
    color: #e74c3c;
    font-size: 48px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    margin-top: 0;
}

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    animation: fadeIn 0.5s ease-out;
}

.form-group {
    margin-bottom: 0;
}

.form-group label i {
    margin-right: 8px;
    color: #4a6baf;
    width: 16px;
    text-align: center;
}

@media (max-width: 767px) {
    .form-group label i {
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    transition: color 0.3s ease;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
}

input:focus, select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

input:hover, select:hover {
    border-color: #b8b8b8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 按钮样式 */
.primary-button, .secondary-button {
    position: relative;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button {
    background-color: #4a90e2;
    color: white;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-button:hover, .secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.primary-button:hover {
    background-color: #357abd;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

.secondary-button:hover {
    background-color: #5a6268;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.primary-button:active, .secondary-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.primary-button i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.secondary-button i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.primary-button:hover i {
    transform: scale(1.2);
}

.secondary-button:hover i {
    transform: scale(1.2);
}

.primary-button::after, .secondary-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.primary-button:active::after, .secondary-button:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* 结果显示样式 */
.result-card {
    display: block;
    animation: scaleIn 0.5s ease-out;
}

.hidden {
    display: none;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.result-item {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.result-label {
    display: block;
    color: #666;
    font-size: 14px;
}

.result-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.result-value.win {
    color: #28a745;
}

.result-value.lose {
    color: #dc3545;
}

/* 图表容器样式 */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* 统计数据样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
    animation: fadeIn 0.6s ease-out;
}

.stats-item {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stats-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    background-color: #fff;
    border-color: rgba(74, 144, 226, 0.3);
}

.stats-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.stats-label {
    display: block;
    color: #666;
    font-size: 15px;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    font-size: 24px;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    line-height: 1.2;
}

.stats-item:hover .stats-value {
    color: #4a90e2;
    transform: scale(1.05);
}

.stats-trend {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.stats-trend.positive {
    color: #28a745;
}

.stats-trend.negative {
    color: #dc3545;
}

.stats-trend.neutral {
    color: #6c757d;
}

.stats-description {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    line-height: 1.4;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 运势消息样式 */
.fortune-message {
    padding: 20px;
    background-color: #e3f2fd;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #1565c0;
    text-align: center;
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fortune-message::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* 最近游戏记录样式 */
.recent-games {
    margin-top: 20px;
}

.recent-games-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-games-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.game-results {
    margin-top: 8px;
    margin-left: 80px;
    border-left: 2px solid #ddd;
    padding-left: 15px;
}

.game-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.95em;
    color: #666;
}

.game-result-item.win {
    color: #28a745;
}

.game-result-item.lose {
    color: #dc3545;
}

.game-result-amount {
    font-weight: bold;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 70px;
    text-align: right;
    transition: all 0.3s ease;
}

.game-result-amount.positive {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.game-result-amount.negative {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.game-result-amount:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recent-games-list li:hover {
    transform: translateX(5px);
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.recent-games-list li.win {
    border-left: 4px solid #28a745;
}

.recent-games-list li.lose {
    border-left: 4px solid #dc3545;
}

.recent-games-list li.draw {
    border-left: 4px solid #6c757d;
}

.game-number {
    font-weight: bold;
    color: #666;
    min-width: 80px;
}

.game-result {
    font-weight: bold;
    min-width: 80px;
}

.win .game-result {
    color: #28a745;
}

.lose .game-result {
    color: #dc3545;
}

.draw .game-result {
    color: #6c757d;
}

.game-detail {
    color: #666;
    flex-grow: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 小贴士样式 */
.tips-content {
    color: #666;
}

.tips-content p {
    margin-bottom: 10px;
}

/* 页脚样式 */
footer {
    text-align: center;
    color: #666;
    margin-top: 30px;
    font-size: 14px;
}

/* 响应式布局 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .result-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-number {
        min-width: 60px;
    }
    
    .game-result {
        min-width: 60px;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    text-decoration: none;
    color: inherit;
}

/* 麻将游戏详细翻数样式 */
.fan-details {
    font-size: 0.8em;
    color: #888;
    margin-top: 2px;
    padding-left: 10px;
    border-left: 2px solid #ddd;
    line-height: 1.4;
}

.recent-games-list li:hover .fan-details {
    color: #666;
    border-left-color: #aaa;
}