:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --border-color: #2980b9;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #5c9ce6;
    --secondary-color: #adb5bd;
    --background-color: #1a1a1a;
    --text-color: #e9ecef;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    padding: 0 1rem;
    width: 100%;
    margin-top: 0;
}

.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.card:hover {
    transform: none;
    box-shadow: none;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    padding: 1.5rem;
    border-bottom: none;
    border-radius: 0;
}

.card-header h3 {
    font-weight: 600;
    margin: 0;
    font-size: 1.8rem;
}

.card-body {
    padding: 0rem;
}

#result {
    font-size: 120px;
    transition: all 0.3s ease;
    word-break: break-all;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 2px 2px 4px var(--shadow-color);
    margin: 0.5rem 0;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(41, 128, 185, 0.1));
    border-radius: 15px;
    padding: 1rem;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
}

.header-buttons {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

@media (min-width: 768px) {
    .header-btn {
        width: auto;
        padding: 0.6rem 1.2rem;
    }
    
    .header-buttons {
        margin-top: 0;
    }
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header-btn i {
    font-size: 1.1rem;
}

@media (max-width: 767px) {
    .card-header h3 {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .header-buttons {
        justify-content: center;
    }
}

.called-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.called-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.called-item span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.called-item .count {
    position: static;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.called-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.called-item.attendance-present {
    /* 出勤状态不显示颜色 */
}

.called-item.attendance-late {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.called-item.attendance-absent {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.called-item.attendance-leave {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: #17a2b8;
}

.called-item.attendance-early {
    background-color: rgba(253, 126, 20, 0.1);
    border-color: #fd7e14;
}

.called-item.attendance-violation {
    background-color: rgba(156, 39, 176, 0.1);
    border-color: #9c27b0;
}

.attendance-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-color);
    z-index: 1000;
    min-width: 300px;
    padding: 1.5rem;
}

.attendance-menu-header {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
}

.attendance-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.attendance-option {
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.attendance-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.attendance-option.present {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.attendance-option.late {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.attendance-option.absent {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.attendance-option.leave {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

.attendance-option.early {
    background-color: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
    border: 1px solid #fd7e14;
}

.attendance-option.violation {
    background-color: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border: 1px solid #9c27b0;
}

.attendance-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

.settings-panel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    padding: 2rem;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -5px 0 15px var(--shadow-color);
}

.settings-panel.show {
    right: 0;
}

.settings-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.settings-panel-header h4 {
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
}

.settings-panel-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.settings-panel-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.settings-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-panel-backdrop.show {
    display: block;
    opacity: 1;
}

.settings-panel h5 {
    color: var(--text-color);
    margin: 1.5rem 0 1rem;
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 2rem 0;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.timer-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    margin: 1.5rem 0;
}

.timer-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(41, 128, 185, 0.1));
    border-radius: 15px;
    margin: 1rem 0;
    width: 100%;
    display: none;
}

.timer-display.active {
    display: block;
    animation: pulse 1s infinite;
}

.stat-card {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(41, 128, 185, 0.1));
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.stat-card h5 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
        margin-top: 0;
    }

    .card {
        margin: 0;
        border-radius: 0;
    }

    .card-header {
        padding: 0.8rem;
        border-radius: 0;
    }

    .card-header h3 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    #result {
        font-size: 70px;
        min-height: 100px;
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        margin: 0.3rem;
        min-width: 140px;
        height: 52px;
    }

    .header-btn {
        padding: 0.4rem;
        font-size: 0.8rem;
        margin: 0.2rem;
    }

    .called-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .called-item {
        padding: 0.6rem;
        font-size: 0.85rem;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        word-break: break-all;
        line-height: 1.2;
        font-size: clamp(0.7rem, 4vw, 0.85rem);
        width: 100%;
        box-sizing: border-box;
    }

    .called-item span {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .called-item .count {
        position: static;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        font-size: 0.85rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .settings-panel {
        width: 100%;
        right: -100%;
        padding: 1rem;
    }

    .timer-display {
        font-size: 1.8rem;
        padding: 0.8rem;
    }

    .chart-container {
        height: 200px;
        margin: 1rem 0;
        padding: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .feature-options {
        flex-direction: column;
        gap: 0.5rem;
        margin: 0.8rem 0;
    }

    .feature-option {
        padding: 0.5rem 1rem;
        justify-content: space-between;
        font-size: 0.85rem;
    }

    .timer-controls .btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-width: 140px;
        height: 52px;
    }

    .toast {
        min-width: 90%;
        max-width: 300px;
    }

    .toast-body {
        padding: 1rem;
        font-size: 1rem;
    }

    .attendance-menu {
        width: 90%;
        max-width: 300px;
        padding: 1rem;
    }

    .attendance-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .attendance-option {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .button-container {
        margin: 1rem 0 2rem 0;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0.3rem;
    }

    .card-header {
        padding: 0.6rem;
    }

    .card-header h3 {
        font-size: 1.2rem;
    }

    .card-body {
        padding: 0.8rem;
    }

    #result {
        font-size: 50px;
        min-height: 80px;
        padding: 0.3rem;
    }

    .btn-lg {
        padding: 0.9rem 1.8rem;
        font-size: 1.05rem;
        margin: 0.2rem;
        min-width: 130px;
        height: 48px;
    }

    .header-btn {
        padding: 0.3rem;
        font-size: 0.75rem;
        margin: 0.15rem;
    }

    .called-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.4rem;
    }

    .called-item {
        padding: 0.5rem;
        min-height: 45px;
        font-size: clamp(0.65rem, 3.5vw, 0.8rem);
        width: 100%;
        box-sizing: border-box;
    }

    .called-item span {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .called-item .count {
        position: static;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        width: 16px;
        height: 16px;
        font-size: 0.8rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .stat-card {
        padding: 0.6rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .feature-options {
        gap: 0.4rem;
        margin: 0.6rem 0;
    }

    .feature-option {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .timer-controls .btn {
        padding: 0.9rem 1.8rem;
        font-size: 1.05rem;
        min-width: 130px;
        height: 48px;
    }

    .toast-body {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .attendance-menu {
        padding: 0.8rem;
    }

    .attendance-option {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .button-container {
        margin: 0.8rem 0 3rem 0;
    }
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 400px;
    background-color: var(--card-bg);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    border-radius: 15px;
    overflow: hidden;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.toast-header {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.toast-header .btn-close {
    color: white;
    filter: brightness(0) invert(1);
}

.toast-body {
    padding: 1.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

.toast-body.text-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

.toast-body.text-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.toast-body.text-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.toast-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.form-check {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-left: 0.5rem;
    cursor: pointer;
    flex: 1;
}

.form-check i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.form-check.duplicate i {
    color: #4a90e2;
}

.form-check.colorful i {
    color: #e74c3c;
}

.feature-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.feature-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.feature-option.duplicate {
    border-color: #4a90e2;
    color: #4a90e2;
}

.feature-option.colorful {
    border-color: #e74c3c;
    color: #e74c3c;
}

.feature-option i {
    font-size: 1.2rem;
}

.feature-option .feature-title {
    font-size: 1rem;
    font-weight: 500;
}

.feature-option .form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

.feature-option .form-check-input:checked {
    background-color: currentColor;
    border-color: currentColor;
}

.feature-option.duplicate .form-check-input:checked {
    background-color: #4a90e2;
    border-color: #4a90e2;
}

.feature-option.colorful .form-check-input:checked {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

#timerMinutes {
    width: 80px;
    text-align: center;
    background-color: rgba(74, 144, 226, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

#timerMinutes:focus {
    background-color: rgba(74, 144, 226, 0.15);
    border-color: #2980b9;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

#fileInput {
    display: none;
}

.timer-controls .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    border: none;
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 130px;
    height: 48px;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 2.5rem 0;
} 