/* components.css — 卡片/按钮/输入/徽章/Toast/Modal */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(120%);
}
.card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: .5px; }
.card-grid {
  display: grid; gap: var(--gutter);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #0a0f1e; font-weight: 600; font-size: 13px;
  min-height: 38px; transition: opacity .15s, transform .12s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border-color: var(--panel-border);
  backdrop-filter: blur(8px);
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(124, 140, 255, .35);
}
.btn.danger { background: linear-gradient(135deg, #ff6f6f, #ff4d6d); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 12px; min-height: 30px; }
.btn svg { width: 16px; height: 16px; }

/* 强调按钮：微信绿 / 紫蓝主操作 — 适用于工具栏 */
.btn.wechat {
  background: linear-gradient(135deg, #2dd07b, #07c160);
  color: #fff;
  box-shadow: 0 6px 18px rgba(7, 193, 96, .35);
}
.btn.wechat:hover { box-shadow: 0 8px 22px rgba(7, 193, 96, .5); }
.btn.primary-soft {
  background: linear-gradient(135deg, rgba(124,140,255,.92), rgba(183,128,255,.92));
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 140, 255, .35);
}
.btn.primary-soft:hover { box-shadow: 0 8px 24px rgba(124, 140, 255, .55); }

/* 旋转图标 hover */
.btn .spin-on-hover { transition: transform .5s ease; }
.btn:hover .spin-on-hover { transform: rotate(180deg); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  background: rgba(0,0,0,.32); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 9px 11px; color: var(--text); outline: none;
  min-height: 40px;
}
.input:focus { border-color: var(--primary); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--panel-border);
  color: var(--muted);
}
.pill.online { background: rgba(93, 211, 158, .14); color: var(--accent); border-color: rgba(93, 211, 158, .35); }
.pill.warn { background: rgba(227, 162, 72, .15); color: var(--warn); border-color: rgba(227, 162, 72, .35); }
.pill.err { background: rgba(255, 123, 123, .14); color: var(--err); border-color: rgba(255, 123, 123, .35); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Toast */
.toast-root {
  position: fixed; top: 70px; right: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 220px; max-width: 360px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(20, 26, 56, .96);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in .2s ease;
}
.toast.ok { border-left: 3px solid var(--accent); }
.toast.err { border-left: 3px solid var(--err); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.info { border-left: 3px solid var(--primary); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: var(--gutter); backdrop-filter: blur(6px);
}
.modal {
  width: min(440px, 100%);
  background: var(--bg-elev); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow);
  max-height: 90vh; overflow: auto;
}
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { color: var(--text); }
.modal-footer { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 767px) {
  .modal { width: 100%; max-height: 92vh; }
}

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; font-size: 13px; border-bottom: 1px solid var(--panel-border); }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

/* 空状态 */
.empty {
  text-align: center; color: var(--muted); padding: 32px 12px; font-size: 13px;
  border: 1px dashed var(--panel-border); border-radius: var(--radius);
}
