:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --danger:#dc2626;
  --ok:#16a34a;
  --radius:14px;
}

/* ================= 基础 ================= */

*{box-sizing:border-box;}
html,body{height:100%;}

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);
  color:var(--text);
}

.container{
  width:min(1100px, 100%);
  margin:0 auto;
  padding:14px;
}

/* ================= Card（纯容器，不可点击） ================= */

.card{
  display:block;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  text-decoration:none;
}

/* ❗ 注意：不再有 .card:active / hover / cursor:pointer */

/* ================= 文本 ================= */

h1,h2,h3{margin:0 0 10px 0; line-height:1.2;}
h1{font-size:20px;}
h2{font-size:16px;}
p{margin:8px 0; color:var(--muted);}
.muted{opacity:.75;}

a{color:var(--primary); text-decoration:none;}
a:hover{text-decoration:underline;}

/* ================= 导航 ================= */

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:10px 0 14px 0;
}

.nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  min-height:42px;
  font-weight:600;
}

/* ================= 按钮 ================= */

button,.btn,input[type="submit"]{
  appearance:none;
  border:0;
  border-radius:12px;
  padding:12px 14px;
  background:var(--primary);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  min-height:44px;
}

button.secondary,.btn.secondary{
  background:#fff;
  color:var(--text);
  border:1px solid var(--line);
}

button.danger,.btn.danger{
  background:var(--danger);
  color:#fff;
}

button:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* LINK_AS_BUTTON_V1 */
/* 让 <a class="btn ..."> 在所有页面都显示为按钮 */

a.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:12px 14px;
  border-radius:12px;
  font-weight:700;
  border:0;
  background:var(--primary);
  color:#fff;
  text-decoration:none;
  cursor:pointer;
}

a.btn.secondary{
  background:#fff;
  color:var(--text);
  border:1px solid var(--line);
}

a.btn.danger{
  background:var(--danger);
  color:#fff;
}

/* ================= 表单 ================= */

input,select,textarea{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  outline:none;
  min-height:44px;
  font-size:16px;
}

input:focus,select:focus,textarea:focus{
  border-color:rgba(37,99,235,.6);
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

/* ================= 表格 ================= */

.table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:680px;
}

th,td{
  padding:10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
  font-size:14px;
}

th{
  background:#fafafa;
  font-weight:800;
}

tr:hover td{
  background:#fcfcff;
}

/* ================= 提示 ================= */

.notice{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
}

.notice.ok{
  border-color:rgba(22,163,74,.35);
  background:rgba(22,163,74,.06);
}

.notice.warn{
  border-color:rgba(220,38,38,.35);
  background:rgba(220,38,38,.06);
}

/* ================= 首页专用（唯一可点击卡片） ================= */

.home-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin-top:12px;
}

.home-card{
  display:block;
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:16px 14px;
  text-decoration:none;
  color:#111827;
  cursor:pointer;
}

.home-card:active{
  transform:scale(0.98);
}

.home-card .title{
  font-size:18px;
  font-weight:700;
}

.home-card .desc{
  margin-top:6px;
  font-size:14px;
  color:#6b7280;
}

.home-card.danger{
  border-color:#fecaca;
  background:#fff5f5;
}

/* ================= 响应式 ================= */

@media (max-width:720px){
  .container{padding:10px;}
  .form-row{grid-template-columns:1fr;}
  table{min-width:560px;}
  h1{font-size:18px;}
}

@media (min-width:640px){
  .home-grid{
    grid-template-columns:1fr 1fr;
  }
}
