* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* 卡片容器 */
.card-wrapper {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.card-wrapper.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 300px;
    color: #fff;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.card::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;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card[data-color="red"] {
    border-color: rgba(255, 107, 107, 0.5);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.2);
}

.card[data-color="red"]:hover {
    box-shadow: 0 20px 50px rgba(255, 107, 107, 0.4);
}

.card[data-color="green"] {
    border-color: rgba(107, 203, 119, 0.5);
    box-shadow: 0 10px 30px rgba(107, 203, 119, 0.2);
}

.card[data-color="green"]:hover {
    box-shadow: 0 20px 50px rgba(107, 203, 119, 0.4);
}

.card[data-color="blue"] {
    border-color: rgba(74, 144, 226, 0.5);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.2);
}

.card[data-color="blue"]:hover {
    box-shadow: 0 20px 50px rgba(74, 144, 226, 0.4);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.card:hover .card-icon {
    transform: rotate(360deg) scale(1.2);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}

.card-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.card-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* 控制按钮区域 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.control-btn:active {
    transform: translateY(0);
}

/* 计数器区域 */
.counter-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.counter-section h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#counter {
    color: #667eea;
    font-size: 2rem;
    font-weight: bold;
}

.counter-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.counter-btns button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

#decrease {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
}

#increase {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: #fff;
}

.counter-btns button:hover {
    transform: scale(1.1);
}

.counter-btns button:active {
    transform: scale(0.95);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    color: #fff;
    position: relative;
    animation: slideUp 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fff;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.modal-content p {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

/* 新卡片动画 */
.card.new-card {
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .card {
        width: 100%;
        max-width: 350px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 100%;
        max-width: 200px;
    }
}
