/* 律师团队工作日志系统 - 深藏青 + 金色 专业风格 */
:root {
  --navy: #14264e;
  --navy-deep: #0c1836;
  --navy-soft: #2a3f6e;
  --gold: #c2a14d;
  --gold-light: #e7d8ac;
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #232936;
  --text-2: #6b7280;
  --line: #e5e7eb;
  --danger: #d64541;
  --ok: #1e8e5a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 38, 78, .08), 0 8px 24px rgba(20, 38, 78, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 布局骨架 ---------- */
#app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 60%, #1b315c);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  box-shadow: 0 2px 10px rgba(12, 24, 54, .35);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 1px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--gold); color: var(--navy-deep); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.user-chip {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  min-height: 36px; display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.user-chip .role-tag { color: var(--gold-light); }
.user-menu { position: absolute; right: 12px; top: 60px; background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; min-width: 170px; z-index: 99; }
.user-menu button { display: block; width: 100%; text-align: left; padding: 13px 18px; background: none; border: 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.user-menu button:last-child { border-bottom: 0; }

.page { max-width: 680px; margin: 0 auto; padding: 16px 14px 110px; }

/* 底部标签栏（手机） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(20, 38, 78, .08);
}
.tabbar button {
  flex: 1; background: none; border: 0; padding: 8px 2px 7px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-2); font-size: 11px; min-height: 56px;
}
.tabbar button .ticon { font-size: 20px; line-height: 1.1; }
.tabbar button.active { color: var(--navy); font-weight: 600; }
.tabbar button.active .ticon { color: var(--gold); }

/* 顶部导航（电脑端） */
.topnav { background: #fff; border-bottom: 1px solid var(--line); display: none; position: sticky; top: 60px; z-index: 40; }
.topnav button { background: none; border: 0; padding: 13px 22px; cursor: pointer; color: var(--text-2); font-size: 14px; border-bottom: 3px solid transparent; }
.topnav button.active { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 14px; font-size: 16px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 16px; background: var(--gold); border-radius: 2px; display: inline-block; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field .req { color: var(--danger); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
input[type=text], input[type=date], input[type=time], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: #fff; outline: none; min-height: 46px; font-size: 15px;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(42, 63, 110, .12); }
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; 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='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.btn {
  border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; font-weight: 600;
  background: var(--navy); color: #fff; min-height: 46px; transition: transform .05s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.98); }
.btn.gold { background: var(--gold); color: var(--navy-deep); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost-gold { background: #fff; color: #9c7c2b; border: 1.5px solid var(--gold); }
.btn.danger { background: var(--danger); }
.btn.sm { min-height: 38px; padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.hint { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.err { font-size: 13px; color: var(--danger); margin-top: 5px; display: none; }
.err.show { display: block; }
.ok-note { font-size: 13px; color: var(--ok); margin-top: 5px; }

/* 保存栏（手机固定底部） */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 62px; z-index: 55; padding: 10px 14px 12px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(244,245,248,0));
  max-width: 680px; margin: 0 auto;
}
.savebar .btn { width: 100%; font-size: 17px; padding: 15px; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, #1d3468 100%); display: flex; flex-direction: column; align-items: center; padding: 48px 18px 40px; }
.login-logo { width: 74px; height: 74px; border-radius: 20px; background: var(--gold); color: var(--navy-deep); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin: 18px 0 4px; letter-spacing: 2px; }
.login-sub { color: var(--gold-light); font-size: 13px; letter-spacing: 3px; margin-bottom: 30px; }
.login-card { background: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 22px 18px; width: 100%; max-width: 640px; }
.login-card h2 { margin: 0 0 6px; font-size: 17px; color: var(--navy); }
.login-group-title { font-size: 12px; color: var(--text-2); margin: 14px 0 7px; letter-spacing: 1px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.member-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 13px 10px;
  cursor: pointer; text-align: center; min-height: 62px; transition: all .12s;
}
.member-btn .nm { font-weight: 600; font-size: 15px; color: var(--text); }
.member-btn .rl { font-size: 11px; color: var(--gold); margin-top: 2px; }
.member-btn:active, .member-btn.picked { border-color: var(--gold); background: #fdf9ee; }
.login-pw-row { display: flex; gap: 8px; margin-top: 6px; }
.login-pw-row input { flex: 1; }
.login-tip { font-size: 12px; color: var(--text-2); margin-top: 10px; text-align: center; }

/* ---------- 备案信息页脚 ---------- */
.site-foot { text-align: center; font-size: 12px; color: var(--text-2); padding: 16px 12px calc(76px + env(safe-area-inset-bottom)); line-height: 1.9; }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot img { vertical-align: -3px; margin-right: 3px; }
.login-wrap .site-foot { padding: 20px 12px 10px; }
.login-card .site-foot { color: var(--text-2); padding: 14px 0 2px; font-size: 12px; }
.login-card .site-foot a { color: var(--text-2); }

/* 登录入口（正式员工 / 实习生） */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.entry-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 18px 12px;
  cursor: pointer; text-align: center; transition: all .12s;
}
.entry-btn .en-icon { font-size: 30px; line-height: 1.2; }
.entry-btn .en-name { font-size: 17px; font-weight: 700; color: var(--navy); margin-top: 6px; }
.entry-btn .en-desc { font-size: 11.5px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.entry-btn:active, .entry-btn:hover { border-color: var(--gold); background: #fdf9ee; }
.remember-row { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); margin: 2px 0 4px; cursor: pointer; }
.remember-row input { width: 17px; height: 17px; accent-color: #c9a557; cursor: pointer; }
@media (max-width: 420px) { .entry-grid { grid-template-columns: 1fr; } }

/* ---------- 日志卡片 ---------- */
.log-item { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; background: #fff; }
.log-item .li-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.log-item .li-title { font-weight: 650; color: var(--navy); font-size: 15px; }
.log-item .li-dur { color: #9c7c2b; font-weight: 700; font-size: 14px; white-space: nowrap; }
.log-item .li-meta { font-size: 12.5px; color: var(--text-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.log-item .li-content { font-size: 13.5px; margin-top: 7px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.log-item .li-actions { display: flex; gap: 8px; margin-top: 10px; }
.date-group-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; color: var(--navy); font-weight: 700; font-size: 15px; }
.date-group-title .sum { color: #9c7c2b; font-size: 13px; }
.type-pill { display: inline-block; background: #eef1f8; color: var(--navy-soft); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-bar .span2 { grid-column: span 2; }
.filter-bar select, .filter-bar input { min-height: 44px; }

/* ---------- 快捷时长 ---------- */
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-row button {
  flex: 1; min-width: 64px; min-height: 42px; border-radius: 10px; border: 1.5px solid var(--gold);
  background: #fdfaf1; color: #9c7c2b; font-weight: 700; cursor: pointer; font-size: 13.5px;
}
.quick-row button:active { background: var(--gold-light); }
.dur-display { background: #eef1f8; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--navy); }
.dur-display .v { color: #9c7c2b; font-size: 17px; }
.dur-display.bad { background: #fdeeee; color: var(--danger); }

/* ---------- 麦克风 ---------- */
.mic-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; width: 46px; min-width: 46px;
  cursor: pointer; font-size: 19px; display: flex; align-items: center; justify-content: center; color: var(--navy);
}
.mic-btn.rec { border-color: var(--danger); color: #fff; background: var(--danger); animation: pulse 1.1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(214,69,65,.5); } 70% { box-shadow: 0 0 0 10px rgba(214,69,65,0); } 100% { box-shadow: 0 0 0 0 rgba(214,69,65,0); } }
.speech-status { font-size: 12.5px; margin-top: 6px; color: var(--navy-soft); min-height: 18px; }
.speech-status.err { color: var(--danger); }

/* 客户搜索下拉 */
.cust-drop { position: relative; }
.cust-drop .drop-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; z-index: 30;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto;
}
.cust-drop .drop-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #f2f3f6; min-height: 46px; }
.cust-drop .drop-list button:last-child { border-bottom: 0; }
.cust-drop .drop-list button mark { background: var(--gold-light); border-radius: 3px; padding: 0 2px; }
.picked-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef7f0; color: var(--ok); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; margin-top: 6px; }

/* ---------- 番茄钟 ---------- */
.pomo-display { text-align: center; font-size: 44px; font-weight: 800; color: var(--navy); letter-spacing: 3px; font-variant-numeric: tabular-nums; margin: 6px 0; }
.pomo-display.running { color: var(--gold); }
.pomo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pomo-btns .btn { flex: 1; min-width: 88px; }
.pomo-assoc { font-size: 12.5px; color: var(--text-2); margin-top: 10px; text-align: center; min-height: 18px; }

/* ---------- 智能解析 ---------- */
.smart-box { background: linear-gradient(135deg, #fdf9ee, #fff); border: 1.5px dashed var(--gold); }
.smart-result { margin-top: 10px; font-size: 13px; }
.smart-result .tag { display: inline-block; background: #eef1f8; border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; color: var(--navy); }
.smart-result .tag.miss { background: #fdeeee; color: var(--danger); }

/* ---------- 汇总 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-card .num small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.stat-card .lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.chart-box svg { width: 100%; height: auto; }
.export-btns { display: grid; gap: 10px; }

/* ---------- 管理页 ---------- */
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.subtabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; color: var(--text-2); white-space: nowrap; min-height: 40px; font-size: 13.5px; }
.subtabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f1f4; flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.admin-row .grow { flex: 1; min-width: 130px; }
.admin-row .nm { font-weight: 600; }
.badge { font-size: 11px; border-radius: 999px; padding: 1px 9px; background: #eef1f8; color: var(--navy-soft); }
.badge.gold { background: #fdf3d9; color: #9c7c2b; }
.badge.off { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.appr-diff { background: #f8f9fb; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.appr-diff .del { color: var(--danger); text-decoration: line-through; }
.appr-diff .add { color: var(--ok); }

/* ---------- 弹层 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(12, 24, 54, .55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: #fff; width: 100%; max-width: 680px; border-radius: 18px 18px 0 0; padding: 18px 16px 26px;
  max-height: 88vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; color: var(--navy); font-size: 17px; }
.modal-close { border: 0; background: #f0f1f4; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; font-size: 16px; color: var(--text-2); }

/* toast */
#toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; width: min(92vw, 420px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--navy-deep); color: #fff; border-radius: 12px; padding: 12px 18px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: fadein .2s; border-left: 4px solid var(--gold); }
.toast.err { border-left-color: var(--danger); background: #7a2222; }
.toast.ok { border-left-color: var(--ok); }
@keyframes fadein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

.empty { text-align: center; color: var(--text-2); padding: 36px 10px; font-size: 14px; }
.section-note { font-size: 12.5px; color: var(--text-2); margin: -6px 0 12px; }

/* ---------- 电脑端 ---------- */
@media (min-width: 768px) {
  body { font-size: 14.5px; }
  .page { max-width: 720px; padding: 22px 20px 140px; }
  .tabbar { display: none; }
  .topnav { display: flex; justify-content: center; gap: 6px; }
  .topnav button { font-size: 15px; padding: 13px 26px; }
  .savebar { position: sticky; bottom: 14px; background: none; padding: 8px 0; }
  .modal-mask { align-items: center; }
  .modal { border-radius: 18px; padding: 22px 24px 26px; }
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .site-foot { padding: 18px 12px 26px; }
}
