/* Ocean 管理中心自定义样式 */

:root {
  --ocean-primary: #007bff;
  --ocean-secondary: #6c757d;
  --ocean-success: #28a745;
  --ocean-warning: #ffc107;
  --ocean-danger: #dc3545;
  --ocean-info: #17a2b8;
  --ocean-light: #f8f9fa;
  --ocean-dark: #343a40;
}

/* 自定义主题色 */
.main-header .navbar-brand {
  color: var(--ocean-primary) !important;
}

/* 数据绑定选择框样式 */
.binding-select-container {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #fff;
  max-height: 200px;
  overflow-y: auto;
}

.binding-options-list {
  padding: 0.5rem;
}

.binding-option {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  transition: background-color 0.15s ease-in-out;
  cursor: pointer;
}

.binding-option:hover {
  background-color: #f8f9fa;
}

.binding-option input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.1);
}

.binding-option.selected {
  background-color: #e3f2fd;
  border: 1px solid #2196f3;
}

.binding-option .option-text {
  flex: 1;
  font-size: 0.9rem;
}

.binding-option .option-category {
  font-size: 0.8rem;
  color: #6c757d;
  margin-left: 0.5rem;
}

.selected-badges {
  margin-top: 0.5rem;
}

.selected-badge {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  margin: 0.125rem;
  position: relative;
}

.selected-badge .remove-btn {
  background: none;
  border: none;
  color: white;
  margin-left: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.selected-badge .remove-btn:hover {
  color: #ffc107;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background-color: var(--ocean-primary);
  color: #fff;
}

/* 卡片样式增强 */
.card {
  border: none;
  box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
  border-radius: 8px;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0 !important;
}

/* 统计卡片样式 */
.small-box {
  border-radius: 8px;
  overflow: hidden;
}

.small-box .inner h3 {
  font-weight: 600;
}

.small-box .icon {
  opacity: 0.8;
}

/* 表格样式 */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: var(--ocean-dark);
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* 按钮样式 */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 状态标签 */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
  border-radius: 6px;
}

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

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

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

.badge-info {
  background-color: var(--ocean-info);
}

/* 模态框样式 */
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 12px 12px 0 0;
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 12px 12px;
}

/* 表单样式 */
.form-control {
  border-radius: 6px;
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--ocean-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group label {
  font-weight: 600;
  color: var(--ocean-dark);
  margin-bottom: 0.5rem;
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 0.3rem solid #f3f3f3;
  border-top: 0.3rem solid var(--ocean-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 通知样式 */
.alert {
  border: none;
  border-radius: 8px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* 配置卡片样式 */
.config-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.config-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.config-card.recommended {
  border-left: 4px solid var(--ocean-warning);
}

.config-card.openai {
  border-left: 4px solid #10a37f;
}

.config-card.claude {
  border-left: 4px solid #d97706;
}

.config-card.gemini {
  border-left: 4px solid #4285f4;
}

.config-card.custom {
  border-left: 4px solid var(--ocean-secondary);
}

/* 操作按钮组 */
.btn-group-vertical .btn {
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

.btn-group-vertical .btn:last-child {
  margin-bottom: 0;
}

/* 仪表盘状态信息 */
#system-status .status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.95rem;
}

#system-status .status-line:last-child {
  border-bottom: none;
}

#system-status .status-label {
  color: var(--ocean-secondary);
}

#system-alerts .alert {
  margin-bottom: 0.75rem;
}

#system-alerts .alert:last-child {
  margin-bottom: 0;
}

#recent-users-list .list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

#recent-users-list .user-meta {
  display: flex;
  flex-direction: column;
}

