/* Tailwind-based mobile UI layer */
:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ink: #111827;
    --muted: #64748b;
    --line: #dbe3ef;
    --panel: #ffffff;
    --page: #f3f6fb;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

a { color: inherit; }

.page-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    padding: 34px max(18px, calc((100vw - 720px) / 2 + 18px)) 18px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.page-header.bind-header {
    display: block;
}

.page-header.bind-header::after {
    content: "提交资料后等待后台审核，审核通过后才能登录评分";
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.86;
}

.page-header.login-header {
    display: block;
}

.page-header.login-header::after {
    content: "未登录用户请从这里进入";
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.86;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.page-body { padding: 18px 16px 30px; }

.page-body {
    width: min(100%, 720px);
    margin: 0 auto;
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: auto;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    color: #334155;
    background: #e8eef8;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-default { background: #e8eef8; color: #475569; }
.btn:active { transform: translateY(1px); }

.search-box { margin-bottom: 14px; }
.search-box input,
.form-group input,
.form-group select,
.form-group textarea,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 9px 12px;
    color: var(--ink);
    font-size: 14px;
    outline: none;
}

.search-box input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.progress-bar { margin-bottom: 16px; }
.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.progress-track { height: 7px; border-radius: 999px; background: #dbeafe; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.25s; }

.dept-group {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.dept-group-title {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 900;
}

.relation-label {
    padding: 11px 14px 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.person-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 12px 12px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.person-card.evaluated { border-color: #bbf7d0; background: #f0fdf4; }
.person-card.unevaluated { border-color: #dbe3ef; background: #fbfdff; }
.person-info { min-width: 0; }
.person-name { color: var(--ink); font-size: 15px; font-weight: 900; }
.person-position { margin-top: 2px; color: var(--muted); font-size: 12px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 26px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.status-badge.done { background: #dcfce7; color: #15803d; }
.status-badge.pending { background: #e2e8f0; color: #475569; }

.empty-state {
    padding: 30px 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15,23,42,0.48);
    overflow-y: auto;
}
.modal-overlay.active { display: block; }

.modal-content {
    position: fixed;
    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateX(-50%);
    border-radius: 18px 18px 0 0;
    background: var(--page);
    padding: 18px 16px 24px;
}

.modal-header {
    margin: -18px -16px 16px;
    padding: 22px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.modal-header h3 { margin: 0 0 3px; font-size: 20px; font-weight: 900; }
.modal-header .subtitle { color: var(--muted); font-size: 12px; font-weight: 700; }

.notice,
.anonymous-notice {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 14px 0;
    padding: 11px 12px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: var(--warning);
    font-size: 12px;
    font-weight: 800;
}

.score-item {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}
.score-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.score-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.score-name { min-width: 0; color: var(--ink); font-weight: 900; }
.score-standard-panel {
    margin: 0 0 12px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px 12px;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}
.score-value {
    width: 72px;
    min-height: 36px;
    text-align: right;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 6px 8px;
    color: var(--brand-dark);
    font-weight: 900;
}
.slider-container { display: flex; align-items: center; gap: 12px; }
.score-item input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    appearance: none;
    background: linear-gradient(to right, #f59e0b 50%, #e2e8f0 50%);
}
.score-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.max-score {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.score-total {
    margin: 14px 0;
    padding: 13px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--brand-dark);
    text-align: center;
    font-weight: 900;
}
.total-score-value { font-size: 22px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.entry-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.entry-title {
    font-size: 20px;
    font-weight: 900;
}

.entry-subtitle {
    margin: 5px 0 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.entry-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px 14px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    text-decoration: none;
}

.entry-action span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.entry-action-primary {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--brand-dark);
}

.clear-login-link {
    display: block;
    margin-top: 12px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.bind-form { padding: 0; }
.bind-form > div[style*="text-align:center"],
.profile-detail {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.form-group {
    margin-bottom: 13px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
}
.required::after { content: "*"; margin-left: 3px; color: var(--danger); }
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
}
.date-select-group {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 8px;
}

.profile-header {
    margin-bottom: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    padding: 26px 16px;
    color: #fff;
    text-align: center;
}
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,0.65);
    object-fit: cover;
}
.avatar-placeholder {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
}
.profile-header .name { margin-top: 8px; font-size: 20px; font-weight: 900; }
.profile-header .dept-pos { color: rgba(255,255,255,0.86); font-size: 13px; font-weight: 700; }

.profile-detail { margin: 14px 0; overflow: hidden; }
.profile-item {
    display: grid;
    grid-template-columns: minmax(86px, 112px) 1fr;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
.profile-item:last-child { border-bottom: 0; }
.field-meta { display: flex; flex-direction: column; gap: 5px; }
.label { color: var(--muted); font-size: 13px; font-weight: 900; }
.profile-item .value { text-align: right; font-weight: 900; }
.field-control { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.field-control input,
.field-control select {
    width: 100%;
    min-width: 0;
    max-width: 190px;
    min-height: 40px;
    text-align: right;
}
.editable { background: #f8fbff; border-left: 4px solid var(--brand); }
.readonly { background: #f8fafc; border-left: 4px solid #94a3b8; }
.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 900;
}
.tag-editable { background: #dbeafe; color: #1d4ed8; }
.tag-readonly { background: #e2e8f0; color: #475569; }
.tag-gray { background: #f3f4f6; color: #9ca3af; }
.locked-value {
    display: inline-flex;
    justify-content: flex-end;
    min-height: 38px;
    border-radius: 10px;
    background: #e2e8f0;
    padding: 9px 11px;
    color: #475569;
}
.audit-status-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}
.audit-status {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.55;
}
.audit-status-title {
    font-weight: 900;
}
.audit-status-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    color: #475569;
}
.audit-status-pending {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}
.audit-status-rejected {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}
.logout-link {
    display: block;
    margin-top: 20px;
    color: #94a3b8;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
}

.toast-message {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 9999;
    transform: translate(-50%,-50%);
    border-radius: 12px;
    padding: 12px 18px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(15,23,42,0.22);
}
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-success { background: var(--success); }

@media (max-width: 380px) {
    .page-body { padding-left: 12px; padding-right: 12px; }
    .profile-item { grid-template-columns: 82px 1fr; padding-left: 12px; padding-right: 12px; }
    .field-control input,
    .field-control select { max-width: 160px; }
}
