:root {
  --dopamine-pink: #ff6b9d;
  --dopamine-orange: #ffa62e;
  --dopamine-yellow: #ffeb3b;
  --dopamine-green: #4caf50;
  --dopamine-cyan: #00bcd4;
  --dopamine-blue: #2196f3;
  --dopamine-purple: #9c27b0;
  
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(20px);
  
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-light: #ffffff;
  
  --gradient-1: linear-gradient(135deg, #ff6b9d 0%, #ffa62e 100%);
  --gradient-2: linear-gradient(135deg, #4caf50 0%, #00bcd4 100%);
  --gradient-3: linear-gradient(135deg, #2196f3 0%, #9c27b0 100%);
  --gradient-4: linear-gradient(135deg, #ff6b9d 0%, #9c27b0 50%, #2196f3 100%);
  
  --bg-gradient: radial-gradient(circle at 0% 0%, rgba(255, 107, 157, 0.3) 0%, transparent 50%),
                 radial-gradient(circle at 100% 0%, rgba(255, 166, 46, 0.3) 0%, transparent 50%),
                 radial-gradient(circle at 100% 100%, rgba(33, 150, 243, 0.3) 0%, transparent 50%),
                 radial-gradient(circle at 0% 100%, rgba(76, 175, 80, 0.3) 0%, transparent 50%),
                 linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

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

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-light);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 30% 70%, rgba(33, 150, 243, 0.1) 0%, transparent 40%),
              radial-gradient(circle at 70% 30%, rgba(255, 166, 46, 0.1) 0%, transparent 40%);
  animation: liquidMove 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes liquidMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2%, 2%) rotate(1deg); }
  50% { transform: translate(-1%, 3%) rotate(-1deg); }
  75% { transform: translate(1%, -2%) rotate(2deg); }
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(255, 107, 157, 0.5);
}

.btn-secondary {
  background: var(--gradient-2);
  color: white;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(76, 175, 80, 0.5);
}

.btn-accent {
  background: var(--gradient-3);
  color: white;
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(33, 150, 243, 0.5);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

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

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--dopamine-cyan);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2);
}

