/**
 * Agent-2: UI/VI品牌规范适配
 * 一小时冲刺开发 - 瑞美品牌视觉规范CSS
 * 
 * 覆盖PRD新增P0需求：
 * - 品牌元素(Logo/标识)
 * - 色彩规范(瑞美红#C41230/中性灰#4A4A4A)
 * - 字体规范
 * - 版式布局规范
 */

:root {
  /* 瑞美品牌主色 */
  --rheem-red: #C41230;
  --rheem-red-dark: #A00F28;
  --rheem-red-light: #E8455F;
  
  /* 中性灰 */
  --neutral-gray: #4A4A4A;
  --neutral-gray-light: #6B6B6B;
  --neutral-gray-dark: #2D2D2D;
  
  /* 辅助色 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-tertiary: #EEEEEE;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  
  /* 功能色 */
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;
  --info: #2196F3;
  
  /* 字体 */
  --font-title: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-body: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

/* 全局样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 标题规范 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--neutral-gray-dark);
}

h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.4; }
h4 { font-size: 18px; line-height: 1.4; }
h5 { font-size: 16px; line-height: 1.5; }
h6 { font-size: 14px; line-height: 1.5; }

/* 品牌Logo区域 */
.brand-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--rheem-red) 0%, var(--rheem-red-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.brand-logo {
  height: 40px;
  width: auto;
  margin-right: var(--spacing-md);
}

.brand-title {
  font-size: 20px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-left: var(--spacing-sm);
}

/* 主按钮 - 瑞美红 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--rheem-red) 0%, var(--rheem-red-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--rheem-red-dark) 0%, var(--rheem-red) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* 次要按钮 */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: white;
  color: var(--rheem-red);
  border: 2px solid var(--rheem-red);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--rheem-red);
  color: white;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--bg-tertiary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--rheem-red);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--neutral-gray-dark);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--rheem-red);
  border-radius: 2px;
}

/* 表单样式 */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-gray);
  margin-bottom: var(--spacing-sm);
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--rheem-red);
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.data-table th {
  background: var(--neutral-gray);
  color: white;
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 14px;
}

.data-table tr:hover {
  background: var(--bg-secondary);
}

/* 状态标签 */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.status-inactive {
  background: rgba(158, 158, 158, 0.15);
  color: var(--text-light);
}

.status-pending {
  background: rgba(255, 152, 0, 0.15);
  color: var(--warning);
}

/* 导航菜单 */
.nav-menu {
  background: white;
  border-right: 1px solid var(--bg-tertiary);
  height: 100vh;
  width: 240px;
  position: fixed;
  left: 0;
  top: 0;
  padding-top: 80px;
  box-shadow: var(--shadow-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  color: var(--neutral-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--rheem-red);
}

.nav-item.active {
  background: rgba(196, 18, 48, 0.05);
  color: var(--rheem-red);
  border-left-color: var(--rheem-red);
}

/* 页面布局 */
.page-container {
  margin-left: 240px;
  padding: var(--spacing-lg);
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--bg-tertiary);
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--neutral-gray-dark);
}

/* 响应式适配 */
@media (max-width: 1024px) {
  .nav-menu {
    width: 200px;
  }
  .page-container {
    margin-left: 200px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    width: 0;
    overflow: hidden;
  }
  .page-container {
    margin-left: 0;
  }
  .brand-title {
    font-size: 16px;
  }
}

/* 打印样式 - 导出PDF时应用 */
@media print {
  .brand-header {
    background: var(--rheem-red) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .btn-primary {
    background: var(--rheem-red) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .card-header {
    border-bottom-color: var(--rheem-red) !important;
  }
  a {
    text-decoration: none;
    color: inherit;
  }
  a[href]:after {
    content: " (" attr(href) ")";
  }
}
