[v-cloak] {
    display: none;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* 自定义滚动条样式，使其美观且自动出现 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #edf2f7;
    color: #4a5568;
}

.toggle-sidebar-btn {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 10;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-left: none;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s;
}

.toggle-sidebar-btn:hover {
    background-color: #f7fafc;
    color: #2b6cb0;
    box-shadow: 4px 0 6px rgba(0,0,0,0.1);
}

.sidebar-tip {
    font-size: 13px;
    color: #718096;
    text-align: center;
    margin-top: 8px;
}

.section {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dedede;
}

.section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #4a5568;
}

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

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

.form-group.half {
    flex: 1;
    margin-bottom: 0;
}

.layout-row {
    align-items: flex-end;
}

.form-group.flex-2 {
    flex: 2;
    margin-bottom: 0;
}

.form-group.flex-3 {
    flex: 3;
    margin-bottom: 0;
}

.form-group.radio-group {
    display: flex;
    align-items: center;
}

.file-upload {
    display: flex;
    align-items: center;
}

.file-upload .btn {
    flex: 1;
}

.btn-outline {
    background-color: transparent;
    color: #4299e1;
    border-color: #4299e1;
}

.btn-outline:hover {
    background-color: #ebf8ff;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #4a5568;
}

.form-group.radio-group label {
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.form-group.radio-group input[type="radio"] {
    margin-right: 6px;
}

.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #4299e1;
}

.form-group small {
    display: block;
    color: #a0aec0;
    margin-top: 4px;
    font-size: 12px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
    color: #4a5568;
    white-space: nowrap;
}

.checkbox-grid input[type="checkbox"] {
    margin-right: 6px;
}

.smart-options {
    margin-top: 12px;
    padding: 12px;
    background-color: #f7fafc;
    border-radius: 6px;
    border: 1px solid #edf2f7;
}

.btn {
    width: 100%;
    padding: 10px 16px;
    background-color: #edf2f7;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #4a5568;
}

.btn:hover {
    background-color: #e2e8f0;
}

.btn-primary {
    background-color: #4299e1;
    color: white;
    border-color: #3182ce;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-primary:disabled {
    background-color: #a0aec0;
    border-color: #a0aec0;
    cursor: not-allowed;
}

.btn-success {
    background-color: #48bb78;
    color: white;
    border-color: #38a169;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-success:disabled {
    background-color: #a0aec0;
    border-color: #a0aec0;
    cursor: not-allowed;
}

.actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-status {
    margin-top: 4px;
    font-size: 14px;
    color: #38a169;
    font-weight: 500;
}

.template-link {
    margin-top: 8px;
    font-size: 13px;
}

.template-link a {
    color: #4299e1;
    text-decoration: none;
}

.template-link a:hover {
    text-decoration: underline;
}

.hover-trigger {
    position: relative;
    cursor: pointer;
}

.hover-image {
    display: none;
    position: fixed; /* 改回 fixed 以脱离侧边栏层级限制 */
    left: 200px; /* 侧边栏宽度内，靠近鼠标位置 */
    top: 100px;
    z-index: 99999;
    width: max-content;
    max-width: 500px;
    background-color: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
}

.hover-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.hover-trigger:hover .hover-image {
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    overflow: hidden;
    position: relative;
}

.toolbar {
    display: none; /* Removed toolbar as requested */
}

.classroom-container {
    flex: 1;
    padding: 10px 30px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.front-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.blackboard {
    width: 60%;
    max-width: 700px;
    height: 16px;
    background-color: #2f855a;
    border-radius: 4px;
    border: 3px solid #276749;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.teacher-desk {
    width: 160px;
    height: 48px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

/* 使用 border 绘制梯形，兼容 html2canvas */
.teacher-desk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    border-top: 48px solid #ed8936;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.1));
}

.teacher-desk-text {
    padding-bottom: 8px; /* 调整文字位置使其垂直居中于梯形 */
}

.grid-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.legend-area {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    padding-right: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #4a5568;
}

.seating-grid {
    display: grid;
    gap: 12px 10px; /* row-gap: 12px, column-gap: 10px */
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.watermark {
    margin-top: 6px;
    font-size: 12px;
    color: #909090;
    align-self: flex-end;
    padding-right: 8px;
    letter-spacing: 1px;
}

.seat {
    min-width: 90px;
    min-height: 60px;
    background-color: #edf2f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.seat.preview-seat {
    background-color: #e2e8f0;
    border: 1px dashed #cbd5e0;
    opacity: 0.7;
}

.seat.drag-over {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.empty-seat {
    color: #a0aec0;
    font-size: 14px;
}

.student-card {
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    border: 2px solid #e2e8f0;
    padding: 4px;
    position: relative;
}

.student-card:active {
    cursor: grabbing;
}

.student-card.gender-male {
    border-color: #90cdf4;
    background-color: #ebf8ff;
}

.student-card.gender-female {
    border-color: #feb2b2;
    background-color: #fff5f5;
}

.gender-icon {
    position: absolute;
    bottom: 4px;
    left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-male {
    color: #4299e1;
}

.icon-female {
    color: #f56565;
}

.student-name {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
    text-align: center;
    word-break: break-all;
}

.student-details {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.aisle {
    width: 30px;
}

.empty-state {
    display: none;
}

/* 悬浮导出按钮 */
.fab-export {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #48bb78;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 100;
}

.fab-export:hover {
    background-color: #38a169;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(72, 187, 120, 0.5);
}

.fab-export svg {
    margin-bottom: 2px;
}