/* ==================== 基础重置 ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: #606266;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #e8f0fe 0%, #d4e4f7 50%, #e0ecfa 100%);
  background-attachment: fixed;
}

a {
  color: #409eff;
  text-decoration: none;
}

a:hover {
  color: #66b1ff;
}

/* ==================== 布局系统 ==================== */
.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: 200px;
  min-width: 200px;
  background-color: #001529;
  color: #bfcbd9;
  display: flex;
  flex-direction: column;
  transition: width 0.3s;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar-logo {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #002140;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.sidebar-menu ul {
  list-style: none;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  color: #bfcbd9;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.sidebar-menu li a:hover {
  color: #fff;
  background-color: #0f2438;
}

.sidebar-menu li a.active {
  color: #fff;
  background-color: #1890ff;
}

.sidebar-menu li a .icon {
  width: 18px;
  margin-right: 10px;
  text-align: center;
  flex-shrink: 0;
}

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f0fe 0%, #d4e4f7 50%, #e0ecfa 100%);
  background-attachment: fixed;
}

.top-header {
  height: 54px;
  background: linear-gradient(180deg, #1e3866 0%, #12264a 25%, #0e1e3a 55%, #080f24 100%);
  border-bottom: 1px solid rgba(64,158,255,0.12);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  z-index: 100;
}

.top-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(64,158,255,0.5), transparent);
  box-shadow: 0 0 12px rgba(64,158,255,0.3), 0 0 30px rgba(64,158,255,0.1);
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  overflow: hidden;
  height: 100%;
  padding-left: 0;
}

.logo-text {
  font-size: 18px;
  font-weight: bold;
  color: #e0eeff;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.logo-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 0;
  margin-left: 30px;
  margin-right: 10px;
  height: 100%;
}

.logo-link:hover .logo-text {
  color: #7ec8ff;
}

.top-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  height: 100%;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  border-radius: 0;
  color: #b8cce8;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s ease;
  position: relative;
  text-decoration: none;
}

.top-nav > a:first-child,
.top-nav > .dropdown:first-child {
  margin-left: 0;
}

.top-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.top-nav a.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(64,158,255,0.2) 0%, transparent 100%);
  font-weight: 700;
}

.top-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #409eff, #66b1ff);
  border-radius: 0;
  box-shadow: 0 0 10px rgba(64,158,255,0.6), 0 0 20px rgba(64,158,255,0.2);
}

.top-nav a .icon {
  font-size: 14px;
}

/* 下拉菜单 */
.dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.dropdown.open {
  position: static;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  border-radius: 0;
  color: #b8cce8;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropdown-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.dropdown.active .dropdown-toggle {
  color: #fff;
  background: linear-gradient(180deg, rgba(64,158,255,0.2) 0%, transparent 100%);
  font-weight: 700;
}

.dropdown.active .dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #409eff, #66b1ff);
  box-shadow: 0 0 10px rgba(64,158,255,0.6), 0 0 20px rgba(64,158,255,0.2);
}

.dropdown-toggle .arrow {
  font-size: 10px;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.dropdown.open .dropdown-toggle .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100px;
  background: linear-gradient(180deg, #eef4fb 0%, #e2ecf8 100%);
  border: 1px solid rgba(64,158,255,0.12);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
  padding: 4px 0;
  overflow: hidden;
  z-index: 9999;
  margin-top: 3px;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #3a5a7a;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.dropdown-menu a .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dropdown-menu a:hover {
  color: #1a3a6a;
  background: rgba(64,158,255,0.1);
  border-left-color: #409eff;
}

.dropdown-menu a.active {
  color: #1a3a6a;
  background: rgba(64,158,255,0.12);
  border-left-color: #409eff;
  font-weight: 600;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #b8cce8;
  font-size: 14px;
  transition: color 0.2s;
}

.user-info:hover {
  color: #e0eeff;
}

.user-info .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #409eff, #0066cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(64,158,255,0.3);
}

.logout-btn {
  color: rgba(255,100,100,0.7);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,100,100,0.15);
}

.logout-btn:hover {
  color: #ff6b6b;
  background: rgba(255,100,100,0.1);
  border-color: rgba(255,100,100,0.3);
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  background: transparent;
  min-height: 0;
}

/* ==================== 卡片组件 ==================== */
.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.5);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.9);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a2a4a;
}

/* ==================== 表单组件 ==================== */
.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.form-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  color: #606266;
  white-space: nowrap;
}

.form-input,
.form-select {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  min-width: 180px;
}

.form-input:focus,
.form-select:focus {
  border-color: #409eff;
}

.form-input::placeholder {
  color: #c0c4cc;
}

.form-select {
  cursor: pointer;
}

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 16px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  color: #606266;
  white-space: nowrap;
}

.btn:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background: #ecf5ff;
}

.btn-primary {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}

.btn-primary:hover {
  background: #66b1ff;
  border-color: #66b1ff;
  color: #fff;
}

.btn-success {
  background: #67c23a;
  border-color: #67c23a;
  color: #fff;
}

