/* ========== 功能页面通用样式 ========== */

/* Flash 消息提示 */
.flash-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
}
.flash-success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}
.flash-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

/* 页面顶部栏 */
.feature-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.feature-page-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-page-header h2 svg {
  flex-shrink: 0;
}

.feature-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 简易时间选择器（非日历弹窗式） */
.simple-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-lighter);
  flex-wrap: wrap;
}

.simple-date-filter label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 14px;
}

.simple-date-filter .date-sep {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* 双栏布局 */
.feature-two-col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.feature-two-col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 面板卡片 */
.feature-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 20px;
}

.feature-panel h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-panel h3 svg {
  flex-shrink: 0;
  color: var(--primary-blue);
}

/* 面板内表单行 */
.feature-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.feature-form-row .form-group {
  margin-bottom: 0;
}

.feature-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* 状态徽章 */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-tag-active {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-tag-inactive {
  background: #f5f5f5;
  color: #999;
}

.status-tag-pending {
  background: #fff7e6;
  color: #d48806;
}

.status-tag-resolved {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-tag-info {
  background: #e3f2fd;
  color: #1976d2;
}

.status-tag-warning {
  background: #fff3e0;
  color: #e65100;
}

.status-tag-critical {
  background: #ffebee;
  color: #c62828;
}

.status-tag-low {
  background: #e8f5e9;
  color: #388e3c;
}

.status-tag-medium {
  background: #fff3e0;
  color: #f57c00;
}

.status-tag-high {
  background: #ffebee;
  color: #c62828;
}

/* 操作按钮组 */
.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 列表项卡片 */
.feature-list-item {
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
  border-bottom: 1px solid var(--border-lighter);
}

.feature-list-item:last-child {
  border-bottom: none;
}

.feature-list-item:hover {
  background: #fafafa;
}

.feature-list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.feature-list-item-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.feature-list-item-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.feature-list-item-badges {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* 告警日志项 */
.alert-log-item {
  padding: 12px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary-blue);
  margin-bottom: 10px;
}

.alert-log-item-pending {
  background: #fff7e6;
  border-left-color: #ff7a45;
}

.alert-log-item-read {
  background: #f8f9fa;
  border-left-color: var(--primary-blue);
}

.alert-log-item-level-critical {
  border-left-color: #f5222d;
}

.alert-log-item-level-warning {
  border-left-color: #ff7a45;
}

.alert-log-item-level-info {
  border-left-color: #1890ff;
}

.alert-log-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-log-item-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.alert-log-item-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* 漏斗可视化 */
.funnel-step {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.funnel-step-index {
  width: 60px;
  text-align: right;
  font-size: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.funnel-step-body {
  flex: 1;
  min-width: 0;
}

.funnel-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.funnel-step-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.funnel-step-count {
  color: var(--text-secondary);
  font-size: 13px;
}

.funnel-step-bar {
  height: 30px;
  background: #f0f0f0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.funnel-step-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1890ff, #69c0ff);
  border-radius: var(--radius-md);
  transition: width 0.5s;
}

.funnel-step-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 12px;
}

.funnel-step-url {
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.funnel-step-conversion {
  color: #52c41a;
  font-weight: 500;
}

.funnel-summary {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-lighter);
  flex-wrap: wrap;
}

.funnel-summary-item {
  text-align: center;
}

.funnel-summary-value {
  font-size: 28px;
  font-weight: 600;
}

.funnel-summary-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 5px;
}

/* 路径页面统计 */
.path-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.path-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  text-align: center;
}

.path-stat-value {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
}

.path-stat-label {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* 路径跳转项 */
.transition-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.transition-arrow {
  color: var(--primary-blue);
  font-size: 16px;
  flex-shrink: 0;
}

.transition-page {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-primary);
}

.transition-count {
  font-weight: 600;
  color: #52c41a;
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* 常见路径项 */
.common-path-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.common-path-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: monospace;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-path-stats {
  display: flex;
  gap: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.common-path-stat {
  font-weight: 500;
  font-size: 13px;
}

/* 热力图 */
.heatmap-container {
  position: relative;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.heatmap-placeholder {
  min-height: 300px;
  position: relative;
}

.heatmap-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.heatmap-cell {
  position: absolute;
  cursor: pointer;
}

.heatmap-intensity {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,0,0,0.6) 0%, rgba(255,165,0,0.3) 50%, transparent 100%);
  border-radius: 50%;
}

/* API密钥样式 */
.api-key-code {
  display: inline-block;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

/* API文档 */
.api-docs h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 16px 0 8px;
}

.api-docs h4:first-child {
  margin-top: 0;
}

.api-docs code {
  display: inline-block;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #c7254e;
}

.api-docs ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.api-docs ul li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 13px;
}

.api-docs ul li:last-child {
  border-bottom: none;
}

/* 模态框 */
.feature-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.feature-modal.show {
  display: flex;
}

.feature-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.feature-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.feature-modal-body .form-group {
  margin-bottom: 16px;
}

.feature-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 颜色选择器 */
.color-picker-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-picker-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.color-picker-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.color-picker-item input[type="radio"]:checked + .color-swatch {
  border-color: var(--text-primary);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-swatch:hover {
  transform: scale(1.1);
}

/* 入口/退出列表 */
.page-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.page-rank-index {
  width: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.page-rank-url {
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-rank-count {
  font-weight: 600;
  flex-shrink: 0;
}

/* 复选框组 */
.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
  .feature-two-col {
    grid-template-columns: 1fr;
  }

  .feature-two-col-equal {
    grid-template-columns: 1fr;
  }

  .path-stats-grid {
    grid-template-columns: 1fr;
  }

  .funnel-summary {
    gap: 24px;
  }

  .funnel-summary-value {
    font-size: 22px;
  }

  .funnel-step-index {
    width: 40px;
  }
}

@media (max-width: 768px) {
  .feature-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .feature-form-row {
    grid-template-columns: 1fr;
  }

  .simple-date-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .funnel-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .funnel-step-index {
    width: auto;
    text-align: left;
  }

  .common-path-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .common-path-stats {
    flex-wrap: wrap;
  }

  .transition-item {
    flex-wrap: wrap;
  }

  .feature-modal-content {
    width: 95%;
    padding: 16px;
  }

  .feature-panel {
    padding: 16px;
  }

  .alert-log-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .action-btns {
    width: 100%;
  }

  .action-btns .btn {
    flex: 1;
    text-align: center;
  }

  .path-stat-value {
    font-size: 24px;
  }
}

/* ========== 时间选择器美化 ========== */

.simple-date-filter .date-sep {
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 0 2px;
}

.simple-date-filter .btn-sm {
  border-radius: 6px;
}

/* 时间范围下拉选择器美化 */
.feature-page-header select.form-control,
.simple-date-filter select.form-control {
  padding: 8px 32px 8px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 100px;
}

.feature-page-header select.form-control:hover,
.simple-date-filter select.form-control:hover {
  border-color: var(--primary-blue);
}

.feature-page-header select.form-control:focus,
.simple-date-filter select.form-control:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* ========== 事件页面日期选择器 ========== */
.event-date-picker {
  position: relative;
}

.event-date-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
  transition: all 0.3s;
}

.event-date-input:hover {
  border-color: var(--primary-blue);
}

.event-calendar-popup {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1100;
  padding: 16px;
  min-width: 280px;
}

.event-calendar-popup.show {
  display: block;
}

/* ========== 消息通知页面 ========== */
.notifications-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}
.notifications-container {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-lighter);
}
.notifications-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}
.notifications-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-lighter);
}
.notifications-tab {
  padding: 12px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notifications-tab:hover {
  color: var(--primary-blue);
}
.notifications-tab.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  font-weight: 600;
}
.notifications-tab-count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--color-danger);
  border-radius: 9px;
  padding: 0 4px;
}
.notifications-list {
  padding: 0;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-lighter);
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.notification-item:last-child {
  border-bottom: none;
}
.notification-item:hover {
  background: #fafbfc;
}
.notification-unread {
  background: #f0f7ff;
}
.notification-unread:hover {
  background: #e6f1ff;
}
.notification-type-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 50%;
}
.notification-body {
  flex: 1;
  min-width: 0;
}
.notification-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notification-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}
a.notification-title:hover {
  color: var(--primary-blue);
}
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-blue);
  flex-shrink: 0;
}
.notification-content {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}
.notification-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.notification-time {
  font-size: 12px;
  color: var(--text-tertiary);
}
.notification-type-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.notification-type-system {
  background: #e6f7ff;
  color: #1890ff;
}
.notification-type-alert {
  background: #fff1f0;
  color: #ff4d4f;
}
.notification-type-account {
  background: #f6ffed;
  color: #52c41a;
}
.notification-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-xs {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
}

/* ========== 后台管理样式 ========== */
.admin-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #1890ff;
}
.admin-filter-bar {
  margin-bottom: 16px;
}
.admin-filter-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.data-table-row-highlight {
  background: #f0f7ff !important;
}
.data-table-row-highlight:hover {
  background: #e6f1ff !important;
}
