/* ============================================
   Docker 管理面板 - 自定义样式
   仿宝塔面板风格
   ============================================ */

:root {
  --sidebar-width: 220px;
  --header-height: 60px;
  --primary-color: #409eff;
  --success-color: #67c23a;
  --warning-color: #e6a23c;
  --danger-color: #f56c6c;
  --info-color: #909399;
  --bg-dark: #1d1e1f;
  --bg-sidebar: #252526;
  --bg-main: #f0f2f5;
  --bg-card: #ffffff;
  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --border-color: #e4e7ed;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
}

#app {
  height: 100%;
  display: flex;
}

/* ============ 侧边栏 ============ */

.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  color: #ccc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 16px;
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #409eff, #337ecc);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
}

.sidebar-header .logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.sidebar-header .logo-version {
  font-size: 10px;
  color: #666;
  margin-left: 2px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: #999;
  gap: 10px;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: rgba(255,255,255,0.05);
  color: #ddd;
}

.menu-item.active {
  background: rgba(64,158,255,0.1);
  color: #409eff;
  border-left-color: #409eff;
}

.menu-item .menu-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-item .menu-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: #999;
}

.menu-item.active .menu-badge {
  background: rgba(64,158,255,0.2);
  color: #409eff;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #666;
  text-align: center;
}

.sidebar-footer .docker-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.running {
  background: #67c23a;
  box-shadow: 0 0 6px rgba(103,194,58,0.6);
}

.status-dot.stopped {
  background: #f56c6c;
}

/* ============ 主内容区 ============ */

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-header {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.main-header .page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.main-header .page-title small {
  font-size: 13px;
  font-weight: normal;
  color: var(--text-secondary);
  margin-left: 8px;
}

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

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.main-content::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.main-content::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 3px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

/* ============ 仪表盘卡片 ============ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.stat-card .stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 48px;
  opacity: 0.15;
  color: var(--primary-color);
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-detail {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
}

.stat-card .stat-detail span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card.docker .stat-icon { color: #409eff; }
.stat-card.containers .stat-icon { color: #67c23a; }
.stat-card.images .stat-icon { color: #e6a23c; }
.stat-card.volumes .stat-icon { color: #f56c6c; }
.stat-card.networks .stat-icon { color: #909399; }

/* ============ 信息面板 ============ */

.info-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.info-panel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-panel .panel-header .panel-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-panel .panel-body {
  padding: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item .info-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.info-item .info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ============ 容器列表 ============ */

.container-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  cursor: pointer;
}

.container-row:hover {
  background: #f5f7fa;
}

.container-row:last-child {
  border-bottom: none;
}

.container-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.container-status.running {
  background: #f0f9eb;
  color: #67c23a;
}

.container-status.exited, .container-status.created {
  background: #f4f4f5;
  color: #909399;
}

.container-status.paused {
  background: #fdf6ec;
  color: #e6a23c;
}

.container-status.restarting {
  background: #ecf5ff;
  color: #409eff;
}

/* ============ 日志区域 ============ */

.log-viewer {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  padding: 16px;
  border-radius: 6px;
  overflow: auto;
  max-height: 500px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-viewer::-webkit-scrollbar {
  width: 6px;
}

.log-viewer::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

/* ============ 终端 ============ */

.terminal-container {
  background: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
}

.terminal-header {
  background: #333;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ccc;
  font-size: 13px;
}

.terminal-body {
  padding: 12px 16px;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
}

.terminal-output {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.terminal-prompt {
  color: #67c23a;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  margin-right: 8px;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d4d4d4;
  font-family: 'Consolas', monospace;
  font-size: 13px;
  caret-color: #fff;
}

/* ============ 工具类 ============ */

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar-header .logo-text,
  .sidebar-header .logo-version,
  .menu-item .menu-label,
  .menu-item .menu-badge,
  .sidebar-footer span {
    display: none;
  }
  .menu-item {
    justify-content: center;
    padding: 12px;
  }
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ============ 表格美化 ============ */

.el-table th.el-table__cell {
  background: #f5f7fa !important;
  color: #606266 !important;
  font-weight: 600 !important;
}

/* ============ 对话框 ============ */

.dialog-body {
  padding: 20px;
}

/* ============ 映像标签 ============ */

.image-tag {
  display: inline-block;
  background: #ecf5ff;
  color: #409eff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

/* ============ 端口标签 ============ */

.port-tag {
  display: inline-block;
  background: #f0f9eb;
  color: #67c23a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

.port-tag.unpublished {
  background: #f4f4f5;
  color: #909399;
}

/* ============ 加载动画 ============ */

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* ============ 禅模式边框 ============ */

.section-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.section-card .section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card .section-body {
  padding: 16px 20px;
}

/* ============ 资源进度条 ============ */

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

.resource-bar .bar-label {
  width: 60px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.resource-bar .bar-track {
  flex: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.resource-bar .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.resource-bar .bar-value {
  width: 60px;
  text-align: right;
  font-size: 13px;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ============ 通知提醒 ============ */

.notification-area {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
}

/* ============ 快捷操作按钮 ============ */

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

.quick-actions .el-button {
  min-width: 80px;
}

/* ============ 登录页面 ============ */

.login-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 30%, #16213e 60%, #0f3460 100%);
  z-index: 9999;
}

.login-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(64,158,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(103,194,58,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(230,162,60,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 400px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.login-header {
  text-align: center;
  padding: 40px 40px 20px;
}

.login-logo {
  margin-bottom: 20px;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  background: linear-gradient(135deg, #409eff, #337ecc);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(64,158,255,0.3);
}

.login-header h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.login-header p {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  margin: 0;
}

.login-body {
  padding: 20px 40px;
}

.login-body .el-form-item {
  margin-bottom: 20px;
}

.login-body .el-input__wrapper {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
  border-radius: 8px;
  transition: all 0.3s;
}

.login-body .el-input__wrapper:hover,
.login-body .el-input__wrapper.is-focus {
  border-color: #409eff;
  background: rgba(255,255,255,0.12);
}

.login-body .el-input__inner {
  color: #fff;
  height: 42px;
}

.login-body .el-input__inner::placeholder {
  color: rgba(255,255,255,0.3);
}

.login-btn {
  width: 100%;
  height: 44px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  background: linear-gradient(135deg, #409eff, #337ecc);
  border: none;
  transition: all 0.3s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(64,158,255,0.4);
}

.login-error {
  text-align: center;
  color: #f56c6c;
  font-size: 13px;
  margin-top: -8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(245,108,108,0.1);
  border-radius: 6px;
  border: 1px solid rgba(245,108,108,0.2);
}

.login-locked {
  color: #e6a23c;
  background: rgba(230,162,60,0.1);
  border-color: rgba(230,162,60,0.2);
}

.login-footer {
  text-align: center;
  padding: 16px 40px 30px;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
}