.input-group select option {
  background: #1a1a2e;
  color: white;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tag-a {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  box-shadow: 0 2px 12px rgba(255, 71, 87, 0.4);
}

.tag-b {
  background: linear-gradient(135deg, #ffa502, #ffcc00);
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(255, 165, 2, 0.4);
}

.tag-c {
  background: linear-gradient(135deg, #3742fa, #5352ed);
  color: white;
  box-shadow: 0 2px 12px rgba(55, 66, 250, 0.4);
}

.tag-d {
  background: linear-gradient(135deg, #636e72, #b2bec3);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 110, 114, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  padding: 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

table tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  font-size: 24px;
  background: var(--gradient-4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 71, 87, 0.8);
  transform: rotate(90deg);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  z-index: 2000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.active {
  transform: translateX(0);
}

.toast-success {
  background: linear-gradient(135deg, #4caf50, #00bcd4);
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.toast-error {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

.toast-warning {
  background: linear-gradient(135deg, #ffa502, #ffcc00);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(255, 165, 2, 0.4);
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 32px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

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

.nav-link {
  padding: 10px 20px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main {
  padding: 32px;
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
}

.stat-card:nth-child(1)::before {
  background: var(--dopamine-pink);
}

.stat-card:nth-child(2)::before {
  background: var(--dopamine-orange);
}

.stat-card:nth-child(3)::before {
  background: var(--dopamine-cyan);
}

.stat-card:nth-child(4)::before {
  background: var(--dopamine-green);
}

.stat-card:nth-child(5)::before {
  background: var(--dopamine-blue);
}

.stat-card:nth-child(6)::before {
  background: var(--dopamine-purple);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  background: var(--gradient-4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.filter-section {
  padding: 24px;
  margin-bottom: 24px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--dopamine-cyan);
}

.table-section {
  padding: 24px;
}

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

.table-header h2 {
  font-size: 20px;
  color: white;
}

.table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.table-actions .btn {
  white-space: nowrap;
}

.table-container {
  overflow-x: auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: 20px;
}

.client-card {
  display: none;
  padding: 20px;
  margin-bottom: 16px;
}

.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.client-card-title h3 {
  font-size: 18px;
  color: white;
  margin-bottom: 4px;
}

.client-card-title p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.client-card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.client-card-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.client-card-info-item p:first-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.client-card-info-item p:last-child {
  font-size: 14px;
  color: white;
  margin-top: 4px;
}

.client-card-action {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  padding: 12px;
  background: rgba(255, 107, 157, 0.1);
  border-left: 3px solid var(--dopamine-pink);
  border-radius: 8px;
  margin-bottom: 16px;
}

.client-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.client-card-actions .btn {
  flex: 1;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer {
  padding: 24px 32px;
  margin-top: 32px;
}

.footer-content {
  padding: 24px;
  text-align: center;
}

.footer-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 166, 46, 0.15);
  border: 1px solid rgba(255, 166, 46, 0.3);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.footer-warning svg {
  flex-shrink: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid .input-group:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }
  
  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  .main {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .table-container {
    display: none;
  }
  
  .client-card {
    display: block;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .table-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .table-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal {
    padding: 20px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  /* 移动端按钮优化 */
  .btn {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }
  
  .btn-small {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }
  
  .btn-icon {
    width: 48px;
    height: 48px;
  }
  
  /* 输入框优化 */
  .input-group input,
  .input-group select,
  .input-group textarea {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
  }
  
  /* 标签优化 */
  .tag {
    padding: 6px 14px;
    font-size: 13px;
  }
  
  /* 统计卡片优化 */
  .stat-card {
    padding: 20px 16px;
  }
  
  .stat-value {
    font-size: 32px;
  }
  
  .stat-label {
    font-size: 14px;
  }
  
  /* 客户卡片优化 */
  .client-card {
    padding: 18px;
    margin-bottom: 14px;
  }
  
  .client-card-header {
    align-items: flex-start;
    gap: 12px;
  }
  
  .client-card-title h3 {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .client-card-tags {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .client-card-info {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* 导航栏优化 */
  .logo-text h1 {
    font-size: 16px;
  }
  
  .logo-text p {
    font-size: 11px;
  }
  
  .logo-icon {
    width: 40px;
    height: 40px;
  }
  
  .nav-link {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  /* 筛选区域优化 */
  .filter-section {
    padding: 16px;
  }
  
  /* 表格区域优化 */
  .table-section {
    padding: 16px;
  }
  
  .table-header h2 {
    font-size: 18px;
  }
  
  /* 模态框优化 */
  .modal {
    margin: 10px;
    max-height: calc(100vh - 40px);
  }
  
  .modal-header {
    padding-bottom: 14px;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .form-grid {
    gap: 14px;
  }
  
  /* Toast提示优化 */
  .toast {
    padding: 16px 24px;
    font-size: 15px;
    max-width: calc(100vw - 40px);
  }
  
  /* 头部和底部优化 */
  .header {
    padding: 10px 12px;
  }
  
  .header-content {
    padding: 12px;
  }
  
  .footer {
    padding: 16px 12px;
  }
  
  .footer-content {
    padding: 16px;
  }
  
  .footer-warning {
    font-size: 13px;
    padding: 12px 16px;
  }
  
  /* 空状态优化 */
  .empty-state {
    padding: 50px 20px;
  }
  
  .empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
  }
}

@media (max-width: 360px) {
  /* 小屏幕优化 */
  .btn {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .client-card-header {
    flex-direction: column;
  }
  
  .client-card-header .tag {
    align-self: flex-start;
  }
}

/* 改善移动端滚动体验 */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 改善表单在移动端的表现 */
input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}