/* ============================================================
   北京城建六·HLB-2-26地块施工验收系统 全局样式
   主色调：#01ad9d  辅助：#e8f5f3 / #017a6d
   字体：Microsoft YaHei, Arial, sans-serif
   响应式：适配手机、平板、桌面
   ============================================================ */

:root {
    --primary: #01ad9d;
    --primary-dark: #017a6d;
    --primary-light: #e8f5f3;
    --text: #333333;
    --text-muted: #666666;
    --border: #dce7e5;
    --danger: #d9534f;
    --warning: #e6a23c;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(1, 173, 157, 0.10);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: #f4f8f7;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.topbar {
    background: #ffffff;
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 40px; width: auto; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.main-nav ul { display: flex; list-style: none; gap: 4px; }
.main-nav a {
    display: block; padding: 8px 14px; border-radius: 20px;
    color: var(--text); font-size: 14px; text-decoration: none;
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.main-nav a.active { background: var(--primary); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.notif-btn { position: relative; font-size: 20px; text-decoration: none; }
.notif-badge {
    position: absolute; top: -6px; right: -10px;
    background: var(--danger); color: #fff;
    font-size: 11px; line-height: 1; padding: 3px 5px;
    border-radius: 10px; min-width: 17px; text-align: center;
}
.user-name { font-size: 14px; color: var(--text-muted); }
.user-name em { font-style: normal; color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--primary-dark); cursor: pointer; }

/* ---------- 主体容器 ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border);
    padding: 18px; margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    margin-bottom: 14px;
}
.card-head h3 { font-size: 17px; color: var(--text); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 18px;
}
.stat-card {
    background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 20px; text-align: center;
}
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; padding: 9px 20px; border: none; border-radius: 22px;
    font-size: 14px; cursor: pointer; text-decoration: none; text-align: center;
    transition: background .2s, transform .1s; font-family: inherit; line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary-dark); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 16px; }
.btn-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text); font-size: 14px; }
.form-control {
    width: 100%; padding: 10px 12px; font-size: 15px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(1,173,157,.15); }
textarea.form-control { resize: vertical; }
.form-tip { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-line label { margin: 0; font-weight: 400; }

/* 楼层多选 chips */
.floor-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.check-chip { display: inline-flex; align-items: center; cursor: pointer; }
.check-chip input { display: none; }
.check-chip span {
    display: inline-block; padding: 8px 16px; border-radius: 20px;
    border: 1.5px solid var(--border); background: #fff; font-size: 14px;
    transition: all .15s;
}
.check-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 单选 chips */
.radio-line { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-chip input { accent-color: var(--primary); width: 16px; height: 16px; }

/* 预览框 */
.preview-box {
    padding: 14px; border-radius: 8px; background: var(--primary-light);
    border: 1.5px dashed var(--primary); color: var(--text-muted); font-weight: 600;
    word-break: break-all;
}
.preview-box.filled { color: var(--primary-dark); }

/* ---------- 上传区 ---------- */
.drop-zone {
    border: 2px dashed var(--primary); border-radius: 10px;
    background: var(--primary-light); padding: 34px 16px; text-align: center;
    cursor: pointer; transition: background .2s;
}
.drop-zone.dragover { background: #d3efeb; }
.dz-hint { color: var(--primary-dark); font-size: 15px; }

/* 照片网格 */
.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.photo-item { position: relative; display: block; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #f0f0f0; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .photo-del {
    position: absolute; top: 2px; right: 2px; width: 22px; height: 22px;
    background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%;
    font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.photo-item .photo-del:hover { background: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #f8fcfb; }
.td-strong { font-weight: 600; color: var(--text); word-break: break-all; }
.td-muted { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.td-actions { white-space: nowrap; }
.inline-form { display: inline; margin-left: 6px; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-gray { background: #eceff1; color: #607d8b; }
.badge-orange { background: #fdeee0; color: #e67e22; }
.badge-blue { background: #e3f2fd; color: #1976d2; }
.badge-purple { background: #ede7f6; color: #7b1fa2; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-teal { background: var(--primary-light); color: var(--primary-dark); }
.badge-red { background: #fdecea; color: var(--danger); }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.search-bar { display: flex; gap: 8px; }
.search-input { flex: 1; min-width: 180px; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c2; }
.alert-warning { background: #fff8e1; color: #b7791f; border: 1px solid #ffe082; }
.empty-tip { color: var(--text-muted); text-align: center; padding: 30px 0; }

/* ---------- 审批历史时间线 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-dot {
    position: absolute; left: -24px; top: 6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--primary); border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item.step-reject .timeline-dot { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.timeline-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.timeline-time { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }
.timeline-comment {
    margin-top: 6px; padding: 10px 12px; background: #f7faf9;
    border-radius: 8px; border-left: 3px solid var(--primary);
    color: var(--text); font-size: 14px;
}
.step-reject .timeline-comment { border-left-color: var(--danger); }
.timeline .photo-grid { margin-top: 8px; }

/* ---------- 详情网格 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 3px; }
.detail-value { font-size: 15px; color: var(--text); }
.detail-value.strong { font-weight: 700; color: var(--primary-dark); font-size: 16px; }

/* ---------- 模板树 ---------- */
.tree-row {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.tree-row:hover { background: #f8fcfb; }
.tree-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tree-icon { color: var(--primary); font-size: 13px; }
.tree-name { font-weight: 600; }
.tree-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- 站内信 ---------- */
.notif-list { list-style: none; }
.notif-item {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    padding: 14px 8px; border-bottom: 1px solid var(--border);
}
.notif-item.unread { background: var(--primary-light); border-radius: 8px; padding: 14px 12px; }
.notif-title { font-weight: 600; color: var(--text); }
.notif-text { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; word-break: break-all; }
.notif-meta { color: #999; font-size: 12.5px; margin-top: 6px; }
.notif-actions { flex-shrink: 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal {
    background: #fff; border-radius: 12px; width: 100%; max-width: 440px;
    max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; }
.modal-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-muted); line-height: 1; }

/* ---------- 登录页 ---------- */
.login-body {
    background: linear-gradient(160deg, var(--primary-light) 0%, #ffffff 55%, var(--primary-light) 100%);
    display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
    background: #fff; border-radius: 16px; border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 34px 28px;
}
.login-card.wide { max-width: 480px; margin: 0 auto; }
.login-logo { display: block; height: 80px; width: auto; margin: 0 auto 14px; }
.login-title { text-align: center; font-size: 19px; color: var(--primary-dark); margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.login-tip { text-align: center; color: #999; font-size: 12px; margin-top: 16px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 72px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 18px; border-radius: 10px; color: #fff; font-size: 14px;
    box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
    max-width: 320px;
}
.toast.success { background: var(--primary-dark); }
.toast.error { background: var(--danger); }
.toast.info { background: #607d8b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 灯箱 ---------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 400;
    display: flex; align-items: center; justify-content: center; padding: 30px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox-close {
    position: absolute; top: 14px; right: 20px; background: none; border: none;
    color: #fff; font-size: 40px; cursor: pointer; line-height: 1;
}

/* ---------- 页脚 ---------- */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .topbar-inner { padding: 10px 12px; }
    .brand-name { font-size: 15px; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-toggle { display: block; margin-left: auto; order: 3; }
    .main-nav { display: none; width: 100%; order: 4; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; padding-bottom: 8px; }
    .main-nav a { padding: 12px 14px; border-radius: 8px; }
    .topbar-right { order: 2; margin-left: auto; }
    .user-name { display: none; }
    .container { padding: 14px 12px 32px; }
    .card { padding: 14px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .photo-item { width: 84px; height: 84px; }
}
@media (max-width: 420px) {
    .login-card { padding: 26px 18px; }
    .form-actions .btn { flex: 1; }
}