#recent-users-list .user-meta span:last-child {
  font-size: 0.75rem;
  color: var(--ocean-secondary);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1rem;
  }
  
  .table-responsive {
    border-radius: 8px;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .btn-group-vertical {
    width: 100%;
  }
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 侧边栏增强 */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 面包屑导航 */
.breadcrumb {
  background-color: transparent;
  padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  color: var(--ocean-secondary);
}

/* 搜索框样式 */
.form-control-sidebar {
  border-radius: 20px;
  border: 1px solid #ced4da;
}

/* 用户面板样式 */
.user-panel .image img {
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 品牌链接样式 */
.brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text {
  font-weight: 600;
}

/* 内容区域样式 */
.content-wrapper {
  background-color: #f4f6f9;
}

.content-header h1 {
  color: var(--ocean-dark);
  font-weight: 600;
}

/* 页脚样式 */
.main-footer {
  background-color: #fff;
  border-top: 1px solid #dee2e6;
  color: var(--ocean-secondary);
}

/* 工具提示样式 */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  background-color: var(--ocean-dark);
  border-radius: 6px;
}

/* 进度条样式 */
.progress {
  height: 8px;
  border-radius: 4px;
  background-color: #e9ecef;
}

.progress-bar {
  border-radius: 4px;
}

/* 分页样式 */
.pagination {
  border-radius: 6px;
}

.page-link {
  border-radius: 6px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  color: var(--ocean-primary);
}

.page-link:hover {
  background-color: var(--ocean-primary);
  border-color: var(--ocean-primary);
  color: #fff;
}

.page-item.active .page-link {
  background-color: var(--ocean-primary);
  border-color: var(--ocean-primary);
}

/* 数据表格增强 */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
  color: var(--ocean-dark);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--ocean-primary) !important;
  border-color: var(--ocean-primary) !important;
  color: #fff !important;
}

/* 角色头像圆形样式 */
.role-avatar {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #dee2e6;
}

.role-avatar-large {
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #dee2e6;
}

/* 自定义确认对话框样式 */
#confirmModal .modal-dialog {
  max-width: 400px;
}

#confirmModal .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#confirmModal .modal-header {
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid #f0ad4e;
}

#confirmModal .modal-footer {
  border-radius: 0 0 12px 12px;
  border-top: 1px solid #dee2e6;
}

#confirmModal .btn {
  min-width: 80px;
  font-weight: 500;
}

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

#confirmModal .btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  transform: translateY(-1px);
}

#confirmModal .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

#confirmModal .btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
  transform: translateY(-1px);
}

/* 自定义提示框样式 */
#alertModal .modal-dialog {
  max-width: 400px;
}

#alertModal .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#alertModal .modal-header {
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid #dee2e6;
}

#alertModal .modal-footer {
  border-radius: 0 0 12px 12px;
  border-top: 1px solid #dee2e6;
}

#alertModal .btn {
  min-width: 80px;
  font-weight: 500;
}

#alertModal .btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

#alertModal .btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
  transform: translateY(-1px);
}

/* 提示框类型样式 */
#alertModal.success .modal-header {
  background-color: #d4edda;
  color: #155724;
  border-bottom-color: #c3e6cb;
}

#alertModal.success .modal-title i {
  color: #28a745;
}

#alertModal.success #alertModalIcon {
  color: #28a745;
}

#alertModal.error .modal-header {
  background-color: #f8d7da;
  color: #721c24;
  border-bottom-color: #f5c6cb;
}

#alertModal.error .modal-title i {
  color: #dc3545;
}

#alertModal.error #alertModalIcon {
  color: #dc3545;
}

#alertModal.warning .modal-header {
  background-color: #fff3cd;
  color: #856404;
  border-bottom-color: #ffeaa7;
}

#alertModal.warning .modal-title i {
  color: #ffc107;
}

#alertModal.warning #alertModalIcon {
  color: #ffc107;
}

#alertModal.info .modal-header {
  background-color: #d1ecf1;
  color: #0c5460;
  border-bottom-color: #bee5eb;
}

#alertModal.info .modal-title i {
  color: #17a2b8;
}

#alertModal.info #alertModalIcon {
  color: #17a2b8;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