.btn-success:hover {
  background: #85ce61;
  border-color: #85ce61;
  color: #fff;
}

.btn-danger {
  background: #f56c6c;
  border-color: #f56c6c;
  color: #fff;
}

.btn-danger:hover {
  background: #f78989;
  border-color: #f78989;
  color: #fff;
}

.btn-warning {
  background: #e6a23c;
  border-color: #e6a23c;
  color: #fff;
}

.btn-warning:hover {
  background: #ebb563;
  border-color: #ebb563;
  color: #fff;
}

.btn-info {
  background: #909399;
  border-color: #909399;
  color: #fff;
}

.btn-info:hover {
  background: #a6a9ad;
  border-color: #a6a9ad;
  color: #fff;
}

.btn-sm {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-link {
  border: none;
  background: transparent;
  color: #409eff;
  padding: 0 4px;
}

.btn-link:hover {
  color: #66b1ff;
  background: transparent;
}

/* ==================== 表格组件 ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
  color: #1a2a4a;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: #4a5a72;
}

.data-table tbody tr:hover {
  background: rgba(64,158,255,0.04);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.3);
}

.data-table tbody tr:nth-child(even):hover {
  background: rgba(64,158,255,0.06);
}

/* ==================== 分页组件 ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px 0 0;
  margin-top: 16px;
  border-top: 1px solid #ebeef5;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  color: #409eff;
  border-color: #409eff;
}

.pagination-btn.active {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}

.pagination-btn.disabled {
  color: #c0c4cc;
  border-color: #e4e7ed;
  cursor: not-allowed;
}

.pagination-info {
  color: #606266;
  font-size: 13px;
  margin-left: 12px;
}

/* ==================== 弹窗/模态框 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ==================== 全屏加载遮罩 ==================== */
.global-loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.global-loading-mask .global-loading-text {
  color: #cdd6e4;
  font-size: 15px;
  text-align: center;
  letter-spacing: 1px;
}

.modal-content {
  background: #fff;
  border-radius: 4px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.modal-close {
  font-size: 20px;
  color: #909399;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #409eff;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #ebeef5;
}

.modal-lg {
  max-width: 800px;
}

/* ==================== 表单布局（弹窗内） ==================== */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row .form-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row .form-item .form-input,
.form-row .form-item .form-select {
  width: 100%;
}

.form-error {
  color: #f56c6c;
  font-size: 12px;
  margin-top: 4px;
}

/* ==================== 统计卡片 ==================== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.9);
}

.stat-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .icon-box.blue { background: rgba(24,144,255,0.12); color: #1890ff; }
.stat-card .icon-box.green { background: rgba(82,196,26,0.12); color: #52c41a; }
.stat-card .icon-box.orange { background: rgba(250,140,22,0.12); color: #fa8c16; }
.stat-card .icon-box.red { background: rgba(245,34,45,0.12); color: #f5222d; }

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #1a2a4a;
}

.stat-card .stat-label {
  font-size: 13px;
  color: #8c9ab0;
  margin-top: 4px;
}

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

.tag-success {
  background: #f0f9eb;
  color: #67c23a;
  border: 1px solid #e1f3d8;
}

.tag-danger {
  background: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fde2e2;
}

.tag-warning {
  background: #fdf6ec;
  color: #e6a23c;
  border: 1px solid #faecd8;
}

.tag-info {
  background: #f4f4f5;
  color: #909399;
  border: 1px solid #e9e9eb;
}

/* ==================== Toast 提示 ==================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  min-width: 200px;
}

.toast.success { background: #67c23a; }
.toast.error { background: #f56c6c; }
.toast.warning { background: #e6a23c; }
.toast.info { background: #909399; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ==================== 状态标签 ==================== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.success { background: #67c23a; }
.status-dot.danger { background: #f56c6c; }
.status-dot.warning { background: #e6a23c; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 100;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .form-item {
    width: 100%;
  }

  .form-input, .form-select {
    width: 100%;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* ==================== 登录页专用 ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
}

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

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

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

.login-card .form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #606266;
}

.login-card .form-input {
  width: 100%;
  height: 40px;
}

.login-card .btn {
  width: 100%;
  height: 40px;
  font-size: 16px;
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #8c9ab0;
}

.loading-spinner .spinner-ring {
  position: relative;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(64,158,255,0.1);
  border-top-color: #409eff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.loading-spinner .spinner-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid rgba(100,180,255,0.05);
}

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

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #909399;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ==================== Tab 切换 ==================== */
.tab-nav {
  display: flex;
  border-bottom: 1px solid #e4e7ed;
  margin-bottom: 20px;
}

.tab-nav-item {
  padding: 0 20px;
  height: 40px;
  line-height: 40px;
  cursor: pointer;
  color: #606266;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-nav-item:hover {
  color: #409eff;
}

.tab-nav-item.active {
  color: #409eff;
  border-bottom-color: #409eff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* 搜索区域标签强制显示 */
.search-label {
  font-size: 14px;
  color: #606266;
  white-space: nowrap;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
