* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: transparent;
    perspective: 1000px;
    height: 80px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-back {
    transform: rotateY(180deg);
    background: #2c3e50;
    color: white;
}

.card-back .card-content p {
    color: white;
    font-size: 0.9rem;
}

.card-content {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.card h2 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin: 0;
    text-align: center;
}

@media (max-width: 600px) {
    .container {
        padding: 0.75rem 0.5rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }

    .domain-title {
        font-size: 1.2rem;
        margin: 1rem 0 0.5rem;
        padding-bottom: 0.35rem;
    }

    .card {
        margin: 0;
        border-radius: 8px;
        height: 52px;
    }

    .card-content {
        min-height: 52px;
        padding: 0.6rem;
    }

    .card h2 {
        font-size: 1rem;
        line-height: 1.3;
    }

    @media (hover: none) {
        .card:hover .card-inner {
            transform: none;
        }
        
        .card.flipped .card-inner {
            transform: rotateY(180deg);
        }
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0.5rem 0.4rem;
    }

    .card-grid {
        gap: 0.5rem;
    }

    .card-content {
        min-height: 48px;
    }

    .card h2 {
        font-size: 0.95rem;
    }

    .card {
        height: 48px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .container {
        padding: 0.75rem;
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

    .card-content {
        min-height: 45px;
    }

    h1 {
        margin-bottom: 0.75rem;
    }

    .domain-title {
        margin: 0.75rem 0 0.4rem;
    }

    .card {
        height: 45px;
    }
}

@media (hover: none) {
    .card:hover {
        transform: none;
    }

    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

.card h2 {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.domain-title {
    color: #34495e;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.5rem;
}

.card-grid:last-child {
    margin-bottom: 0;
}

/* 添加触摸区域样式 */
.card-touch-areas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: none;  /* 默认隐藏，仅在触摸设备显示 */
}

.touch-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 25%;  /* 左右各25%宽度用于翻转 */
}

.touch-area.left {
    left: 0;
}

.touch-area.right {
    right: 0;
}

/* 在触摸设备上显示触摸区域 */
@media (hover: none) {
    .card-touch-areas {
        display: block;
    }
} 