/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #1f2937;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* ========== 顶部标题栏 ========== */
.header {
    text-align: center;
    padding: 30px 0 20px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* 复制结果下拉菜单 */
.copy-dropdown {
    position: relative;
    display: inline-block;
}

.copy-trigger {
    margin: 0;
}

.copy-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 60;
    overflow: hidden;
}

.copy-dropdown.show .copy-menu {
    display: block;
}

.copy-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
}

.copy-option:hover {
    background: #f3f4f6;
}

/* 模式切换 */
.mode-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-label {
    font-size: 14px;
    color: #6b7280;
}

.mode-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
}

.mode-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mode-tab.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 搜索框 */
.search-box input {
    padding: 9px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 200px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== 导入引导页 ========== */
.import-guide {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.guide-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.guide-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.guide-card h2 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 8px;
}

.guide-card > p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 15px;
}

.guide-tips {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    margin-bottom: 20px;
}

.guide-tips h3 {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tag {
    padding: 4px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tip-note {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

.mode-desc {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.mode-item {
    flex: 1;
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 10px;
}

.mode-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.mode-icon.cross {
    background: #fee2e2;
    color: #dc2626;
}

.mode-item strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.mode-item p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.privacy-note {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* ========== 点名列表区 ========== */
.rollcall-area {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.list-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.col-name {
    flex: 1;
}

.col-phone {
    width: 150px;
    text-align: center;
}

.col-status {
    width: 80px;
    text-align: center;
}

.student-list {
    max-height: calc(100vh - 380px);
    overflow-y: auto;
}

.student-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
    cursor: pointer;
}

.student-item:hover {
    background: #f9fafb;
}

.student-item:last-child {
    border-bottom: none;
}

.student-info {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-btn {
    font-size: 12px;
    color: #3b82f6;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.detail-btn:hover {
    background: #eff6ff;
}

.student-sub {
    font-size: 13px;
    color: #6b7280;
}

.phone-col {
    width: 150px;
    text-align: center;
    font-size: 14px;
    color: #4b5563;
}

.status-col {
    width: 80px;
    display: flex;
    justify-content: center;
}

.status-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    color: transparent;
}

.status-btn:hover {
    border-color: #9ca3af;
    transform: scale(1.05);
}

/* 勾选模式 - 已到 */
.mode-check .status-btn.checked {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* 叉号模式 - 未到 */
.mode-cross .status-btn.checked {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

/* 已到高亮效果 */
.student-item.present {
    background: #f0fdf4;
}

.student-item.absent {
    background: #fef2f2;
}

/* ========== 底部统计栏 ========== */
.stats-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    gap: 40px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.stats-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stats-label {
    font-size: 14px;
    color: #6b7280;
}

.stats-value {
    font-size: 24px;
    font-weight: 700;
}

.stats-unit {
    font-size: 14px;
    color: #6b7280;
}

.stats-item.total .stats-value {
    color: #1f2937;
}

.stats-item.present .stats-value {
    color: #16a34a;
}

.stats-item.absent .stats-value {
    color: #dc2626;
}

.stats-item.rate .stats-value {
    color: #2563eb;
    font-size: 22px;
}

/* ========== 详情弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-content {
    padding: 30px;
}

.detail-header {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.detail-header.no-avatar {
    display: block;
}

.detail-name-section h2 {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 4px;
}

.detail-name-section .subtitle-info {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #1f2937;
    word-break: break-all;
}

.detail-value.empty {
    color: #d1d5db;
    font-style: normal;
}

.detail-value.empty::before {
    content: "✕ ";
    color: #d1d5db;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 640px) {
    .container {
        padding: 12px;
        padding-bottom: 90px;
    }

    .header h1 {
        font-size: 24px;
    }

    .toolbar {
        padding: 12px;
        gap: 10px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }

    .search-box input {
        width: 160px;
    }

    .mode-switch {
        flex-wrap: wrap;
        justify-content: center;
    }

    .guide-card {
        padding: 24px;
    }

    .mode-desc {
        flex-direction: column;
    }

    .col-phone,
    .phone-col {
        display: none;
    }

    .col-name {
        padding-left: 12px;
    }

    .student-info {
        padding-left: 12px;
    }

    .student-item {
        padding: 10px 14px;
    }

    .stats-bar {
        gap: 20px;
        padding: 12px 16px;
    }

    .stats-value {
        font-size: 20px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 20px;
    }

    .detail-avatar {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }

    .detail-name-section h2 {
        font-size: 18px;
    }
}

/* 滚动条样式 */
.student-list::-webkit-scrollbar {
    width: 6px;
}

.student-list::-webkit-scrollbar-track {
    background: #f9fafb;
}

.student-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.student-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 性能提示 */
.performance-tip {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    padding: 10px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
}

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== 底部版权信息 ========== */
.footer {
    text-align: center;
    padding: 30px 20px 20px;
    color: #9ca3af;
    font-size: 13px;
}

.footer-links {
    margin-bottom: 6px;
}

.footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #2563eb;
}

.footer-sep {
    margin: 0 10px;
    color: #d1d5db;
}

.footer-copyright {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
}
