/* ========================================
   卫生管理系统 - 移动端优先样式
   ======================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #f5f6fa;
    min-height: 100vh;
}

a { color: #3498db; text-decoration: none; }
a:active { opacity: 0.7; }

/* ---- Layout ---- */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px 16px 40px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ---- Top Bar ---- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 8px;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.form-group label.required::after {
    content: ' *';
    color: #e74c3c;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;  /* 防止 iOS 自动缩放 */
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: 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' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

textarea {
    resize: vertical;
    min-height: 60px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.btn-primary:active { background: #2980b9; }

.btn-block { display: block; width: 100%; }

.btn-lg { padding: 14px 20px; font-size: 17px; }

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Radio Buttons (审核按钮组) ---- */
.radio-btn {
    flex: 1;
    min-width: 60px;
}

.radio-btn input { display: none; }

.radio-label {
    display: block;
    padding: 10px 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.radio-btn input:checked + .radio-label {
    border-color: #3498db;
    background: #eaf4fd;
}

.radio-btn input:checked + .radio-label.pass   { border-color: #27ae60; background: #eafaf1; }
.radio-btn input:checked + .radio-label.fail   { border-color: #e74c3c; background: #fdecea; }
.radio-btn input:checked + .radio-label.rectify{ border-color: #e67e22; background: #fef5e7; }
.radio-btn input:checked + .radio-label.penalty{ border-color: #c0392b; background: #fdecea; }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error   { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-warning { background: #fef5e7; color: #b9770e; border: 1px solid #f9e79f; }

/* ---- Stats Row ---- */
.stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-pending  { background: #fef5e7; color: #b9770e; }
.badge-pass     { background: #eafaf1; color: #1e8449; }
.badge-fail     { background: #fdecea; color: #c0392b; }
.badge-rectify  { background: #fef5e7; color: #e67e22; }
.badge-penalty  { background: #fdecea; color: #c0392b; }

/* ---- Record Card ---- */
.record-card {
    cursor: pointer;
    transition: background 0.15s;
}

.record-card:active { background: #f8f9fa; }

/* ---- Compare Row (审核对比) ---- */
.compare-row {
    display: flex;
    gap: 10px;
}

.compare-col {
    flex: 1;
    min-width: 0;
}

.compare-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.compare-label.good  { background: #eafaf1; color: #1e8449; }
.compare-label.check { background: #eaf4fd; color: #2471a3; }

.compare-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #eee;
}

.compare-empty {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 14px;
    border: 1px dashed #ddd;
}

/* ---- Photo Upload ---- */
.photo-upload {
    position: relative;
}

.photo-upload input[type="file"] {
    display: none;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4/3;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.photo-placeholder:active { border-color: #3498db; background: #eaf4fd; }

.photo-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.photo-placeholder span:last-child {
    font-size: 14px;
    color: #999;
}

/* ---- Standard Box ---- */
.standard-box {
    padding: 10px 12px;
    background: #fef9e7;
    border-left: 3px solid #f1c40f;
    border-radius: 4px;
    font-size: 13px;
    color: #7d6608;
    white-space: pre-line;
}

/* ---- Status Bar ---- */
.status-bar {
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }

/* ---- Responsive: 大屏双栏对比 ----
@media (min-width: 768px) {
    .container { max-width: 800px; }
    .compare-row { gap: 16px; }
}
