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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

/* ============ 登录页 ============ */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f0f0f0;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
  text-align: center;
  color: #1a73e8;
  margin-bottom: 8px;
  font-size: 24px;
}

.login-card p {
  text-align: center;
  color: #999;
  margin-bottom: 30px;
  font-size: 14px;
}

.login-card .form-group {
  margin-bottom: 20px;
}

.login-card label {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-size: 14px;
}

.login-card input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.login-card input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #1557b0;
}

/* ============ 管理后台 ============ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #001529;
  color: #fff;
  flex-shrink: 0;
}

.sidebar .logo {
  padding: 20px;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.sidebar .menu {
  list-style: none;
  padding: 10px 0;
}

.sidebar .menu li {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 14px;
}

.sidebar .menu li:hover {
  background: rgba(255,255,255,0.1);
}

.sidebar .menu li.active {
  background: #1a73e8;
}

.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 20px;
  color: #333;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #666;
}

.user-info .logout-btn {
  color: #ff4d4f;
  cursor: pointer;
  border: 1px solid #ff4d4f;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  background: transparent;
}

.user-info .logout-btn:hover {
  background: #ff4d4f;
  color: #fff;
}

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

/* ============ 表格 ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #555;
}

.data-table tr:hover {
  background: #f5f8ff;
}

/* ============ 按钮 ============ */
.btn {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-blue { background: #1a73e8; color: #fff; }
.btn-blue:hover { background: #1557b0; }
.btn-green { background: #52c41a; color: #fff; }
.btn-green:hover { background: #3f9514; }
.btn-red { background: #ff4d4f; color: #fff; }
.btn-red:hover { background: #cf1322; }
.btn-orange { background: #fa8c16; color: #fff; }
.btn-orange:hover { background: #d46b08; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { color: #1a73e8; border-color: #1a73e8; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ============ 状态标签 ============ */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-red { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.tag-blue { background: #e6f7ff; color: #1a73e8; border: 1px solid #91d5ff; }
.tag-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal h3 {
  margin-bottom: 20px;
  font-size: 18px;
  color: #333;
}

.modal .form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.modal .form-row label {
  min-width: 80px;
  text-align: right;
  line-height: 36px;
  color: #555;
  font-size: 14px;
  flex-shrink: 0;
}

.modal .form-row input,
.modal .form-row textarea,
.modal .form-row select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
}

.modal .form-row input:focus,
.modal .form-row textarea:focus,
.modal .form-row select:focus {
  outline: none;
  border-color: #1a73e8;
}

.modal .form-row textarea {
  min-height: 80px;
  resize: vertical;
}

.modal .form-row input[readonly] {
  background: #f5f5f5;
  color: #999;
}

.modal .btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

/* ============ 链接页面（手机端） ============ */
.link-page {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  padding: 0;
}

.link-header {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  padding: 20px;
  text-align: center;
}

.link-header h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.link-header .status-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  margin-top: 8px;
}

.link-header .status-tag.signed {
  background: #52c41a;
}

.link-body {
  padding: 16px 20px;
}

.info-section {
  margin-bottom: 20px;
}

.info-section .section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a73e8;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid #1a73e8;
}

.info-row {
  display: flex;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}

.info-row .label {
  color: #999;
  min-width: 60px;
}

.info-row .value {
  color: #333;
  flex: 1;
}

.notice-box {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 6px;
  padding: 12px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #8c6d1f;
}

.scan-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 20px;
  padding: 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.3s;
}

.scan-btn:hover {
  background: #1557b0;
}

.scan-btn:disabled {
  background: #b0c4de;
  cursor: not-allowed;
}

/* 链接2 特殊样式 */
.link2-status {
  text-align: center;
  padding: 40px 20px;
}

.link2-status .status-text {
  font-size: 24px;
  font-weight: bold;
  color: #1a73e8;
  margin-bottom: 20px;
}

.link2-status .countdown {
  font-size: 64px;
  font-weight: bold;
  color: #ff4d4f;
  margin: 20px 0;
}

.link2-status .qr-display {
  margin: 20px auto;
  text-align: center;
}

.link2-status .qr-display canvas {
  display: block;
  margin: 0 auto;
}

.link2-status .online-info {
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.link2-status .online-info .count {
  font-size: 28px;
  color: #1a73e8;
  font-weight: bold;
}

/* ============ 摄像头 ============ */
.camera-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

.camera-overlay video {
  flex: 1;
  object-fit: cover;
}

.camera-overlay .camera-hint {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 14px;
}

.camera-overlay .camera-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

/* ============ 验证页 ============ */
.verify-page {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  padding: 40px 20px;
}

.verify-page h2 {
  text-align: center;
  color: #1a73e8;
  margin-bottom: 30px;
}

.verify-page .form-group {
  margin-bottom: 16px;
}

.verify-page label {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-size: 14px;
}

.verify-page input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.verify-page input:focus {
  outline: none;
  border-color: #1a73e8;
}

/* ============ 过期页 ============ */
.expired-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  color: #999;
}

.expired-page h2 {
  color: #ff4d4f;
  margin-bottom: 8px;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
  }
  .sidebar .menu {
    display: flex;
    overflow-x: auto;
  }
  .sidebar .menu li {
    white-space: nowrap;
    padding: 10px 16px;
  }
  .main-content {
    padding: 16px;
  }
  .modal {
    width: 95vw;
  }
  .data-table {
    font-size: 12px;
  }
  .data-table th, .data-table td {
    padding: 8px;
  }
}
