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

body {
    font-family: -apple-system, "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

/* ─── 员工端 ─── */

.employee-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

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

.card h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.card .icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.result-success .action-text {
    font-size: 36px;
    font-weight: bold;
    color: #07c160;
    margin: 10px 0;
}

.result-success .greeting {
    font-size: 22px;
    color: #666;
    margin-bottom: 10px;
}

.result-success .time-text {
    font-size: 18px;
    color: #999;
}

.result-success .hours-text {
    font-size: 20px;
    color: #333;
    margin-top: 15px;
    padding: 10px;
    background: #f0f9f0;
    border-radius: 8px;
}

.result-info {
    color: #576b95;
}

.result-info .action-text {
    font-size: 28px;
    font-weight: bold;
    color: #576b95;
}

input[type="text"],
input[type="password"],
input[type="time"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: #07c160;
}

.btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

.btn-primary {
    background: #07c160;
    color: #fff;
    width: 100%;
}

.btn-export {
    background: #1989fa;
    color: #fff;
}

.btn-admin {
    background: #576b95;
    color: #fff;
    width: 100%;
}

.error-text {
    color: #ee0a24;
    font-size: 14px;
    margin-bottom: 10px;
}

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

.form-group label {
    display: block;
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    text-align: left;
}

/* ─── 管理端 ─── */

.admin-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.admin-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #07c160;
}

.admin-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-section h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: #333;
}

.settings-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.settings-form .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.settings-form .btn {
    padding: 14px 30px;
    white-space: nowrap;
}

.month-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.month-selector select {
    padding: 10px 14px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.month-selector .btn {
    padding: 10px 20px;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f8f8;
    font-weight: bold;
    color: #666;
}

tr:hover {
    background: #f9f9f9;
}

.flash-msg {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 16px;
}

.export-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.empty-text {
    text-align: center;
    color: #999;
    padding: 30px;
    font-size: 18px;
}

/* ─── 演示入口 ─── */

.demo-hint {
    color: #999;
    font-size: 14px;
    margin-top: 15px;
}

/* ─── 手机端适配 ─── */

/* 表格在手机上横向滚动 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 防止 iOS 输入框缩放 */
input, select, textarea {
    font-size: 16px !important;
}

/* 触摸友好：增大按钮点击区域 */
.btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
    line-height: 1.2;
}

select {
    -webkit-appearance: none;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 36px;
}

@media screen and (max-width: 600px) {
    .admin-page {
        padding: 12px;
    }

    .admin-page h1 {
        font-size: 22px;
        margin-bottom: 14px;
    }

    .admin-section {
        padding: 16px;
        border-radius: 10px;
    }

    .admin-section h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* 设置表单纵向排列 */
    .settings-form {
        flex-direction: column;
        gap: 12px;
    }

    .settings-form .form-group {
        min-width: unset;
        width: 100%;
    }

    .settings-form .btn {
        width: 100%;
    }

    /* 月份选择器 */
    .month-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .month-selector select {
        width: 100%;
        font-size: 16px !important;
    }

    .month-selector .btn {
        width: 100%;
    }

    /* 表格紧凑样式 */
    table {
        font-size: 15px;
    }

    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* 导出按钮全宽 */
    .export-bar {
        justify-content: center;
    }

    .export-bar .btn {
        width: 100%;
        text-align: center;
    }

    /* 卡片微调 */
    .card {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .card .icon {
        font-size: 48px;
    }

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

    .result-success .action-text {
        font-size: 30px;
    }

    .result-success .greeting {
        font-size: 20px;
    }
}

/* 安全区域适配（iPhone 刘海屏） */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .admin-page {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}
