:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --primary: #1f7a4d;
  --primary-dark: #155c39;
  --accent: #e8a33d;
  --text: #1f2933;
  --muted: #6b7785;
  --border: #e3e8ee;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: linear-gradient(160deg, #1f7a4d 0%, #155c39 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 16px;
  padding: 28px 22px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--primary-dark); }
.login-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs .tab {
  flex: 1; padding: 8px 0; border: none; background: #eef2f0; color: var(--muted);
  border-radius: 8px; font-size: 13px; cursor: pointer;
}
.tabs .tab.active { background: var(--primary); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
}
.auth-form .row { display: flex; gap: 8px; }
.auth-form .row input { flex: 1; }
.auth-msg { min-height: 18px; color: var(--danger); font-size: 13px; margin-bottom: 4px; }
.link { color: var(--primary); font-size: 13px; text-align: right; cursor: pointer; }

/* 按钮 */
.btn {
  border: none; border-radius: 10px; padding: 11px 14px; font-size: 15px; cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-dark); }
.btn.outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); padding: 11px 10px; }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }

/* 主应用 */
.app-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-weight: 600; font-size: 16px; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.userbox .uemail { opacity: .9; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .urole {
  background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 10px; font-size: 11px;
}
.view { flex: 1; padding: 14px 14px 80px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff;
  border-top: 1px solid var(--border); padding: 6px 0; z-index: 20;
}
.nav-item {
  flex: 1; border: none; background: none; color: var(--muted); font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 4px 0;
}
.nav-item span { font-size: 18px; }
.nav-item.active { color: var(--primary); }

/* 卡片列表 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; margin: 0; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: pointer;
}
.card .c-name { font-weight: 600; font-size: 16px; }
.card .c-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card .c-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #eef2f0; color: var(--primary-dark); font-size: 12px; padding: 2px 8px; border-radius: 8px; }
.tag.amber { background: #fdf0d8; color: #9a6a12; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
  background: #fff;
}
.field textarea { min-height: 64px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; }
.repeat-item { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.repeat-item input { flex: 1; }
.repeat-item .del { background: #fdecea; color: var(--danger); border: none; border-radius: 8px; padding: 8px 10px; }
.add-link { color: var(--primary); font-size: 13px; cursor: pointer; display: inline-block; margin-top: 2px; }
.photo-prev { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px; overflow-y: auto; }

/* 看板 */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.kpi .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.bar-row .name { width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: #eef2f0; border-radius: 6px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-row .val { width: 70px; text-align: right; color: var(--muted); }

/* 分析 */
.analysis-block { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.analysis-block h4 { margin: 0 0 8px; font-size: 15px; }
.ai-out { background: #f6f9f7; border: 1px dashed var(--primary); border-radius: 10px; padding: 10px; margin-top: 8px; font-size: 14px; white-space: pre-wrap; }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 99;
}

/* 实名认证遮罩 */
.realname-view {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.realname-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; padding: 24px 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.realname-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--primary-dark); }
.realname-card .hint { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.realname-card .field { margin-bottom: 12px; }
.realname-card .field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.realname-card .field input {
  width: 100%; padding: 12px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: #fff;
}
.realname-card .auth-msg { min-height: 16px; color: var(--danger); font-size: 13px; margin: 8px 0 0; }
