* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.card-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 300px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    color: #666;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.card-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 300px;
}

.card-info h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.card-image-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.card-image-container img {
    max-width: 200px;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.card-image-container img:hover {
    transform: scale(1.05);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.draw-btn, .reset-btn, .memory-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    white-space: nowrap;
}

.draw-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.reset-btn {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.memory-btn {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
    color: white;
    margin-top: 20px;
}

.memory-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.memory-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.memory-content h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.meaning-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-text {
    white-space: nowrap;
}

.tab-btn.active {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
    color: white;
    border-color: #6c5ce7;
}

.tab-btn:hover {
    transform: translateY(-1px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
}

.meaning-text h5 {
    color: #6c5ce7;
    margin: 15px 0 10px 0;
    font-size: 1.1rem;
}

.meaning-text p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
    text-align: justify;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    header p {
        font-size: 1rem;
    }
    
    main {
        gap: 20px;
    }
    
    .card-section {
        min-height: 350px;
    }
    
    .card-display, .card-info {
        min-width: 280px;
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .card-info h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .card-image-container img {
        max-width: 180px;
        max-height: 250px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .draw-btn, .reset-btn, .memory-btn {
        width: 100%;
        max-width: 280px;
        padding: 18px 25px;
        font-size: 1.2rem;
        border-radius: 30px;
        min-height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .memory-section {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .memory-content h3 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }
    
    .meaning-tabs {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .tab-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
        border-radius: 25px;
        min-width: 120px;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tab-content h4 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .meaning-text h5 {
        font-size: 1.1rem;
        margin: 20px 0 12px 0;
    }
    
    .meaning-text p {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 25px;
    }
    
    footer {
        margin-top: 30px;
        font-size: 0.9rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .card-display, .card-info {
        min-width: 260px;
        padding: 20px 15px;
    }
    
    .card-image-container img {
        max-width: 160px;
        max-height: 220px;
    }
    
    .draw-btn, .reset-btn, .memory-btn {
        max-width: 260px;
        padding: 16px 20px;
        font-size: 1.1rem;
        min-height: 50px;
    }
    
    .memory-section {
        padding: 20px 15px;
    }
    
    .meaning-tabs {
        gap: 10px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 100px;
        min-height: 45px;
    }
    
    .meaning-text p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .draw-btn, .reset-btn, .memory-btn, .tab-btn {
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }
    
    .draw-btn:active, .reset-btn:active, .memory-btn:active, .tab-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .card-image-container img:hover {
        transform: none;
    }
    
    .card-image-container img:active {
        transform: scale(1.02);
    }
    
    /* 防止双击缩放 */
    .card-image-container img {
        touch-action: manipulation;
    }
    
    /* 优化滚动体验 */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 增加按钮触摸区域 */
    .draw-btn, .reset-btn, .memory-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .container {
        padding: 8px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .card-section {
        min-height: 250px;
    }
    
    .card-display, .card-info {
        padding: 15px;
    }
    
    .card-image-container img {
        max-width: 120px;
        max-height: 160px;
    }
    
    .memory-section {
        padding: 15px;
    }
    
    .memory-content h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .meaning-tabs {
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .meaning-text p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-info, .memory-section {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 