* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #2d5016 0%, #3e6b23 100%);
    min-height: 100vh;
    padding-top: 60px;
    user-select: none;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: #2d5016;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 10px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2d5016;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s;
}

/* 主容器 */
.main-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.game-container {
    width: 100%;
    max-width: 1400px;
}

/* 顶部控制栏 */
.top-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d5016;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #2d5016;
    color: #2d5016;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-btn:hover {
    background: #f0f0f0;
}

.difficulty-btn.active {
    background: #2d5016;
    color: white;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: #3e6b23;
    transform: translateY(-2px);
}

/* 游戏区域 */
.game-board {
    background: rgba(45, 80, 22, 0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

/* Foundation区域 */
.foundation-area {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.foundation-pile {
    width: 100%;
    aspect-ratio: 2/3;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.2);
}

.foundation-pile:not(:empty) {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* Tableau区域 */
.tableau-area {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    min-height: 500px;
}

.tableau-column {
    position: relative;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 5px;
    transition: all 0.3s;
}

.tableau-column.empty {
    background: rgba(0, 0, 0, 0.2);
}

.tableau-column.drag-over {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

/* 纸牌样式 */
.card {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: -60%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tableau-column .card:first-child {
    margin-top: 0;
}

.card:hover {
    transform: translateY(-5px);
    z-index: 10;
}

.card.dragging {
    opacity: 0.5;
}

.card.selected {
    box-shadow: 0 0 0 3px #ffd700;
    transform: translateY(-5px);
}

.card.hint {
    animation: hint-pulse 1s ease-in-out;
}

@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
    50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0.6); }
}

.tableau-column.hint-target {
    animation: target-pulse 1s ease-in-out;
}

@keyframes target-pulse {
    0%, 100% { background: rgba(0, 0, 0, 0.1); }
    50% { background: rgba(255, 215, 0, 0.3); }
}

.card-content {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border: 1px solid #ccc;
}

.card-rank {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.card-suit {
    font-size: 24px;
    line-height: 1;
}

.card-content.red {
    color: #dc143c;
}

.card-content.black {
    color: #000;
}

.card.face-down .card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 6px;
    border: 1px solid #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card.face-down .card-back::before {
    content: '🕷️';
    font-size: 30px;
    opacity: 0.3;
}

/* Stock区域 */
.stock-area {
    display: flex;
    justify-content: flex-start;
    padding: 15px;
}

.stock-pile {
    width: 100px;
    height: 140px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.stock-pile:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.stock-indicator {
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.stock-indicator span {
    display: block;
    font-size: 32px;
    margin-bottom: 5px;
    color: #ffd700;
}

/* 游戏结束覆盖层 */
.game-over-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.game-over-message {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
}

.game-over-message h2 {
    font-size: 36px;
    color: #2d5016;
    margin-bottom: 20px;
}

.game-over-message p {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.8;
}

.game-over-message button {
    padding: 15px 40px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.game-over-message button:hover {
    background: #3e6b23;
    transform: scale(1.05);
}

/* 帮助面板 */
.help-panel {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    z-index: 100;
}

.help-panel h3 {
    color: #2d5016;
    font-size: 16px;
    margin-bottom: 10px;
}

.help-panel ul {
    list-style: none;
    padding: 0;
}

.help-panel li {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-panel strong {
    color: #2d5016;
}

/* 关于和攻略页面样式 */
.about-container, .guide-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-content, .guide-content {
    background: white;
    border-radius: 15px;
    padding: 50px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

.about-content h1, .guide-content h1 {
    color: #2d5016;
    font-size: 42px;
    margin-bottom: 30px;
    text-align: center;
}

.about-content h2, .guide-content h2 {
    color: #3e6b23;
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.about-content h3, .guide-content h3 {
    color: #2d5016;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.about-content p, .guide-content p {
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
    font-size: 16px;
}

.about-content ul, .about-content ol,
.guide-content ul, .guide-content ol {
    margin-left: 40px;
    margin-bottom: 20px;
}

.about-content li, .guide-content li {
    line-height: 2;
    color: #555;
    margin-bottom: 10px;
    font-size: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.feature-item {
    background: #f0f8e8;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #d4e8c4;
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(45, 80, 22, 0.2);
}

.feature-item h3 {
    color: #2d5016;
    margin-bottom: 15px;
    font-size: 20px;
}

.feature-item p {
    margin: 0;
    font-size: 15px;
}

.contact-info, .tip-box {
    background: #f0f8e8;
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
}

.tip-box {
    border-left: 4px solid #2d5016;
}

.tip-box strong {
    color: #2d5016;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .help-panel {
        display: none;
    }

    .foundation-area {
        grid-template-columns: repeat(4, 1fr);
    }

    .tableau-area {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: left 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .top-bar {
        flex-direction: column;
    }

    .game-stats {
        width: 100%;
        justify-content: space-around;
    }

    .difficulty-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .foundation-area {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .tableau-area {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .card {
        margin-top: -50%;
    }

    .about-content, .guide-content {
        padding: 30px 20px;
    }

    .about-content h1, .guide-content h1 {
        font-size: 32px;
    }

    .about-content h2, .guide-content h2 {
        font-size: 24px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 20px;
    }

    .stat-value {
        font-size: 20px;
    }

    .difficulty-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .control-btn {
        font-size: 12px;
        padding: 8px 15px;
    }

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

    .tableau-area {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }

    .game-board {
        padding: 10px;
    }

    .card {
        margin-top: -40%;
    }

    .card-rank {
        font-size: 16px;
    }

    .card-suit {
        font-size: 20px;
    }

    .about-content h1, .guide-content h1 {
        font-size: 28px;
    }

    .about-content h2, .guide-content h2 {
        font-size: 22px;
    }

    .about-content h3, .guide-content h3 {
        font-size: 18px;
    }
}
