/* 保险客户管家 样式（桌面+手机自适应）· 美化版 */
:root {
  --primary: #1667b8;
  --primary-deep: #0d4f92;
  --primary-grad: linear-gradient(135deg, #1f7ad1, #0d5ea8);
  --primary-light: #e9f2fb;
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #26303f;
  --muted: #77839a;
  --border: #e4e9f1;
  --danger: #d64545;
  --ok: #22a06b;
  --warn: #e8a13c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 50, 90, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 50, 90, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; background: linear-gradient(160deg, #f3f6fa 0%, #e9eff7 100%); color: var(--text); -webkit-font-smoothing: antialiased; }
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 216px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; box-shadow: 4px 0 18px rgba(20,50,90,.04); }
.logo { font-size: 17px; font-weight: 700; padding: 20px 16px; background: var(--primary-grad); color: #fff; letter-spacing: .5px; }
.sidebar nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 5px; }
.sidebar nav a { padding: 12px 15px; border-radius: 11px; cursor: pointer; font-size: 15px; color: var(--text); transition: all .18s; }
.sidebar nav a:hover { background: var(--primary-light); color: var(--primary-deep); }
.sidebar nav a.active { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 12px rgba(23,103,184,.35); }
.sidebar-foot { padding: 14px 16px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border); }

