/* 导航站共用样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: linear-gradient(180deg, #f0f4f8 0%, #e8eef5 100%);
  min-height: 100vh;
  color: #1f2937;
}
a { text-decoration: none; color: inherit; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 100;
}
.topbar .logo { font-size: 22px; font-weight: 700; color: #2563eb; white-space: nowrap; }
.topbar .clock { font-size: 13px; color: #6b7280; white-space: nowrap; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input {
  width: 100%; padding: 9px 36px 9px 14px;
  border: 1px solid #d1d5db; border-radius: 20px; font-size: 14px; outline: none;
  background: #f9fafb;
}
.topbar .search input:focus { border-color: #2563eb; background: #fff; }
.topbar .search .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: #9ca3af; font-size: 16px; display: none;
}
.topbar .btn {
  padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
}
.topbar .btn:hover { border-color: #2563eb; color: #2563eb; }

/* 主内容 */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.group { margin-bottom: 30px; }
.group-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; margin-bottom: 14px;
}
.group-title::before {
  content: ""; width: 5px; height: 18px; border-radius: 3px;
  background: #2563eb; display: inline-block;
}
.group-title .count { font-size: 12px; color: #9ca3af; font-weight: 400; }

/* 网址卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.card {
  position: relative;
  background: #fff; border-radius: 12px; padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s, box-shadow .15s, opacity .3s;
  overflow: hidden;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(37,99,235,.12); }
.card.down { opacity: .55; }
.card .dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: #10b981; display: none;
}
.card.down .dot { display: block; background: #ef4444; }
.card .icon {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; overflow: hidden;
}
.card .icon img { width: 100%; height: 100%; object-fit: contain; }
.card .info { min-width: 0; }
.card .info .t {
  font-size: 14px; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.card .info .d {
  font-size: 12px; color: #9ca3af; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.empty { color: #9ca3af; font-size: 14px; text-align: center; padding: 40px 0; }

/* 管理页 */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }
.admin-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-header h1 { font-size: 20px; flex: 1; }
.btn-primary { background: #2563eb; color: #fff; border: none; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { color: #dc2626; border-color: #fca5a5; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs .tab {
  padding: 8px 18px; border-radius: 8px 8px 0 0; cursor: pointer;
  font-size: 14px; color: #6b7280; border-bottom: 2px solid transparent;
}
.tabs .tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #f1f5f9; }
th { background: #f8fafc; color: #6b7280; font-weight: 500; font-size: 13px; }
tr:hover td { background: #f8fafc; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-badge.ok::before { background: #10b981; }
.status-badge.down::before { background: #ef4444; }
.status-badge.ok { color: #059669; }
.status-badge.down { color: #dc2626; }
.op-link { color: #2563eb; cursor: pointer; margin-right: 10px; font-size: 13px; }
.op-link.danger { color: #dc2626; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: #fff; border-radius: 14px; padding: 22px; width: 420px;
  max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.form-item input, .form-item select {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; outline: none;
}
.form-item input:focus { border-color: #2563eb; }
.modal .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.login-box {
  background: #fff; border-radius: 14px; padding: 30px; width: 320px;
  box-shadow: 0 8px 30px rgba(0,0,0,.08); text-align: center;
}
.login-box h2 { font-size: 18px; margin-bottom: 18px; }
.login-box input {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 14px;
}
.login-box .btn { width: 100%; }

.hint { color: #9ca3af; font-size: 12px; margin-top: 8px; text-align: center; }
