:root{
  --brand:#1D4ED8; --brand-weak:#EFF4FF; --ink:#0F172A; --sub:#64748B;
  --line:#E5E9F0; --bg:#F5F7FA; --ok:#16A34A; --warn:#D97706; --bad:#DC2626;
  --radius:14px; --shadow:0 6px 24px rgba(15,23,42,.06);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  background:var(--bg); color:var(--ink); font-size:14px; line-height:1.6;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--brand); text-decoration:none}
.wrap{max-width:880px; margin:0 auto; padding:24px 16px 120px}
.card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px}
.card + .card{margin-top:16px}
.h1{font-size:22px; font-weight:600; letter-spacing:.2px}
.sub{color:var(--sub); font-size:13px; margin-top:4px}
.section-title{font-size:15px; font-weight:600; display:flex; align-items:center; gap:8px; margin-bottom:14px}
.section-title .idx{
  width:22px; height:22px; border-radius:50%; background:var(--brand-weak); color:var(--brand);
  font-size:12px; display:flex; align-items:center; justify-content:center; font-weight:600;
}
.grid{display:grid; grid-template-columns:1fr 1fr; gap:14px}
.grid.one{grid-template-columns:1fr}
.field{display:flex; flex-direction:column; gap:6px}
.label{font-size:13px; color:#334155; display:flex; gap:4px; align-items:center}
.req::after{content:"*"; color:var(--bad); font-size:12px; margin-left:2px}
.hint{font-size:12px; color:#94A3B8; line-height:1.5}
.err{font-size:12px; color:var(--bad); min-height:16px}
.input,select,textarea{
  width:100%; border:1px solid var(--line); background:#fff; border-radius:10px;
  padding:11px 12px; font-size:14px; color:var(--ink); outline:none; transition:border-color .15s, box-shadow .15s;
  font-family:inherit;
}
.input:focus,select:focus,textarea:focus{border-color:var(--brand); box-shadow:0 0 0 3px rgba(29,78,216,.12)}
.input.bad,select.bad,textarea.bad{border-color:var(--bad); background:#FFF7F7}
textarea{min-height:88px; resize:vertical}
.readonly{background:#F8FAFC; color:#475569}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:11px 18px; border-radius:10px; border:1px solid transparent; background:var(--brand); color:#fff;
  font-size:14px; font-weight:500; cursor:pointer; transition:background .15s, opacity .15s; font-family:inherit;
}
.btn:active{background:#173FBF}
.btn[disabled]{opacity:.55; cursor:not-allowed}
.btn.ghost{background:#fff; color:var(--ink); border-color:var(--line)}
.btn.ghost:active{background:#F1F5F9}
.btn.danger{background:#fff; color:var(--bad); border-color:#FECACA}
.btn.sm{padding:6px 12px; font-size:13px; border-radius:8px}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.between{display:flex; align-items:center; justify-content:space-between; gap:12px}
.pill{display:inline-flex; align-items:center; padding:2px 10px; border-radius:99px; font-size:12px; line-height:20px}
.pill.on{background:#ECFDF3; color:#15803D}
.pill.idle{background:#FEF6E7; color:#B45309}
.pill.borrow{background:#EFF6FF; color:#1D4ED8}
.pill.scrap{background:#FEF2F2; color:#B91C1C}
.pill.muted{background:#F1F5F9; color:#64748B}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  border:1px solid var(--line); background:#fff; border-radius:10px; padding:9px 14px; font-size:13px;
  cursor:pointer; user-select:none; transition:all .15s; display:flex; align-items:center; gap:6px;
}
.chip.active{border-color:var(--brand); background:var(--brand-weak); color:var(--brand); font-weight:500}
.switch{display:flex; gap:8px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:4px}
.switch button{flex:1; border:0; background:transparent; padding:9px 0; border-radius:8px; font-size:13px; cursor:pointer; color:var(--sub); font-family:inherit}
.switch button.active{background:var(--brand); color:#fff; font-weight:500}
.photo-box{display:flex; gap:10px; flex-wrap:wrap}
.photo{
  width:84px; height:84px; border:1px dashed #CBD5E1; border-radius:10px; background:#F8FAFC;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font-size:11px; color:#94A3B8; cursor:pointer; position:relative; overflow:hidden;
}
.photo img{width:100%; height:100%; object-fit:cover}
.photo .del{position:absolute; top:2px; right:2px; width:18px; height:18px; border-radius:50%; background:rgba(15,23,42,.65); color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center}
.photo.filled{border-style:solid; border-color:var(--line)}
.notice{background:#FFF7E6; border:1px solid #FDE68A; color:#92400E; border-radius:10px; padding:10px 12px; font-size:13px}
.notice.bad{background:#FEF2F2; border-color:#FECACA; color:#991B1B}
.footer-note{text-align:center; color:#94A3B8; font-size:12px; margin-top:26px; line-height:2}
.bar{position:fixed; left:0; right:0; bottom:0; background:rgba(255,255,255,.92); backdrop-filter:blur(8px); border-top:1px solid var(--line); padding:12px 16px calc(12px + env(safe-area-inset-bottom)); z-index:20}
.bar .inner{max-width:880px; margin:0 auto; display:flex; gap:12px}
.bar .btn{flex:1}
.table{width:100%; border-collapse:collapse; font-size:13px}
.table th{background:#FAFBFC; color:var(--sub); font-weight:500; text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap}
.table td{padding:11px 12px; border-bottom:1px solid #F1F5F9; vertical-align:middle}
.table tr:hover td{background:#FAFBFF}
.empty{text-align:center; color:#94A3B8; padding:36px 0; font-size:13px}
@media (max-width:640px){
  .grid{grid-template-columns:1fr}
  .wrap{padding:16px 12px 120px}
  .card{padding:16px; border-radius:12px}
}
