/* ============================================================
   Fish Manager 公共样式 · fish-common.css
   三页共享：login / list / dashboard 统一品牌视觉与 design token
   版本：v3.1 (20260801)
   ============================================================ */

:root {
  /* 品牌色 */
  --brand-start: #667eea;
  --brand-end: #764ba2;
  --brand-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent: #3182ce;
  --accent-hover: #2b6cb0;
  --accent-soft: #ebf8ff;
  --tag-bg: #ebf8ff;
  --tag-text: #3182ce;

  /* 中性色 */
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1a202c;
  --text-secondary: #718096;
  --border: #e2e8f0;
  --border-strong: #cbd5e0;

  /* 语义色 */
  --danger: #e53e3e;
  --danger-bg: #fff5f5;
  --success: #38a169;
  --warning: #dd6b20;

  /* 圆角 */
  --radius: 12px;
  --radius-sm: 8px;

  /* 阴影（统一层级） */
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-hover: 0 12px 28px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.16), 0 8px 20px rgba(0,0,0,0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 品牌 Header（三页统一） ---------- */
.header {
  background: var(--brand-grad);
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(102,126,234,0.35);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { font-size: 24px; line-height: 1; }
.header-title { font-size: 18px; font-weight: 700; color: #fff; }
.header-vendor { font-size: 13px; opacity: .9; color: #fff; }
.header-right { display: flex; align-items: center; gap: 10px; }

/* 头部按钮（白字透明底，适配渐变 header） */
.btn-header {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-family: inherit;
}
.btn-header:hover { background: rgba(255,255,255,.32); transform: translateY(-1px); }
.btn-header:active { transform: translateY(0); }

/* ---------- 通用按钮 ---------- */
.btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #2f855a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-ghost { background: #edf2f7; color: var(--text); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h2 { font-size: 17px; font-weight: 700; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; transition: all .2s;
  outline: none; font-family: inherit; background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}
.form-input.error { border-color: var(--danger); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
table tr:hover td { background: #f7fafc; }

/* ---------- 状态/徽章 ---------- */
.badge {
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  white-space: nowrap;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card-bg); border-radius: var(--radius);
  max-width: 640px; width: 100%; max-height: 80vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .3s;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card-bg); z-index: 1;
}
.modal-header h2 { font-size: 18px; }
.modal-close {
  width: 36px; height: 36px; border: none; background: #edf2f7;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 20px 24px; }

/* ---------- 加载/空态 ---------- */
.empty {
  text-align: center; padding: 48px 20px; color: var(--text-secondary);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.loading { text-align: center; padding: 40px; color: var(--text-secondary); }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .header { padding: 0 16px; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; max-height: 90vh; }
  .modal-body { padding: 16px 14px; }
  .form-row { flex-direction: column; }
}
