/* 客户管理系统前端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2329;
  --muted: #6b7280;
  --danger: #e5484d;
  --warn: #e6a23c;
}
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: var(--text); }

/* ===== Ant Design Pro 布局 ===== */
.app-layout { display: flex; min-height: 100vh; }
.sider { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; }
.sider-logo { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.logo-icon { width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.logo-text { font-size: 16px; font-weight: 600; color: #001529; }
.menu { flex: 1; padding: 10px 8px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin: 2px 0; color: #445; font-size: 14px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: #f0f5ff; color: var(--primary); }
.menu-item.active { background: #e6f4ff; color: var(--primary); font-weight: 600; border-right: 3px solid var(--primary); }
.m-ico { font-size: 15px; width: 18px; text-align: center; }
.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-width: 0; }
.header { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.page-title { font-size: 18px; font-weight: 600; color: #1f2329; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-name { font-size: 14px; color: #333; }
.btn-logout { border: none; color: var(--muted); }
.btn-logout:hover { color: var(--danger); border: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* 按钮 */
.btn { padding: 7px 14px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 主区域（布局由 .content 接管） */
.view { display: none; }
.view.active { display: block; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar input[type=text] { flex: 1; max-width: 340px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--card); }

/* 表格 */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: #f6f9ff; }
td.company { font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.row-actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eaf2ff; color: var(--primary); }
.badge-warn { background: #fdf3e0; color: var(--warn); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* 统计 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.barchart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { width: 90px; text-align: right; color: var(--muted); }
.bar-track { flex: 1; background: #eef1f5; border-radius: 4px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; color: #fff; font-size: 11px; min-width: 24px; }
.follow-list { display: flex; flex-direction: column; gap: 10px; }
.follow-item { border-left: 3px solid var(--primary); padding: 6px 12px; background: #fafbfc; border-radius: 4px; font-size: 13px; }
.follow-item .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* 弹窗 */
.modal-mask[hidden] { display: none; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 50; }
.modal { background: var(--card); border-radius: 10px; padding: 20px 24px; width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; }
.modal-lg { max-width: 760px; }
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 5px; }
.form-grid input, .form-grid textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.form-grid input:focus { outline: none; border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; margin-bottom: 18px; }
.detail-grid .item { background: #fafbfc; border-radius: 6px; padding: 10px 12px; }
.detail-grid .item .k { color: var(--muted); font-size: 12px; }
.detail-grid .item .v { margin-top: 3px; }
.detail-follows h4 { margin: 10px 0; }
.timeline { border-left: 2px solid var(--border); padding-left: 16px; }
.timeline-item { position: relative; margin-bottom: 14px; }
.timeline-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.timeline-item .date { font-weight: 600; font-size: 13px; }
.timeline-item .content { margin: 4px 0; font-size: 13px; white-space: pre-wrap; line-height: 1.6; }
.timeline-item .next { color: var(--warn); font-size: 12px; }
.timeline-item .status { color: var(--muted); font-size: 12px; }
.add-follow { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.add-follow h4 { margin-bottom: 12px; }
.add-follow .form-grid { grid-template-columns: 1fr; }

/* 登录界面 */
.login-mask { position: fixed; inset: 0; background: #eef1f5; display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-mask[hidden] { display: none; }
.login-box { background: #fff; padding: 36px 40px; border-radius: 12px; width: 340px; box-shadow: 0 10px 40px rgba(15,23,42,.1); text-align: center; }
.login-logo { width: 54px; height: 54px; margin: 0 auto 14px; background: var(--primary); color: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.login-box h2 { font-size: 20px; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; margin-bottom: 12px; box-sizing: border-box; }
.login-box input:focus { outline: none; border-color: var(--primary); }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }

/* ================= 整体美化增强 ================= */
body { background: linear-gradient(180deg, #f0f4fb 0%, #f5f7fa 240px); }

/* 顶栏渐变 */
.topbar { background: linear-gradient(90deg, #1f6feb 0%, #4a8df0 100%); border-bottom: none; box-shadow: 0 2px 14px rgba(31,111,235,.25); }
.topbar .brand h1 { color: #fff; }
.logo { background: rgba(255,255,255,.18); color: #fff; }
.tab { color: rgba(255,255,255,.85); }
.tab:hover { background: rgba(255,255,255,.14); color: #fff; }
.tab.active { background: rgba(255,255,255,.24); color: #fff; font-weight: 600; }

/* 按钮 */
.btn-primary { background: var(--primary); border: none; box-shadow: 0 4px 12px rgba(24,144,255,.28); }
.btn-primary:hover { background: var(--primary-dark); border: none; }

/* 卡片与表格 */
.card { border-radius: 14px; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.stat-card { border-radius: 12px; }
.table-wrap { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
thead th { background: #eef4fb; color: #3a4150; position: sticky; top: 0; }
tbody tr:nth-child(even) { background: #fafcff; }
tbody tr:hover { background: #eef4ff; }

/* ================= 控制台 ================= */
.dash-hero { background: linear-gradient(135deg,#1890ff 0%,#36cfc9 130%); color: #fff; border-radius: 16px; padding: 28px 32px; margin-bottom: 20px; box-shadow: 0 10px 26px rgba(24,144,255,.30); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dash-hero-inner h2 { font-size: 26px; margin-bottom: 6px; }
.dash-sub { opacity: .88; font-size: 14px; }
.dash-countdown { text-align: right; flex-shrink: 0; }
.cd-label { font-size: 14px; opacity: .92; margin-bottom: 6px; }
.cd-time { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; white-space: nowrap; }
/* 悬浮下班倒计时（网页右下角，每个页面都显示） */
.float-countdown { position: fixed; right: 20px; bottom: 20px; z-index: 9997; background: rgba(24,144,255,.95); color: #fff; border-radius: 12px; padding: 10px 16px; box-shadow: 0 6px 18px rgba(24,144,255,.35); text-align: center; user-select: none; }
.fc-label { font-size: 12px; opacity: .9; margin-bottom: 4px; }
.fc-time { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; white-space: nowrap; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 14px; margin-bottom: 20px; }
.dash-card { background: #fff; border-radius: 14px; padding: 18px 16px; box-shadow: 0 4px 14px rgba(15,23,42,.06); border-top: 4px solid var(--c,#1f6feb); }
.dash-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; color: #fff; }
.dash-card .num { font-size: 26px; font-weight: 700; }
.dash-card .label { color: var(--muted); font-size: 13px; }
.dash-card.c-blue{border-color:#1f6feb}.dash-card.c-blue .dash-icon{background:#1f6feb}
.dash-card.c-green{border-color:#22a06b}.dash-card.c-green .dash-icon{background:#22a06b}
.dash-card.c-red{border-color:#e5484d}.dash-card.c-red .dash-icon{background:#e5484d}
.dash-card.c-orange{border-color:#e6a23c}.dash-card.c-orange .dash-icon{background:#e6a23c}
.dash-card.c-purple{border-color:#7b5cff}.dash-card.c-purple .dash-icon{background:#7b5cff}
.dash-card.c-cyan{border-color:#0ea5a0}.dash-card.c-cyan .dash-icon{background:#0ea5a0}
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); gap: 14px; }
.dash-todo-block { border-radius: 14px; overflow: hidden; }
.todo-title { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 14px 16px; margin: 0; color: #fff; border-radius: 12px 12px 0 0; }
.overdue-title { background: linear-gradient(90deg,#e5484d,#ef6b70); }
.today-title { background: linear-gradient(90deg,#e6a23c,#f0b64c); }
.upcoming-title { background: linear-gradient(90deg,#1f6feb,#4a8df0); }
.todo-badge { background: rgba(255,255,255,.25); padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.todo-list { padding: 8px; }
.todo-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.todo-item:hover { background: #f0f4fb; }
.todo-item + .todo-item { border-top: 1px dashed #e3e8ef; }
.todo-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-company { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta { color: var(--muted); font-size: 12px; }
.todo-extra { text-align: right; flex-shrink: 0; }
.todo-date { display: block; font-size: 12px; color: var(--muted); }
.todo-flag { font-size: 12px; font-weight: 600; }
#todoOverdue .todo-flag { color: #e5484d; }
#todoToday .todo-flag { color: #e6a23c; }
#todoUpcoming .todo-flag { color: #1f6feb; }
.todo-empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

/* 登录页 antd 风格 */
.login-mask { background: linear-gradient(135deg,#1890ff 0%,#36cfc9 130%); }
.login-box { border-radius: 12px; padding: 40px 42px; box-shadow: 0 8px 28px rgba(24,144,255,.20); }
.login-logo { background: var(--primary); box-shadow: 0 8px 18px rgba(24,144,255,.38); }
.login-box h2 { color: #23293a; }

/* ===== 每日彩蛋：撒花 ===== */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti { position: absolute; top: -14px; opacity: .95; will-change: transform; animation: confetti-fall linear forwards; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(106vh) rotate(720deg); opacity: .55; }
}

/* ===== 鼠标特效：点击波纹 + 移动光点 ===== */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden; }
.fx-ripple { position: absolute; border: 2px solid rgba(24,144,255,.55); border-radius: 50%; transform: translate(-50%,-50%) scale(0); opacity: 1; animation: fx-ripple .8s ease-out forwards; }
@keyframes fx-ripple { 100% { transform: translate(-50%,-50%) scale(1.7); opacity: 0; } }
.fx-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%,-50%); opacity: .8; animation: fx-dot .7s ease-out forwards; }
@keyframes fx-dot { to { transform: translate(-50%,-50%) translateY(-34px) scale(0); opacity: 0; } }

/* ===== 控制台信息模块：天气 / 热搜 / 资讯 ===== */
.info-module { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.info-module .card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.info-module h3 { font-size: 15px; margin-bottom: 12px; color: #23293a; }
.weather-body { display: flex; align-items: center; gap: 18px; }
.weather-temp { font-size: 42px; font-weight: 700; color: #1890ff; }
.weather-meta { font-size: 13px; color: #666; line-height: 1.9; }
.weather-code { font-size: 14px; color: #333; }
.hot-list { margin: 0; padding: 0; list-style: none; }
.hot-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: #333; }
.hot-rank { width: 20px; height: 20px; border-radius: 4px; background: #f0f2f5; color: #999; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hot-list li:nth-child(-n+3) .hot-rank { background: #ff4d4f; color: #fff; }
.news-list { margin: 0; padding: 0; list-style: none; }
.news-list li { padding: 5px 0; border-bottom: 1px dashed #f0f0f0; }
.news-list li:last-child { border-bottom: none; }
.news-list a { font-size: 13px; color: #333; text-decoration: none; line-height: 1.5; display: block; }
.news-list a:hover { color: #1890ff; }

/* ===== 下班提醒全屏弹层 ===== */
.down-alert { position: fixed; inset: 0; z-index: 10001; background: rgba(24,144,255,.55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.down-alert[hidden] { display: none; }
.down-alert-box { background: #fff; border-radius: 20px; padding: 40px 58px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.22); animation: down-pop .5s ease; }
@keyframes down-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.down-alert-emoji { font-size: 46px; margin-bottom: 12px; }
.down-alert-title { font-size: 40px; font-weight: 800; color: #1890ff; margin-bottom: 10px; }
.down-alert-time { font-size: 20px; color: #333; margin-bottom: 8px; }
.down-alert-sub { font-size: 14px; color: #888; margin-bottom: 22px; }
.down-alert-close { min-width: 120px; }

/* ===== 移动端响应式 ===== */
.header-left { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: none; font-size: 22px; color: #333; cursor: pointer; border-radius: 6px; }
.menu-toggle:active { background: #f0f2f5; }

@media (max-width: 992px) {
  .info-module { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .sider { transform: translateX(-100%); transition: transform .28s ease; box-shadow: none; }
  .app-layout.menu-open .sider { transform: translateX(0); box-shadow: 0 0 0 100vmax rgba(15,23,42,.4); }
  .main { margin-left: 0; }
  .content { padding: 14px; }
  .header { padding: 0 12px; }
  .page-title { font-size: 16px; }
  .user-name { display: none; }
  .info-module { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 18px; }
  .dash-countdown { text-align: left; }
  .cd-time { font-size: 24px; }
  .float-countdown { right: 10px; bottom: 10px; padding: 8px 12px; }
  .fc-time { font-size: 15px; }
  .login-box { width: 92%; max-width: 92%; padding: 28px 20px; }
  .modal { max-width: 96%; padding: 16px 14px; }
  .modal-mask { padding: 20px 10px; }
  .down-alert-box { padding: 28px 22px; width: 90%; }
  .down-alert-title { font-size: 28px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input[type=text] { flex: 1 1 100%; max-width: none; }
  .table-wrap { overflow-x: auto; }
  .table-wrap table { min-width: 860px; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
