/* assets/css/pk.css */
.pk-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.pk-header {
    text-align: center;
    margin-bottom: 40px;
}

.pk-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
}

.pk-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

.pk-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.pk-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 30px;
    width: 300px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pk-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.pk-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #3498db;
}

.pk-card h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.pk-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.pk-card button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.pk-card button:hover {
    background: #2980b9;
}

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

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    background: #3498db;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-submit {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background: #2980b9;
}

/* 创建房间页面样式 */
.create-room-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.form-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input, 
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.distribution-table-container {
    overflow-x: auto;
}

.distribution-table {
    width: 100%;
    border-collapse: collapse;
}

.distribution-table th,
.distribution-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.distribution-table th {
    background: #f5f7fa;
    font-weight: bold;
}

.distribution-table input {
    width: 50px;
    text-align: center;
}

.distribution-summary {
    margin-top: 20px;
    font-size: 1.1rem;
    text-align: right;
}

.btn-submit {
    background: #1abc9c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
    display: block;
    margin: 0 auto;
}

.btn-submit:hover {
    background: #16a085;
}

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

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: modalopen 0.4s;
}

@keyframes modalopen {
    from {opacity:0; transform: translateY(-60px);}
    to {opacity:1; transform: translateY(0);}
}

/* 新增样式 */
    .pk-container {
        max-width: 1200px;
        margin: 40px auto;
        padding: 20px;
    }
    
    .pk-header {
        text-align: center;
        margin-bottom: 50px;
        padding: 20px;
        background: linear-gradient(120deg, #3498db, #1abc9c);
        border-radius: 16px;
        color: white;
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
        transform: translateY(-5px);
        transition: all 0.4s ease;
    }
    
    .pk-header:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(52, 152, 219, 0.4);
    }
    
    .pk-header h1 {
        font-size: 2.8rem;
        margin: 15px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }
    
    .pk-header p {
        font-size: 1.3rem;
        opacity: 0.9;
    }
    
    .pk-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 40px;
        margin-top: 30px;
    }
    
    .pk-card {
        background: white;
        border-radius: 16px;
        padding: 35px 30px;
        width: 320px;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
        border: 2px solid transparent;
        position: relative;
        overflow: hidden;
    }
    
    .pk-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 8px;
        background: linear-gradient(90deg, #3498db, #1abc9c);
    }
    
    .pk-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        border-color: rgba(52, 152, 219, 0.2);
    }
    
    .pk-card i {
        font-size: 4rem;
        margin-bottom: 25px;
        color: #1abc9c;
        background: linear-gradient(135deg, #3498db, #1abc9c);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        transition: all 0.3s ease;
    }
    
    .pk-card:hover i {
        transform: scale(1.1);
    }
    
    .pk-card h2 {
        font-size: 1.8rem;
        color: #2c3e50;
        margin-bottom: 15px;
        font-weight: 700;
    }
    
    .pk-card p {
        color: #7f8c8d;
        margin-bottom: 25px;
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .pk-card button {
        background: linear-gradient(90deg, #3498db, #1abc9c);
        color: white;
        border: none;
        padding: 12px 30px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 1.1rem;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        letter-spacing: 1px;
        position: relative;
        overflow: hidden;
    }
    
    .pk-card button::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -60%;
        width: 20px;
        height: 200%;
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(25deg);
        transition: all 0.6s;
    }
    
    .pk-card button:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    }
    
    .pk-card button:hover::after {
        left: 120%;
    }
    
    /* 模态框优化 */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(5px);
        animation: fadeIn 0.4s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .modal-content {
        background: white;
        border-radius: 20px;
        width: 90%;
        max-width: 700px;
        overflow: hidden;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
        animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    @keyframes slideUp {
        from { transform: translateY(50px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    .modal-header {
        background: linear-gradient(90deg, #3498db, #1abc9c);
        padding: 25px;
        text-align: center;
        color: white;
        position: relative;
    }
    
    .modal-header h2 {
        margin: 0;
        font-size: 1.8rem;
        font-weight: 600;
    }
    
    .close-modal {
        position: absolute;
        top: 20px;
        right: 25px;
        font-size: 1.8rem;
        cursor: pointer;
        transition: all 0.3s ease;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    
    .close-modal:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(90deg);
    }
    
    .modal-body {
        padding: 30px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .form-group {
        margin-bottom: 25px;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 10px;
        font-weight: 600;
        color: #2c3e50;
        font-size: 1.1rem;
    }
    
    .form-group input, 
    .form-group select {
        width: 100%;
        padding: 14px 18px;
        border: 2px solid #e1e5e9;
        border-radius: 12px;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .form-group input:focus, 
    .form-group select:focus {
        border-color: #3498db;
        outline: none;
        box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
    }
    
    .form-row {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    /* 学科按钮样式优化 */
    .subject-btn {
        padding: 12px 24px; /* 增大按钮尺寸 */
        border-radius: 50px;
        border: 2px solid #3498db; /* 默认蓝色边框 */
        background: transparent; /* 默认透明背景 */
        color: #3498db; /* 默认蓝色文字 */
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 500;
        font-size: 1.1rem; /* 增大字体 */
        margin: 8px; /* 增加外边距 */
    }
    
    .subject-btn.selected {
        background: linear-gradient(90deg, #27ae60, #2ecc71); /* 选中状态绿色渐变 */
        color: white;
        border-color: transparent;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3); /* 绿色阴影 */
    }
    
    .btn-submit {
        background: linear-gradient(90deg, #3498db, #1abc9c);
        color: white;
        border: none;
        padding: 16px;
        border-radius: 12px;
        cursor: pointer;
        font-size: 1.2rem;
        font-weight: 600;
        transition: all 0.3s ease;
        width: 100%;
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
        position: relative;
        overflow: hidden;
    }
    
    .btn-submit:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    }
    
    .btn-submit:active {
        transform: translateY(1px);
    }
    
    .btn-submit.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.2);
        animation: loadingBar 1.5s infinite linear;
    }
    
    @keyframes loadingBar {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }
    
    /* 房间结果样式 */
    .room-result-content {
        text-align: center;
        padding: 20px;
    }
    
    .room-info {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 25px;
        text-align: left;
    }
    
    .room-info p {
        margin: 10px 0;
        font-size: 1.1rem;
    }
    
    .room-info strong {
        color: #2c3e50;
        min-width: 120px;
        display: inline-block;
    }
    
    /* 题目表格样式美化 */
    .question-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
        border-radius: 10px;
        overflow: hidden;
        font-size: 0.95em;
    }
    
    .question-table th {
        background: linear-gradient(90deg, #3498db, #1abc9c);
        color: white;
        padding: 14px 16px; /* 增加内边距 */
        text-align: left;
        font-weight: 600;
    }
    
    .question-table td {
        padding: 14px 16px; /* 增加内边距 */
        border-bottom: 1px solid #eee;
        color: #333;
        transition: background-color 0.2s;
    }
    
    .question-table tr {
        transition: background 0.2s;
    }
    
    .question-table tr:nth-child(even) {
        background: #f9f9f9;
    }
    
    .question-table tr:hover {
        background: #f1f9ff; /* 悬停效果 */
    }
    
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 30px;
    }
    
    .action-buttons button {
        padding: 15px;
        border-radius: 12px;
        font-size: 1.2rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .btn-enter {
        background: linear-gradient(90deg, #3498db, #1abc9c);
        color: white;
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    }
    
    .btn-enter:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    }
    
    .btn-copy {
        background: white;
        color: #3498db;
        border: 2px solid #3498db;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    }
    
    .btn-copy:hover {
        background: #f0f7ff;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .success-message {
        color: #27ae60;
        font-size: 1.2rem;
        margin-top: 20px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    /* 学科按钮容器优化 */
    #subjectButtons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center; /* 居中显示 */
    }

    /* 房间列表容器 */
    .room-list-container {
        max-width: 1400px;
        margin: 0 auto 40px auto;
        padding: 0 20px;
    }

    /* 网格布局：一行最多四个房间卡片 */
    .room-list {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 一行4列 */
        gap: 25px;
        justify-content: center;
        margin-top: 25px;
    }

/* 响应式调整 */
@media (max-width: 1350px) {
    .room-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .room-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .room-list {
        grid-template-columns: 1fr;
    }
}

/* 房间卡片样式优化 */
.room-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.12);
    padding: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.2);
    border-color: rgba(26, 188, 156, 0.3);
}

/* 添加渐变顶部装饰 */
.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #3498db, #1abc9c);
}

/* 房间信息样式 */
.room-card .room-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-card .room-title::before {
    content: '🏠';
    font-size: 1.1em;
}

.room-card .room-meta {
    color: #555;
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-card .room-owner {
    color: #27ae60;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-card .room-owner::before {
    content: '👑';
}

.room-card .room-members {
    color: #e67e22;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-card .room-members::before {
    content: '👥';
}

.room-card .room-time {
    color: #9b59b6;
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-card .room-time::before {
    content: '⏱️';
}

/* 加入按钮样式 */
.room-card .room-btn {
    margin-top: 10px;
    background: linear-gradient(90deg, #3498db, #1abc9c);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.room-card .room-btn:hover {
    background: linear-gradient(90deg, #2980b9, #16a085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

.room-card .room-btn::before {
    content: '🚪';
}