body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to bottom right, #1e3c72, #2a5298);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 40px 30px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center; /* 水平居中 */
  justify-content: center;
  margin-bottom: 20px;
}

.logo img {
  width: 48px;
  height: 48px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 10px 0 0;
}

.logo em {
  color: #004b8d;
  font-style: normal;
}

.logo p {
  font-size: 14px;
  color: #777;
  margin-bottom: 20px;
}

.tab {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
}

.tab button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f0f0f0;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: 0.3s;
}

.tab button.active {
  background-color: #3399ff;
  color: white;
  border-radius: 6px 6px 0 0;
}

.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.form.hidden {
  display: none;
}

.form label {
  font-size: 14px;
  margin-bottom: 5px;
}

.form input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.code-row {
  display: flex;
  gap: 10px;
}

.code-row input {
  flex: 1;
}

.code-row button {
  padding: 10px;
  font-size: 13px;
  background-color: #004b8d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* 图形验证码样式 */
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.captcha-row input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.captcha-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 120px;
}

.captcha-container svg {
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f9f9f9;
}

#refresh-captcha,
#refresh-register-captcha {
  padding: 5px 8px;
  font-size: 12px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
}

#refresh-captcha:hover,
#refresh-register-captcha:hover {
  background-color: #5a6268;
}

button[type="button"] {
  padding: 12px;
  font-size: 14px;
  background-color: #3399ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

button[type="button"]:hover {
  background-color: #2b89e0;
}

.status {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}
/* 客户界面 - 侧边栏和主区域 */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--primary, #2c3e50);
  color: white;
  height: 100vh;
  position: fixed;
  box-shadow: 3px 0 15px rgba(0,0,0,0.15);
}

.nav-links {
  padding: 20px 0;
}

.nav-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  border-left: 4px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
}

.nav-item.active {
  background: rgba(52, 152, 219, 0.25);
  border-left: 4px solid #3498db;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 25px;
}

/* 页面卡片 */
.content-card {
  background: white;
  border-radius: 14px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 25px;
}

/* 按钮样式 */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 14px;
}

/* 表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.data-table th {
  background: #f8f8f8;
  font-weight: 600;
}

/* 图片预览 */
.image-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
}

/* 状态标签 */
.status-tag {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.tag-in-stock {
  background: rgba(46, 204, 113, 0.15);
  color: #16a75c;
}

.tag-out-stock {
  background: rgba(52, 152, 219, 0.15);
  color: #1d6fa5;
}
/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: #f5f6fa;
  color: #333;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background-color: #1f2a40;
  color: #fff;
  padding: 20px 10px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar .logo {
  font-size: 20px;
  font-weight: bold;
  padding: 10px 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-section {
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  color: #aaa;
}

.menu {
  padding-left: 0;
}

.menu-item {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  margin: 4px 8px;
  transition: background 0.3s;
}

.menu-item:hover {
  background-color: #2f3c57;
}

.menu-item.active {
  background-color: #304c89;
}

/* Main Content */
.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.search-box {
  position: relative;
  width: 360px;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.search-box i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

/* User Info */
.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  background-color: #007bff;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}

.info .name {
  font-weight: 600;
  font-size: 15px;
}

.info .desc {
  font-size: 12px;
  color: #888;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  gap: 15px;
}

.card i {
  font-size: 28px;
}

.card .text .number {
  font-size: 20px;
  font-weight: bold;
}

.card .text .label {
  font-size: 14px;
  color: #555;
}

.card.blue i { color: #007bff; }
.card.green i { color: #28a745; }
.card.yellow i { color: #ffc107; }
.card.purple i { color: #6f42c1; }

/* Page Sections */
.page {
  display: none;
  padding-top: 10px;
  font-size: 16px;
}

/* Show active page */
.page:target,
.page.active {
  display: block;
}

/* ===== 注册页面特定样式 ===== */
/* 密码提示样式 */
.password-hint {
  font-size: 12px;
  margin-top: 4px;
  display: block;
  color: #777; /* 默认颜色 */
}

.password-hint.error {
  color: #ff4d4f; /* 错误时红色 */
}

.password-hint.success {
  color: #52c41a; /* 成功时绿色 */
}

/* 状态消息样式 */
.status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.status.loading {
  background: #e6f7ff;
  color: #1890ff;
}

.status.success {
  background: #f6ffed;
  color: #52c41a;
}

.status.error {
  background: #fff2f0;
  color: #ff4d4f;
}

/* 验证码输入行布局 */
.code-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px; /* 确保底部间距 */
}

.code-row input {
  flex: 1;
}

.code-row button {
  white-space: nowrap;
  padding: 10px;
  background-color: #004b8d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.code-row button:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

/* 注册按钮样式 */
#register-form > button[type="button"] {
  margin-top: 10px;
  background-color: #3399ff;
}

/* 已有账号提示 */
.register-hint {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
}

.register-hint a {
  color: #3399ff;
  text-decoration: none;
}

.register-hint a:hover {
  text-decoration: underline;
}

/* ===== 模态框样式 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e8e8e8;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.close:hover,
.close:focus {
  color: #000;
}

.modal-body {
  padding: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3399ff;
  box-shadow: 0 0 0 2px rgba(51, 153, 255, 0.1);
}

.form-text {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e8e8e8;
}

/* 页面头部按钮样式 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 表格操作按钮样式 */
.action-buttons {
  display: flex;
  gap: 6px;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  border: none;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-info {
  background-color: #17a2b8;
  color: white;
  border: none;
}

.btn-info:hover {
  background-color: #138496;
}
