/* ============ 公共样式 ============ */
:root {
  --primary: #0e7c86;
  --primary-dark: #0a5d65;
  --primary-light: #e0f2f3;
  --danger: #d64545;
  --danger-dark: #b53535;
  --text: #1f2933;
  --text-secondary: #64707d;
  --border: #dde3e8;
  --bg: #f4f6f8;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-size: 14px;
}

input {
  font-family: inherit;
  font-size: 14px;
}

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

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: #f0f2f5;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* 表单 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.12);
}

/* 提示消息 */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.alert-error {
  background: #fdeaea;
  color: var(--danger);
  border: 1px solid #f5c6c6;
}

.alert-success {
  background: #e6f6ec;
  color: #1f8a4c;
  border: 1px solid #b6e3c6;
}

.alert.show {
  display: block;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-mask.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.modal h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 22px;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 14px;
  opacity: 0.45;
}

.empty-state p {
  font-size: 14px;
}

/* 加载中 */
.loading {
  text-align: center;
  padding: 50px;
  color: var(--text-secondary);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 顶栏 */
.topbar {
  height: 60px;
  background: #0f2d33;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.topbar .brand {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .spacer {
  flex: 1;
}

.topbar .user-info {
  font-size: 13px;
  color: #b8cdd0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .link-btn {
  background: transparent;
  color: #b8cdd0;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.topbar .link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
