/* ====== 全局 ====== */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f6fa;
    color: #222;
}
.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 16px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 20px;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 20px 0 8px; color: #555; }
.muted { color: #888; }
.small { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ====== 按钮 ====== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #d6dae0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: .15s;
}
.btn:hover { background: #f0f2f5; }
.btn.primary {
    background: #1aad19;
    border-color: #1aad19;
    color: #fff;
}
.btn.primary:hover { background: #179b16; }
.btn.danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}
.btn.danger:hover { background: #e04142; }
.btn.big {
    padding: 14px 22px;
    font-size: 16px;
    width: 100%;
    margin-top: 12px;
}
.btn.small { padding: 4px 10px; font-size: 12px; margin-right: 4px; }

/* ====== 表格 ====== */
.t {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.t th, .t td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    font-size: 14px;
}
.t th { background: #fafbfc; color: #555; font-weight: 600; }
.t tr:hover { background: #fafbfc; }

/* ====== 弹窗 ====== */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal[hidden] { display: none; }
.modal-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal-card label {
    display: block;
    margin: 10px 0;
    font-size: 14px;
    color: #555;
}
.modal-card input, .modal-card select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #d6dae0;
    border-radius: 6px;
    font-size: 14px;
}

/* ====== 头像 ====== */
.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f2f5;
    vertical-align: middle;
}
.avatar.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #bbb;
}
.photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 16px;
    padding: 10px;
    background: #f8f9fb;
    border-radius: 6px;
}
.photo-row label { margin: 0; }
.photo-preview {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #fff;
    border: 1px dashed #d6dae0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 30px;
    color: #ccc;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.big-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: #f0f2f5;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    font-size: 50px;
    color: #ccc;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.big-avatar.small { width: 60px; height: 60px; font-size: 30px; margin-bottom: 0; }
.actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ====== 扫码手机端样式 ====== */
.phone-bg { background: #f4f6fa; }
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    margin: 12px 0;
}
.info {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 4px 12px;
    margin: 16px 0;
}
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #e6e8ec;
    font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: #888; }
.info-row b { color: #222; }

.camera-box {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.camera-box video {
    width: 100%; height: 100%; object-fit: cover;
}
.scan-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #1aad19, transparent);
    box-shadow: 0 0 8px #1aad19;
    animation: scan 1.5s infinite linear;
}
@keyframes scan {
    0%   { top: 0; }
    50%  { top: calc(100% - 3px); }
    100% { top: 0; }
}

.punch-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.punch-row .btn { flex: 1; margin-top: 0; }

.log {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.log li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
}
.tag.green { background: #1aad19; }
.tag.red   { background: #ff4d4f; }
