/* 访客预约系统 · 交互原型共享样式（参考中医诊所 zhensuo2.0） */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --accent: #ff8c42;
  --danger: #ff4d4f;
  --warning: #faad14;
  --success: #52c41a;
  --text: #303133;
  --text-secondary: #909399;
  --border: #ebeef5;
  --bg: #f5f7fa;
  --white: #ffffff;
  --sidebar: #001529;
  --font: "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); }

a, button, [data-go], .clickable { cursor: pointer; }
a { text-decoration: none; color: inherit; }

.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; cursor: pointer; transition: opacity .2s;
}
.btn-primary:hover { opacity: .9; }
.btn-outline {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer;
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; border: none; color: var(--primary); cursor: pointer; }
.btn-danger-outline { background: #fff; color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer; }
.btn-success { background: var(--success); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer; }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer; }
.btn-default { background: #fff; color: #606266; border: 1px solid #dcdfe6; border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-green { background: #f6ffed; color: var(--success); }
.tag-red { background: #fff2f0; color: var(--danger); }
.tag-orange { background: #fff7e6; color: #d46b08; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-gray { background: #f4f4f5; color: #909399; }

.card { background: #fff; border-radius: 12px; padding: 16px; margin: 12px 16px; border: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.proto-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75); color: #fff; padding: 14px 24px; border-radius: 8px;
  font-size: 14px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .3s;
}
.proto-toast.show { opacity: 1; }

/* Launcher */
.launcher { min-height: 100vh; background: linear-gradient(135deg, #e8f0ff, #f0f0f0); display: flex; align-items: center; justify-content: center; padding: 24px; }
.launcher-box { background: #fff; border-radius: 16px; padding: 48px; max-width: 520px; width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,.08); text-align: center; }
.launcher h1 { color: var(--primary); margin-bottom: 8px; font-size: 26px; }
.launcher p { color: #999; margin-bottom: 32px; }
.launcher-links { display: flex; flex-direction: column; gap: 12px; }
.launcher-links a {
  display: block; padding: 16px 24px; border-radius: 10px; font-size: 16px; font-weight: 600;
  border: 2px solid var(--primary); color: var(--primary); transition: all .2s;
}
.launcher-links a:hover { background: var(--primary); color: #fff; }
.launcher-links a.secondary { border-color: var(--sidebar); color: var(--sidebar); }
.launcher-links a.secondary:hover { background: var(--sidebar); color: #fff; }

/* Phone frame */
.phone-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #2c2c2c; padding: 24px; }
.phone-frame { width: 375px; height: 812px; background: #fff; border-radius: 32px; overflow: hidden; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.phone-page { display: none; height: 100%; flex-direction: column; }
.phone-page.active { display: flex; }

.mp-status { height: 44px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.mp-nav { height: 44px; display: flex; align-items: center; padding: 0 16px; background: var(--primary); color: #fff; font-size: 17px; flex-shrink: 0; }
.mp-nav .back { margin-right: 8px; font-size: 20px; }
.mp-body { flex: 1; overflow-y: auto; background: var(--bg); }
.mp-body.with-tab { padding-bottom: 56px; }
.fixed-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #fff; border-top: 1px solid var(--border); display: flex; gap: 10px; z-index: 50; }
.fixed-bottom .btn-primary, .fixed-bottom .btn-outline, .fixed-bottom .btn-default { flex: 1; text-align: center; padding: 12px; }
.page-pad-bottom { padding-bottom: 72px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group label .req { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 14px;
}
.form-group textarea { min-height: 72px; resize: vertical; }

.info-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: #999; }
.info-row .value { color: #333; text-align: right; max-width: 60%; }

.list-item { display: block; background: #fff; border-radius: 12px; padding: 14px 16px; margin: 8px 16px; border: 1px solid var(--border); color: inherit; }
.list-item .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.list-item .no { font-weight: 600; font-size: 14px; }
.list-item .meta { font-size: 12px; color: #999; }
.list-item .info { font-size: 13px; color: #666; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: #e8e8e8; }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #d9d9d9; border: 2px solid #fff; }
.timeline-item.done::before { background: var(--success); }
.timeline-item.current::before { background: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,0.2); }
.timeline-item .t-title { font-size: 14px; font-weight: 500; }
.timeline-item .t-meta { font-size: 12px; color: #999; margin-top: 4px; }
.timeline-item .t-remark { font-size: 12px; color: #666; margin-top: 6px; padding: 8px; background: #fafafa; border-radius: 6px; }

.qr-code-mock { width: 180px; height: 180px; margin: 0 auto 16px; background: repeating-linear-gradient(45deg, #000 0, #000 4px, #fff 4px, #fff 8px); border: 8px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.success-icon { width: 64px; height: 64px; margin: 24px auto 16px; background: var(--success); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 32px; }

.scan-frame { width: 200px; height: 200px; margin: 0 auto 20px; border: 2px solid var(--primary); border-radius: 16px; position: relative; background: rgba(22,119,255,0.04); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 14px; }

.tab-bar { display: flex; background: #fff; border-radius: 8px; overflow: hidden; margin: 12px 16px; }
.tab-bar span { flex: 1; text-align: center; padding: 10px; font-size: 13px; color: #666; border-bottom: 2px solid transparent; }
.tab-bar span.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.mp-tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 56px; background: #fff;
  border-top: 1px solid var(--border); display: none; z-index: 100;
}
.mp-tabbar.show { display: flex; }
.mp-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 6px; font-size: 11px; color: #999; text-decoration: none;
}
.mp-tabbar a.active { color: var(--primary); font-weight: 500; }
.tab-icon-wrap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-bottom: 2px;
}
.tab-icon { width: 22px; height: 22px; color: #999; }
.mp-tabbar a.active .tab-icon { color: var(--primary); }
.wait-badge {
  position: absolute; top: -4px; right: -11px;
  min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 8px;
  font-size: 10px; font-weight: 600; text-align: center;
  border: 1.5px solid #fff; box-sizing: border-box;
}

.stat-mini-row { display: flex; gap: 10px; margin: 12px 16px; }
.stat-mini { flex: 1; background: #fff; border-radius: 12px; padding: 14px; text-align: center; border: 1px solid var(--border); }
.stat-mini .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-mini .label { font-size: 12px; color: #999; margin-top: 4px; }
.stat-mini.warn .num { color: var(--warning); }

.user-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 28px 16px 36px; color: #fff;
}
.user-header .name { font-size: 18px; font-weight: 600; }
.user-header .role { font-size: 13px; opacity: .85; margin-top: 4px; }

.proto-note { background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #ad6800; margin: 12px 16px; }

/* PC shell */
.pc-shell { min-height: 100vh; background: #e8eaed; }
.pc-frame { width: 100%; max-width: 1440px; margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.pc-topbar {
  height: 48px; background: var(--sidebar); color: #fff; display: flex; align-items: center;
  padding: 0 16px; font-size: 13px; gap: 20px; flex-shrink: 0;
}
.pc-topbar .brand { font-weight: 700; margin-right: 8px; }
.pc-topbar a { color: rgba(255,255,255,.65); text-decoration: none; padding: 4px 0; }
.pc-topbar a:hover, .pc-topbar a.active { color: #fff; border-bottom: 2px solid var(--primary); }
.pc-topbar .right { margin-left: auto; opacity: .85; }
.pc-page { display: none; flex: 1; }
.pc-page.active { display: flex; flex-direction: column; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1d2b64, #1677ff); }
.login-box { width: 400px; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.login-box h2 { text-align: center; margin-bottom: 8px; }
.login-box .subtitle { text-align: center; color: #999; margin-bottom: 24px; font-size: 13px; }
.login-box label { display: block; font-size: 13px; color: #666; margin-bottom: 12px; }
.login-box input { width: 100%; padding: 10px; margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; }

.page-content { padding: 16px 24px; flex: 1; overflow: auto; background: var(--bg); }
.search-bar { background: #fff; padding: 16px; border-radius: 4px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search-item label { display: block; font-size: 12px; color: #606266; margin-bottom: 4px; }
.search-item input, .search-item select { height: 32px; padding: 0 10px; border: 1px solid #dcdfe6; border-radius: 4px; min-width: 140px; }
.toolbar { background: #fff; padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.table-wrap { background: #fff; border-radius: 0 0 4px 4px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #fafafa; color: #909399; font-weight: 500; }
.data-table tr:hover td { background: #f5f7fa; }
.pagination { padding: 12px 16px; text-align: right; background: #fff; font-size: 13px; color: #606266; }

.stat-cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-card { flex: 1; min-width: 160px; background: #fff; padding: 20px; border-radius: 4px; border-left: 4px solid var(--primary); }
.stat-card:nth-child(2) { border-left-color: var(--warning); }
.stat-card:nth-child(3) { border-left-color: var(--success); }
.stat-card:nth-child(4) { border-left-color: var(--danger); }
.stat-card .num { font-size: 28px; font-weight: 600; color: #303133; }
.stat-card .label { font-size: 13px; color: #909399; margin-top: 4px; }

.panel { background: #fff; border-radius: 4px; margin-bottom: 16px; border: 1px solid var(--border); }
.panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.panel-body { padding: 16px; }
.desc-list { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; font-size: 13px; }
.desc-list dt { color: #909399; }
.desc-list dd { color: #303133; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.approval-form textarea { width: 100%; min-height: 80px; padding: 8px; border: 1px solid #dcdfe6; border-radius: 4px; resize: vertical; }
.approval-actions { display: flex; gap: 10px; margin-top: 16px; }

.timeline-admin { padding-left: 20px; }
.timeline-admin .item { position: relative; padding: 0 0 20px 20px; border-left: 2px solid #e4e7ed; }
.timeline-admin .item:last-child { border-left-color: transparent; }
.timeline-admin .dot { position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #c0c4cc; }
.timeline-admin .item.done .dot { background: var(--success); }
.timeline-admin .item.current .dot { background: var(--primary); }
.timeline-admin .item.reject .dot { background: var(--danger); }

.proto-badge {
  position: fixed; top: 12px; right: 12px; background: var(--primary); color: #fff;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; z-index: 8000; opacity: .9;
}
.role-hint { font-size: 12px; color: #999; margin-top: 16px; line-height: 1.6; }

.proto-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: none; align-items: center; justify-content: center;
}
.proto-modal-mask.open { display: flex; }
.proto-modal {
  background: #fff; border-radius: 8px; max-width: 95vw; max-height: 90vh; overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.staff-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.staff-toolbar input, .staff-toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.staff-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; padding: 20px; }
.staff-form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.staff-form-item input, .staff-form-item select, .staff-form-item textarea {
  width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px;
}
.staff-form-item.full { grid-column: 1 / -1; }
.perm-tree { font-size: 13px; line-height: 1.8; max-height: 360px; overflow: auto; padding: 8px 0; }
.perm-tree label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.perm-tree .perm-group { font-weight: 600; margin-top: 8px; color: #303133; }
.perm-tree .perm-child { padding-left: 24px; font-weight: normal; color: #606266; }
.nav-divider { color: rgba(255,255,255,.25); margin: 0 4px; }

@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
}
