/* 班级座位神器样式 */
:root {
    --desk-bg-color: #f5f5f5;
    --desk-border-color: #d4d4d4;
    --teacher-desk-bg: #e1f5fe;
    --teacher-desk-border: #81d4fa;
    --male-seat-bg: #bbdefb;
    --male-seat-border: #64b5f6;
    --female-seat-bg: #f8bbd0;
    --female-seat-border: #f48fb1;
    --special-seat-bg: #ffe082;
    --special-seat-border: #ffc107;
    --empty-seat-bg: #f0f0f0;
    --empty-seat-border: #d0d0d0;
    --template-btn-bg: #f5f5f5;
    --template-btn-hover-bg: #e0e0e0;
}

.class-selection {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
}

.class-selection label {
    font-weight: bold;
    margin-right: 10px;
}

.class-selection select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    min-width: 200px;
}

.seating-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.settings-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.settings-group label {
    margin-bottom: 5px;
    font-weight: 600;
}

.settings-group input,
.settings-group select {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.settings-group input[type="number"] {
    width: 80px;
}

#applySettings {
    height: 36px;
    margin-left: auto;
}

.seating-templates {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.seating-templates h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.template-btn {
    padding: 8px 15px;
    background-color: var(--template-btn-bg);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.template-btn:hover {
    background-color: var(--template-btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.seating-container {
    position: relative;
    background: url('../images/bg-paper.png');
    background-color: #f0f0f0;
    border: 4px solid #000;
    border-image: url('../images/border.png') 4 repeat;
    padding: 20px;
    min-height: 500px;
    margin: 20px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.classroom-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

.teacher-desk {
    background-color: var(--teacher-desk-bg);
    border: 2px solid var(--teacher-desk-border);
    border-radius: 5px;
    padding: 10px 30px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 200px;
}

.seating-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 1000px;
}

.seat {
    background-color: var(--desk-bg-color);
    border: 2px solid var(--desk-border-color);
    border-radius: 5px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.seat:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.seat.empty-seat {
    background-color: var(--empty-seat-bg);
    border-color: var(--empty-seat-border);
    cursor: pointer;
}

.seat.male-seat {
    background-color: var(--male-seat-bg);
    border-color: var(--male-seat-border);
}

.seat.female-seat {
    background-color: var(--female-seat-bg);
    border-color: var(--female-seat-border);
}

.seat.special-seat {
    background-color: var(--special-seat-bg);
    border-color: var(--special-seat-border);
}

.seat.dragging {
    opacity: 0.8;
    transform: scale(1.05);
    z-index: 100;
}

.student-name {
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
    font-size: 0.95rem;
}

.student-info {
    font-size: 0.8rem;
    color: #666;
}

.seating-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-item .seat {
    width: 20px;
    height: 20px;
    cursor: default;
}

.legend-item .seat:hover {
    transform: none;
    box-shadow: none;
}

.saved-layouts {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.saved-layouts h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.saved-layouts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.saved-layout-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: white;
    width: 200px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.saved-layout-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.saved-layout-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.saved-layout-info {
    font-size: 0.8rem;
    color: #666;
}

.saved-layout-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.saved-layout-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 5px;
    border-radius: 3px;
}

.saved-layout-actions button:hover {
    background-color: #f0f0f0;
}

.empty-message {
    text-align: center;
    color: #888;
    font-style: italic;
}

/* 打印样式 */
@media print {
    header, footer, .tool-controls, .seating-settings, 
    .seating-templates, .instructions, .saved-layouts {
        display: none !important;
    }
    
    .seating-container {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .classroom-layout {
        page-break-inside: avoid;
    }
    
    .teacher-desk {
        margin-bottom: 15px;
    }
    
    .seating-grid {
        gap: 5px;
    }
    
    .seat {
        box-shadow: none !important;
        border-width: 1px !important;
        height: 60px !important;
    }
}

/* 动画效果 */
@keyframes highlight-seat {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0,0,0,0.1);
    }
}

.seat.highlight {
    animation: highlight-seat 1s ease;
}

/* 媒体查询 */
@media (max-width: 768px) {
    .seating-settings {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-group {
        width: 100%;
    }
    
    #applySettings {
        margin-left: 0;
        width: 100%;
    }
    
    .seating-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 5px;
    }
    
    .seat {
        height: 70px;
    }
    
    .student-name {
        font-size: 0.85rem;
    }
    
    .student-info {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .seating-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .seat {
        height: 60px;
    }
    
    .template-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .template-btn {
        width: 100%;
    }
    
    .seating-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 全屏模式样式调整 */
.seating-container.fullscreen-mode {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 30px;
    border-radius: 0;
    border: none;
    overflow-y: auto;
    z-index: 9999;
}

.seating-container.fullscreen-mode .classroom-layout {
    min-height: 70vh;
}

.seating-container.fullscreen-mode .seat {
    height: 100px;
}

/* 拖拽相关样式 */
.drag-over {
    background-color: rgba(255, 255, 0, 0.2) !important;
}

.no-cursor {
    cursor: none !important;
}

/* U型教室特殊样式 */
.u-shaped-layout .seating-grid {
    display: grid;
    grid-template-areas:
        "top top top top"
        "left empty empty right"
        "left empty empty right"
        "bottom bottom bottom bottom";
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 10px;
}

.u-shaped-layout .top-row {
    grid-area: top;
    display: flex;
    gap: 10px;
}

.u-shaped-layout .left-col {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.u-shaped-layout .right-col {
    grid-area: right;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.u-shaped-layout .bottom-row {
    grid-area: bottom;
    display: flex;
    gap: 10px;
}

/* 提示和指引样式 */
.tips {
    background-color: rgba(255, 248, 225, 0.8);
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 5px 5px 0;
}

.tips h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #f57c00;
}

.tips ul {
    margin-bottom: 0;
}

/* 没有班级数据的提示信息 */
.no-class-message {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    border: 1px solid #ddd;
}

.no-class-message.hidden {
    display: none;
}

.message-content {
    max-width: 500px;
    margin: 0 auto;
}

.message-content h3 {
    color: #e6a23c;
    margin-bottom: 15px;
}

.message-content p {
    margin-bottom: 20px;
    color: #666;
}

.message-content .button {
    display: inline-block;
} 