/* ================================================
   证券中台管理系统 - 主样式文件
   Securities Middle Platform - Main Stylesheet
   ================================================ */

:root {
  /* 主色调 - 专业中台蓝 */
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --primary-dark: #1E3A8A;
  
  /* 辅助色 */
  --secondary: #F97316;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  
  /* 中性色 */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  
  /* 布局尺寸 */
  --sidebar-width: 240px;
  --navbar-height: 60px;
  --content-max-width: 1400px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* ================================================
   通用样式
   ================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", 
               "Microsoft YaHei", sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

/* ================================================
   主布局
   ================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  box-shadow: var(--shadow);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section-title {
  padding: 1.5rem 1.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  border-left: 4px solid var(--primary-dark);
}

.nav-item-icon {
  width: 20px;
  margin-right: 0.75rem;
  font-size: 1.125rem;
}

.nav-submenu {
  margin-left: 2.5rem;
}

.nav-submenu .nav-item {
  padding: 0.5rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 400;
}

/* 导航子菜单标题 */
.nav-submenu-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

/* 导航子项 */
.nav-subitem {
  padding-left: 2.5rem !important;
  font-size: 0.8rem;
  font-weight: 400;
}

.nav-subitem .nav-item-icon {
  font-size: 1rem;
}

/* 导航徽章 */
.nav-badge {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: var(--gray-400);
  border-radius: 9999px;
  min-width: 1.5rem;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.3);
}

.nav-item:hover .nav-badge {
  opacity: 0.8;
}

/* 主内容区 */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.navbar {
  height: var(--navbar-height);
  background: white;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-search {
  position: relative;
  width: 300px;
}

.navbar-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s;
}

.navbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.navbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-icon {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--gray-700);
  transition: all 0.2s;
  cursor: pointer;
}

.navbar-icon:hover {
  background: var(--gray-100);
}

.navbar-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.navbar-user:hover {
  background: var(--gray-100);
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* 内容区域 */
.content-area {
  flex: 1;
  padding: 2rem;
  max-width: var(--content-max-width);
  width: 100%;
}

/* ================================================
   页面标题
   ================================================ */

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ================================================
   卡片组件
   ================================================ */

.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* ================================================
   统计卡片
   ================================================ */

.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-change {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* ================================================
   按钮组件
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ================================================
   表单组件
   ================================================ */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-label-required::after {
  content: '*';
  color: var(--danger);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

/* ================================================
   表格组件
   ================================================ */

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

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

.table thead {
  background: var(--gray-50);
}

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* ================================================
   标签组件
   ================================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-primary {
  background: #DBEAFE;
  color: var(--primary);
}

.tag-success {
  background: #D1FAE5;
  color: var(--success);
}

.tag-warning {
  background: #FEF3C7;
  color: var(--warning);
}

.tag-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.tag-gray {
  background: var(--gray-200);
  color: var(--gray-700);
}

.tag-cyan {
  background: #CFFAFE;
  color: #0891B2;
}

.tag-blue {
  background: #DBEAFE;
  color: #1E40AF;
}

.tag-green {
  background: #D1FAE5;
  color: #065F46;
}

/* ================================================
   徽章组件
   ================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background: #DBEAFE;
  color: var(--primary);
}

.badge-success {
  background: #D1FAE5;
  color: var(--success);
}

.badge-warning {
  background: #FEF3C7;
  color: var(--warning);
}

.badge-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-gray {
  background: var(--gray-200);
  color: var(--gray-700);
}

.badge-blue {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-purple {
  background: #E9D5FF;
  color: #6B21A8;
}

.badge-teal {
  background: #CCFBF1;
  color: #0D9488;
}

/* ================================================
   步骤条
   ================================================ */

.steps {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  position: relative;
  z-index: 2;
}

.step.active .step-number {
  background: var(--primary);
  color: white;
}

.step.completed .step-number {
  background: var(--success);
  color: white;
}

.step-label {
  margin-left: 0.75rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.step.active .step-label {
  color: var(--gray-900);
  font-weight: 500;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 1rem;
}

.step.completed .step-line {
  background: var(--success);
}

/* ================================================
   响应式
   ================================================ */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .navbar-search {
    width: 200px;
  }
  
  .content-area {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
}


