/* ========== MiniHost 全局样式 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #333; background: #f5f7fa;
}
a { color: #409eff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- 通用工具 ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.text-muted { color: #999; }
.text-danger { color: #f56c6c; }
.text-success { color: #67c23a; }
.text-warning { color: #e6a23c; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ---- 按钮 ---- */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 4px;
  border: 1px solid #dcdfe6; background: #fff; color: #606266;
  cursor: pointer; font-size: 14px; line-height: 1;
  transition: all .2s;
}
.btn:hover { border-color: #409eff; color: #409eff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #409eff; border-color: #409eff; color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-link { border: none; background: none; color: #409eff; padding: 4px 8px; }
.btn-link:hover { text-decoration: underline; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: #606266; font-size: 13px; }
.form-control {
  width: 100%; padding: 8px 12px; border: 1px solid #dcdfe6; border-radius: 4px;
  font-size: 14px; background: #fff; transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: #409eff; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ---- 卡片 ---- */
.card {
  background: #fff; border-radius: 4px; padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid #ebeef5;
}

/* ---- 表格 ---- */
.table {
  width: 100%; border-collapse: collapse; background: #fff;
}
.table th, .table td {
  padding: 12px 10px; text-align: left; border-bottom: 1px solid #ebeef5;
}
.table th { background: #fafafa; color: #606266; font-weight: 600; font-size: 13px; }
.table tbody tr:hover { background: #f5f7fa; }
.table-empty { text-align: center; padding: 40px; color: #999; }

/* ---- 状态徽章 ---- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; line-height: 1.5;
}
.badge-success { background: #f0f9eb; color: #67c23a; }
.badge-warning { background: #fdf6ec; color: #e6a23c; }
.badge-danger { background: #fef0f0; color: #f56c6c; }
.badge-info { background: #f4f4f5; color: #909399; }
.badge-primary { background: #ecf5ff; color: #409eff; }

/* ---- 分页 ---- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.pagination .page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid #dcdfe6;
  background: #fff; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.pagination .page-btn.active { background: #409eff; border-color: #409eff; color: #fff; }
.pagination .page-btn:disabled { opacity: .5; cursor: not-allowed; }
.pagination .page-info { color: #909399; font-size: 13px; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: 8px; width: 480px; max-height: 80vh;
  display: flex; flex-direction: column; box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid #ebeef5;
  font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
.modal-close { cursor: pointer; color: #999; font-size: 20px; border: none; background: none; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #ebeef5; text-align: right; }
.modal-footer .btn + .btn { margin-left: 10px; }

/* ---- Toast ---- */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 10px 20px; border-radius: 4px; color: #fff; font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2); animation: toastIn .3s ease;
}
.toast-success { background: #67c23a; }
.toast-error { background: #f56c6c; }
.toast-info { background: #409eff; }
.toast-warning { background: #e6a23c; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Loading ---- */
.loading {
  display: flex; justify-content: center; align-items: center;
  padding: 40px; color: #999;
}
.spinner {
  width: 20px; height: 20px; border: 2px solid #e4e7ed;
  border-top-color: #409eff; border-radius: 50%;
  animation: spin .8s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 登录注册页 ---- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-box {
  background: #fff; border-radius: 8px; padding: 40px;
  width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.auth-box h1 { text-align: center; margin-bottom: 8px; font-size: 24px; color: #333; }
.auth-box .subtitle { text-align: center; color: #999; margin-bottom: 30px; font-size: 13px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-disclaimer {
  margin-top: 16px; padding: 10px; background: #fdf6ec; border-radius: 4px;
  font-size: 12px; color: #e6a23c; text-align: center;
}

/* ---- 控制台布局 ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #304156; color: #bfcbd9;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-logo {
  height: 60px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 600;
  border-bottom: 1px solid #263445;
}
.sidebar-logo .dot { color: #409eff; }
.sidebar-menu { flex: 1; padding: 10px 0; }
.sidebar-menu .menu-item {
  display: flex; align-items: center; padding: 12px 20px;
  color: #bfcbd9; cursor: pointer; border-left: 3px solid transparent;
  transition: all .2s;
}
.sidebar-menu .menu-item:hover { background: #263445; color: #fff; text-decoration: none; }
.sidebar-menu .menu-item.active {
  background: #409eff; color: #fff; border-left-color: #fff;
}
.sidebar-menu .menu-item .icon { width: 20px; margin-right: 10px; text-align: center; }
.sidebar-user {
  padding: 12px 20px; border-top: 1px solid #263445;
  font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}
.sidebar-user .username { color: #fff; }
.sidebar-user a { color: #bfcbd9; font-size: 12px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 50px; background: #fff; border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar .breadcrumb { color: #606266; font-size: 14px; }
.page-content { flex: 1; padding: 20px; overflow-y: auto; }

/* ---- 管理后台特有 ---- */
.admin-sidebar { background: #1f2d3d; }
.admin-sidebar .sidebar-logo { background: #1a252f; }
.admin-sidebar .menu-item.active { background: #1e9fff; }

/* ---- 状态提示页 ---- */
.status-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 40px;
}
.status-page .icon { font-size: 80px; margin-bottom: 20px; }
.status-page h1 { font-size: 28px; margin-bottom: 12px; color: #333; }
.status-page p { color: #666; max-width: 500px; line-height: 1.8; }

/* ---- 套餐选择 ---- */
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.package-card {
  border: 2px solid #ebeef5; border-radius: 8px; padding: 20px;
  cursor: pointer; text-align: center; transition: all .2s;
}
.package-card:hover { border-color: #409eff; }
.package-card.selected { border-color: #409eff; background: #ecf5ff; }
.package-card .duration { font-size: 16px; color: #606266; margin-bottom: 8px; }
.package-card .price { font-size: 24px; font-weight: 600; color: #409eff; }
.package-card .price .unit { font-size: 14px; }
.package-card .save { font-size: 12px; color: #e6a23c; margin-top: 6px; }

/* ---- 文件树 ---- */
.file-tree { font-family: Menlo, Consolas, monospace; }
.file-tree .file-row {
  display: flex; align-items: center; padding: 6px 8px; border-radius: 4px;
  cursor: pointer; font-size: 13px;
}
.file-tree .file-row:hover { background: #f5f7fa; }
.file-tree .file-row .name { flex: 1; }
.file-tree .file-row .size { color: #999; font-size: 12px; margin-right: 12px; }
.file-tree .file-row .del { opacity: 0; color: #f56c6c; font-size: 12px; }
.file-tree .file-row:hover .del { opacity: 1; }
.file-tree .folder-icon { color: #e6a23c; margin-right: 6px; }
.file-tree .file-icon { color: #909399; margin-right: 6px; }

/* ---- 进度条 ---- */
.progress-bar { height: 6px; background: #ebeef5; border-radius: 3px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: #409eff; transition: width .3s; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .menu-item span, .sidebar-user { display: none; }
  .sidebar-menu .menu-item { justify-content: center; padding: 12px; }
  .package-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
}
