* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #6d28d9; --primary-d: #5b21b6;
  --bg: #f3f4f8; --panel: #fff; --border: #ececf2;
  --text: #1f2430; --muted: #8a8fa3;
  --green: #16a34a; --red: #dc2626; --blue: #2563eb; --amber: #d97706;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* 登录 */
.login-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1f2a52, #6d28d9); }
.login-box { width: 86%; max-width: 340px; background: #fff; border-radius: 18px; padding: 32px 24px; }
.login-brand { text-align: center; font-size: 20px; font-weight: 700; color: var(--primary); }
.login-sub { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 22px; }
.login-box label { display: block; font-size: 13px; color: #555; margin: 14px 0 6px; }
.login-box input { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 15px; outline: none; }
.login-box input:focus { border-color: var(--primary); }
.login-err { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 8px; }
.login-box button { width: 100%; height: 46px; margin-top: 18px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 600; }
.login-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.login-back { display: block; text-align: center; margin-top: 12px; font-size: 12px; color: var(--primary); text-decoration: none; }

/* App */
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 52px; background: var(--primary); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.topbar .t { font-size: 17px; font-weight: 600; }
.topbar .add { background: rgba(255,255,255,.2); border: none; color: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; }
.content { flex: 1; overflow-y: auto; padding: 14px; padding-bottom: 80px; }

/* 卡片/统计 */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.section-title { font-size: 14px; font-weight: 600; margin: 4px 2px 12px; color: #444; }

/* 列表项 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.item .l1 { display: flex; justify-content: space-between; align-items: center; }
.item .name { font-size: 15px; font-weight: 600; }
.item .sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.item .right { font-size: 13px; font-weight: 600; color: var(--primary); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.tag.green { background: #dcfce7; color: var(--green); }
.tag.red { background: #fee2e2; color: var(--red); }
.tag.blue { background: #dbeafe; color: var(--blue); }
.tag.amber { background: #fef3c7; color: var(--amber); }
.tag.gray { background: #eef0f4; color: #6b7080; }

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

/* 搜索 */
.search { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 14px; outline: none; margin-bottom: 12px; background: #fff; }
.search:focus { border-color: var(--primary); }

/* 底部 Tab */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: 58px; background: #fff;
  border-top: 1px solid var(--border); display: flex; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #9aa0b0; text-decoration: none; font-size: 11px; gap: 2px; }
.tabbar a .ic { font-size: 20px; }
.tabbar a.active { color: var(--primary); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,12,30,.45); }
.modal-card { position: relative; width: 100%; max-width: 560px; background: #fff; border-radius: 16px 16px 0 0;
  max-height: 86vh; display: flex; flex-direction: column; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; }
.modal-close { border: none; background: none; font-size: 22px; color: #999; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.btn { flex: 1; border: none; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; }
.btn-line { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

.form-field { display: flex; flex-direction: column; margin-bottom: 12px; }
.form-field label { font-size: 12px; color: #666; margin-bottom: 5px; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--border); border-radius: 9px; padding: 10px; font-size: 14px; outline: none; width: 100%; font-family: inherit; }
.form-field input:focus, .form-field select:focus { border-color: var(--primary); }

/* 我的 */
.mine { text-align: center; padding: 10px 0 6px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(160deg,#8b5cf6,#6d28d9);
  color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.mine .nm { font-size: 17px; font-weight: 700; }
.mine .rl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.menu { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.menu a { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); font-size: 14px; }
.menu a:last-child { border-bottom: none; }
.menu a .arrow { color: #c0c4d0; }
.logout-btn { width: 100%; margin-top: 16px; border: 1px solid var(--red); color: var(--red);
  background: #fff; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; }