.main { flex: 1; padding: 26px; max-width: 1100px; margin: 0 auto; }
h2.page-title { font-size: 22px; margin-bottom: 6px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
h3.sec { font-size: 14px; margin: 18px 0 10px; color: var(--muted); font-weight: 600; letter-spacing: .5px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h4 { margin-bottom: 8px; font-size: 15px; }

/* 按钮 */
.btn { display: inline-block; border: none; border-radius: 10px; padding: 9px 17px; font-size: 14px; cursor: pointer; background: var(--primary-grad); color: #fff; transition: all .18s; box-shadow: 0 3px 10px rgba(23,103,184,.25); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(23,103,184,.32); }
.btn:active { transform: translateY(0); }
.btn.gray { background: #eef1f6; color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.gray:hover { background: #e4e9f1; }
.btn.red { background: linear-gradient(135deg, #e25c5c, #c73a3a); box-shadow: 0 3px 10px rgba(214,69,69,.28); }
.btn.green { background: linear-gradient(135deg, #2eb377, #1d8a58); box-shadow: 0 3px 10px rgba(34,160,107,.28); }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn + .btn { margin-left: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* 表单 */
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fbfcfe; color: var(--text); transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,122,209,.12); background: #fff; }
textarea { min-height: 60px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.req::after { content: " *"; color: var(--danger); }

/* 提醒列表 */
.rem-item { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; transition: background .15s; }
.rem-item:last-child { border-bottom: none; }
.rem-item:hover { background: #f8fafd; }
.rem-item.t-birthday { border-left-color: var(--danger); }
.rem-item.t-policy { border-left-color: var(--primary); }
.rem-item.t-festival { border-left-color: #e8a13c; }
.rem-item.t-term { border-left-color: var(--ok); }
.rem-item.t-event { border-left-color: #8a5cd6; }
.rem-item.t-assess { border-left-color: #10618f; }
.rem-date { min-width: 74px; text-align: center; background: #f2f6fb; border-radius: 10px; padding: 7px 4px; }
.rem-date .d { font-size: 18px; font-weight: 700; color: var(--primary-deep); }
.rem-date .dl { font-size: 11px; color: var(--muted); }
.rem-body { flex: 1; }
.rem-title { font-size: 15px; font-weight: 600; }
.rem-detail { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; margin-right: 6px; font-weight: 500; }
.tag.birthday { background: #fdeeee; color: var(--danger); }
.tag.policy { background: #e8f2fb; color: var(--primary-deep); }
.tag.festival { background: #fff3e2; color: #b06f10; }
.tag.term { background: #eaf7ef; color: var(--ok); }
.tag.event { background: #f0e9fb; color: #7a4bbd; }
.tag.assess { background: #e2f0fa; color: #10618f; }
.tag.lv-urgent { background: var(--danger); color: #fff; }
.tag.lv-warn { background: var(--warn); color: #fff; }
.tag.lv-ok { background: #dfe5ec; color: var(--muted); }

/* 客户列表 */
.client-row { display: flex; align-items: center; gap: 13px; padding: 12px 8px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; transition: background .15s; }
.client-row:hover { background: var(--primary-light); }
.client-row:last-child { border-bottom: none; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex-shrink: 0; box-shadow: 0 3px 8px rgba(23,103,184,.25); }
.c-info { flex: 1; min-width: 0; }
.c-name { font-weight: 600; font-size: 15px; }
.c-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-chip { font-size: 13px; color: var(--primary-deep); background: var(--primary-light); border-radius: 20px; padding: 4px 14px; font-weight: 600; }

/* 页签 */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 15px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; color: var(--muted); transition: color .15s; }
.tabs a:hover { color: var(--primary-deep); }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* 记录条目 */
.rec { border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; background: #fbfcfe; transition: box-shadow .15s; }
.rec:hover { box-shadow: var(--shadow); }
.rec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.rec-title { font-weight: 600; }
.rec-meta { font-size: 12.5px; color: var(--muted); line-height: 1.8; }

/* 架构树 */
.group-box { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
.group-head { padding: 13px 16px; background: var(--primary-light); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
table.tbl th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #f8fafc; }
table.tbl tr:last-child td { border-bottom: none; }

/* 身份卡 */
.id-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); }
.id-card.warning { border-color: #f0c27a; background: #fffaf0; }
.id-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.status-badge { font-size: 12px; padding: 3px 11px; border-radius: 20px; font-weight: 600; }
.status-badge.ok { background: #eaf7ef; color: var(--ok); }
.status-badge.warn { background: #fdeeee; color: var(--danger); }
.status-badge.pending { background: #fff3e2; color: #b06f10; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 30, 55, .45); backdrop-filter: blur(2px); display: none; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 30px 12px; }
.modal-mask.show { display: flex; animation: fadeIn .18s; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 680px; padding: 24px; margin-bottom: 30px; animation: slideUp .22s; box-shadow: 0 20px 50px rgba(10, 30, 60, .25); }
.confirm-mask { z-index: 60; }
.confirm-modal { max-width: 420px; }
.confirm-modal p { font-size: 14.5px; line-height: 1.8; margin: 6px 0 4px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.modal h3 { margin-bottom: 14px; font-size: 17px; }
.modal-actions { margin-top: 18px; text-align: right; }

/* 确认图标 */
.confirm-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 10px; }
.confirm-icon.warn { background: #fdeeee; }

/* Toast */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(25, 38, 60, .94); color: #fff; padding: 11px 24px; border-radius: 26px; font-size: 14px; display: none; z-index: 99; white-space: pre-line; max-width: 86vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* 工具行 */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { flex: 1; min-width: 180px; max-width: 420px; }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 14px; }

/* 登录页 */
.login-screen { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf3fb 0%, #f6f9fd 55%, #eef7f1 100%); }
.login-box { width: min(360px, 92vw); background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(30,60,100,.16); padding: 30px 28px 26px; }
.login-logo { font-size: 21px; font-weight: 800; text-align: center; }
.login-sub { font-size: 12.5px; color: var(--muted); text-align: center; margin: 8px 0 20px; }
.login-btn { width: 100%; margin-top: 16px; padding: 11px; font-size: 15px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.whoami { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.logout-link { font-size: 12.5px; color: var(--danger); text-decoration: none; }
.logout-link:hover { text-decoration: underline; }

/* 导入 */
.import-box { border: 1.5px dashed var(--border); border-radius: 12px; padding: 16px; background: #f8fafc; margin: 10px 0; }
.import-box p { font-size: 13.5px; margin: 8px 0; line-height: 1.8; }
.import-err { background: #fdeeee; border: 1px solid #f3c1c1; border-radius: 10px; padding: 10px 14px; margin-top: 10px; font-size: 13px; color: #a33; white-space: pre-line; max-height: 200px; overflow-y: auto; }
.import-ok { background: #eaf7ef; border: 1px solid #bfe6d2; border-radius: 10px; padding: 10px 14px; margin-top: 10px; font-size: 13px; color: var(--ok); }

/* 提醒中心归类窗口 */
.sec-card { padding: 14px 6px 6px; }
/* 提醒中心左右两纵列 */
.rem-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rem-col { min-width: 0; }
.rem-col .card { margin-bottom: 0; }
.rem-col .sec-card { margin-bottom: 16px; }
@media (max-width: 860px) { .rem-cols { grid-template-columns: 1fr; } }
.sec-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 12px 12px; border-bottom: 2px solid var(--border); margin-bottom: 6px; }
.sec-head > span:first-child { font-weight: 700; font-size: 15.5px; }
.sec-desc { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.count-chip.zero { background: #eef1f6; color: var(--muted); }
.rem-item .rem-body { min-width: 0; }
.rem-ack { flex-shrink: 0; align-self: center; }

/* 7 天内紧急事项：醒目提醒 */
.rem-item.urgent { background: #fff6ee; border-radius: 10px; }
.rem-item.urgent .rem-title { font-size: 17px; font-weight: 800; color: #b03030; }
.rem-item.urgent .rem-date { background: #fdeeee; }
.rem-item.urgent .rem-date .d { font-size: 21px; color: var(--danger); font-weight: 800; }
.rem-item.urgent .rem-detail { color: #8a6a4a; }
.rem-item.urgent.t-birthday { border-left-color: var(--danger); box-shadow: inset 0 0 0 1px #f3c1c1; }

/* 手机端 */
@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: 100%; height: auto; border-top: 1px solid var(--border); border-right: none; z-index: 30; padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(10px); background: rgba(255,255,255,.92); }
  .logo { display: none; }
  .sidebar nav { flex-direction: row; padding: 5px 3px; }
  .sidebar nav a { flex: 1; text-align: center; font-size: 12px; padding: 9px 2px; border-radius: 9px; }
  .sidebar nav a.active { box-shadow: 0 3px 10px rgba(23,103,184,.3); }
  .sidebar-foot { display: none; }
  .main { padding: 16px 13px 86px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .modal { padding: 18px; }
  .modal-mask { padding: 16px 8px; }
}

/* ---------- 每日健康快讯 ---------- */
.news-card { padding: 14px 16px; }
.news-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.news-title { font-weight: 700; font-size: 15.5px; flex: 1; min-width: 200px; }
.news-meta { display: flex; gap: 8px; align-items: center; }
.news-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.news-img { width: 100%; max-width: 420px; border-radius: 10px; margin: 10px 0 0; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.news-content { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13.5px; line-height: 1.8; background: #fafbfc; border: 1px solid #eef1f4; border-radius: 10px; padding: 12px 14px; margin: 10px 0 0; max-height: 460px; overflow: auto; }
