:root {
  --yx-primary: #1a1a1a;
  --yx-primary-dark: #000000;
  --yx-primary-light: #f3f4f6;
  --yx-bg: #f7f7f7;
  --yx-card: #ffffff;
  --yx-text: #1a1a1a;
  --yx-muted: #1a1a1a;
  --yx-border: #e5e5e5;
  --yx-radius: 4px;
  --yx-radius-sm: 4px;
  --yx-black: #1a1a1a;
  --yx-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .05);
}

* { -webkit-tap-highlight-color: transparent; }

body {
  background: var(--yx-bg);
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 全站文字统一黑色 */
a { text-decoration: none; color: #1a1a1a; }
h1, h2, h3, h4, h5, h6, strong, b, label { color: #1a1a1a; }
.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info,
.text-muted, .text-muted-sm, .text-body { color: #1a1a1a !important; }
.stat-value { color: #1a1a1a !important; }

/* 顶部导航 */
.yx-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--yx-border);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.yx-brand { font-weight: 700; font-size: 17px; color: #1a1a1a; letter-spacing: .3px; }
.yx-navbar .nav-link { color: #1a1a1a; font-size: 14px; padding: .35rem .8rem; border-radius: var(--yx-radius); }
.yx-navbar .nav-link.active, .yx-navbar .nav-link:hover { color: #1a1a1a; background: var(--yx-primary-light); }

/* 卡片 */
.yx-card {
  background: var(--yx-card);
  border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius);
  box-shadow: var(--yx-shadow);
}
.yx-card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.yx-card-hover:active { transform: scale(.985); }

/* 套餐卡片 */
.plan-card { height: 100%; display: flex; flex-direction: column; }
.plan-card .plan-title { font-size: 17px; font-weight: 700; }
.plan-badge {
  font-size: 11px; padding: 2px 8px; border-radius: var(--yx-radius);
  background: var(--yx-primary-light); color: #1a1a1a;
}
/* 区域/状态标签（与套餐徽标同款，避免文字无样式） */
.yx-console-badge {
  font-size: 11px; padding: 2px 8px; border-radius: var(--yx-radius);
  background: var(--yx-primary-light); color: #1a1a1a;
}
.plan-price { color: #1a1a1a; font-weight: 700; font-size: 22px; line-height: 1; }
.plan-price small { font-size: 12px; font-weight: 400; color: #1a1a1a; }
.plan-spec { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.plan-spec span {
  font-size: 12px; color: #1a1a1a;
  background: #f3f4f6; border-radius: var(--yx-radius); padding: 3px 8px;
}

/* 进度条 */
.yx-progress { height: 6px; background: #ececec; border-radius: var(--yx-radius); overflow: hidden; }
.yx-progress > div { height: 100%; background: #1a1a1a; border-radius: var(--yx-radius); }

/* ============================================================
   按钮：主按钮黑底白字，其余按钮黑字浅底；圆角统一 4px
   ============================================================ */
.btn { border-radius: var(--yx-radius); font-size: 14px; color: #1a1a1a; }
.btn-primary { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary:not(:disabled):not(.disabled):active {
  background: #000; border-color: #000; color: #fff;
}
.btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-danger,
.btn-outline-success, .btn-outline-dark, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light {
  background: #fff; color: #1a1a1a; border: 1px solid #d4d4d4;
}
.btn-secondary:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-danger:hover,
.btn-outline-success:hover, .btn-outline-dark:hover, .btn-success:hover, .btn-danger:hover,
.btn-warning:hover, .btn-info:hover, .btn-light:hover,
.btn-outline-primary.active, .btn-outline-secondary.active, .btn-outline-primary:active,
.btn-secondary:not(:disabled):not(.disabled):active {
  background: #f3f4f6; color: #1a1a1a; border-color: #1a1a1a;
}
.btn-link { color: #1a1a1a; text-decoration: none; }
.btn-link:hover { color: #000; text-decoration: underline; }
/* 按钮内文字/图标一律黑色（主按钮除外） */
.btn.text-primary, .btn.text-success, .btn.text-danger,
.btn.text-warning, .btn.text-info, .btn.text-secondary { color: #1a1a1a !important; }
/* 单选按钮组选中态：黑底白字 */
.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary {
  background: #1a1a1a; border-color: #1a1a1a; color: #fff;
}
.btn-lg { padding: .7rem 1.1rem; font-size: 15px; }

/* 前台黑白主题 */
.yx-front { background: #fff; }
.yx-front .yx-card { color: #1a1a1a; border-radius: var(--yx-radius); }

/* 底部固定操作栏 */
.yx-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--yx-border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: 1030;
}

/* 用户中心侧边菜单 */
.yx-user-nav { position: sticky; top: 76px; }
.yx-user-nav .list-group-item {
  border: 0; border-radius: var(--yx-radius) !important; margin-bottom: 4px;
  color: #1a1a1a; font-size: 14px; padding: .6rem .9rem;
}
.yx-user-nav .list-group-item.active { background: #1a1a1a; color: #fff; }

/* 主机卡片 */
.host-card .host-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px; font-weight: 600; color: #1a1a1a;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.status-running .status-dot { background: #22c55e; }
.status-stopped .status-dot { background: #94a3b8; }
.status-expired .status-dot { background: #f59e0b; }
.status-abnormal .status-dot { background: #ef4444; }
.status-banned .status-dot { background: #ef4444; }

/* 统计卡 */
.stat-card { padding: 16px; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; }
.stat-card .stat-label { font-size: 12px; color: #1a1a1a; }

/* 二维码 */
.qr-box { text-align: center; padding: 16px; }
.qr-box img { max-width: 220px; width: 100%; }
#qrcode { display: inline-block; padding: 10px; background: #fff; border-radius: var(--yx-radius); }
#qrcode img, #qrcode canvas { display: block; }

/* 表格 */
.table { font-size: 13px; color: #1a1a1a; }
.table > :not(caption) > * > * { padding: .6rem .5rem; }
.yx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 表单 */
.form-control, .form-select { border-radius: var(--yx-radius); border-color: #d4d4d4; font-size: 14px; color: #1a1a1a; }
.form-control:focus, .form-select:focus { border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(26, 26, 26, .1); }
.form-label { font-size: 13px; color: #1a1a1a; font-weight: 500; margin-bottom: .3rem; }

/* 页脚 */
.yx-footer { color: #1a1a1a; font-size: 12px; text-align: center; padding: 24px 16px 30px; }
.yx-footer a { color: #1a1a1a; }

/* 空状态 */
.yx-empty { text-align: center; padding: 50px 20px; color: #1a1a1a; }
.yx-empty .yx-empty-icon { font-size: 40px; opacity: .35; }

/* 后台 */
.yx-admin-sidebar {
  background: #ffffff; color: #1a1a1a; min-height: 100vh; width: 210px; position: fixed; top: 0; left: 0;
  padding: 18px 12px; overflow-y: auto; border-right: 1px solid var(--yx-border);
}
.yx-admin-sidebar .brand { color: #1a1a1a; font-weight: 700; font-size: 16px; padding: 6px 10px 18px; display: flex; align-items: center; gap: 8px; }
.yx-admin-sidebar a {
  color: #1a1a1a; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--yx-radius); font-size: 14px; margin-bottom: 2px;
}
.yx-admin-sidebar a svg { flex: 0 0 auto; opacity: .85; }
.yx-admin-sidebar a:hover { background: #f3f4f6; color: #1a1a1a; }
.yx-admin-sidebar a.active { background: #f3f4f6; color: #1a1a1a; font-weight: 600; }
.yx-admin-main { margin-left: 210px; padding: 20px; }
.yx-admin-topbar { background: #fff; border-bottom: 1px solid var(--yx-border); padding: 12px 20px; margin: -20px -20px 20px; display: flex; align-items: center; justify-content: space-between; }

/* 前台区域侧边栏 */
.yx-region-nav { position: sticky; top: 76px; }
.yx-region-title { font-size: 12px; color: #1a1a1a; padding: 6px 10px 8px; }
.yx-region-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--yx-radius); color: #1a1a1a; font-size: 14px;
}
.yx-region-item svg { flex: 0 0 auto; opacity: .8; }
.yx-region-item:hover { background: #f3f4f6; color: #1a1a1a; }
.yx-region-item.active { background: #f3f4f6; color: #1a1a1a; font-weight: 600; }

@media (max-width: 767.98px) {
  .yx-user-nav { position: static; margin-bottom: 14px; }
  .yx-region-nav { position: static; margin-bottom: 14px; }
  .yx-region-list { display: flex; overflow-x: auto; }
  .yx-region-item { white-space: nowrap; }
}

/* Toast */
.yx-toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 2000; width: 90%; max-width: 340px; }
.yx-toast {
  background: #fff; color: #1a1a1a; border: 1px solid var(--yx-border);
  border-radius: var(--yx-radius); padding: 10px 14px; font-size: 14px;
  margin-bottom: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); animation: yxIn .22s ease;
}
.yx-toast.error { background: #fef2f2; color: #1a1a1a; border-color: #fecaca; }
.yx-toast.success { background: #f0fdf4; color: #1a1a1a; border-color: #bbf7d0; }
@keyframes yxIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-muted-sm { color: #1a1a1a; font-size: 12px; }

/* ============================================================
   前台：图标按钮 + 抽屉侧边栏
   ============================================================ */
.yx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: transparent; color: #1a1a1a;
  border-radius: var(--yx-radius); padding: 0;
}
.yx-icon-btn:hover { background: #f3f4f6; }
.yx-navbar .nav-link svg { margin-right: 5px; vertical-align: -3px; }
.yx-drawer-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .38);
  opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 1060;
}
.yx-drawer-mask.show { opacity: 1; visibility: visible; }
.yx-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 250px; max-width: 82vw;
  background: #fff; border-right: 1px solid var(--yx-border);
  transform: translateX(-100%); transition: transform .22s ease; z-index: 1070;
  padding: 14px 10px; overflow-y: auto;
}
.yx-drawer.show { transform: none; }
.yx-drawer-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 6px 8px 14px; color: #1a1a1a; }
.yx-drawer a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--yx-radius); color: #1a1a1a; font-size: 14px;
}
.yx-drawer a svg { flex: 0 0 auto; opacity: .8; }
.yx-drawer a:hover, .yx-drawer a.active { background: #f3f4f6; }
.yx-drawer-title { font-size: 12px; color: #1a1a1a; padding: 14px 12px 6px; }
.yx-drawer hr { margin: 10px 6px; }

/* 主机卡片：直角 */
.host-card.flat { border-radius: 0; }
.host-card.flat .btn { border-radius: var(--yx-radius); }

/* ============================================================
   收银台
   ============================================================ */
.yx-cashier-amount { font-size: 40px; font-weight: 800; color: #1a1a1a; line-height: 1.1; }
.yx-pay-methods { display: flex; gap: 12px; }
.yx-pay-method {
  flex: 1; border: 1px solid var(--yx-border); border-radius: var(--yx-radius); padding: 14px 10px;
  text-align: center; cursor: pointer; background: #fff; transition: border-color .15s;
}
.yx-pay-method:hover { border-color: #9ca3af; }
.yx-pay-method.active { border-color: #1a1a1a; border-width: 2px; }
.yx-pay-method .ico { width: 34px; height: 34px; display: block; margin: 0 auto 6px; }
.yx-pay-method .name { font-size: 13px; color: #1a1a1a; }

/* ============================================================
   控制面板（微云机面板）
   ============================================================ */
.cp-body { background: #f7f7f7; margin: 0; }
.cp-login-wrap {
  min-height: 100vh; background: #fff; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.cp-login-card { width: 100%; max-width: 380px; }
.cp-login-card .title { text-align: center; font-size: 16px; font-weight: 700; color: #1a1a1a; margin-bottom: 20px; line-height: 1.5; }
.cp-login-card .form-control, .cp-login-card .form-select { border-radius: 0; }
.cp-login-card .btn { border-radius: 0; background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.cp-loading {
  position: fixed; inset: 0; background: #fff; z-index: 3000;
  display: none; align-items: center; justify-content: center;
}
.cp-loading.show { display: flex; }
.cp-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid #dbeafe; border-top-color: #60a5fa;
  animation: cpSpin .8s linear infinite;
}
@keyframes cpSpin { to { transform: rotate(360deg); } }

/* 面板布局 */
.cp-layout { display: flex; min-height: 100vh; }
.cp-sidebar {
  width: 220px; background: #fff; border-right: 1px solid var(--yx-border);
  position: fixed; top: 0; left: 0; bottom: 0; padding: 14px 10px; overflow-y: auto;
  transform: translateX(-100%); transition: transform .22s ease; z-index: 1200;
}
.cp-sidebar.show { transform: none; }
.cp-sidebar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: #1a1a1a; padding: 6px 10px 16px; }
.cp-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--yx-radius); color: #1a1a1a; font-size: 14px; }
.cp-sidebar a svg { flex: 0 0 auto; opacity: .85; }
.cp-sidebar a:hover { background: #f3f4f6; }
.cp-sidebar a.active { background: #f3f4f6; color: #1a1a1a; font-weight: 600; }
.cp-main { flex: 1; min-width: 0; padding: 12px; }
.cp-topbar {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid var(--yx-border); border-radius: var(--yx-radius); padding: 8px 12px; margin-bottom: 12px;
}
.cp-topbar .cp-title { font-weight: 700; font-size: 15px; color: #1a1a1a; }
.cp-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.38); z-index: 1100;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.cp-mask.show { opacity: 1; visibility: visible; }
@media (min-width: 992px) {
  .cp-sidebar { transform: none; }
  .cp-main { margin-left: 220px; padding: 16px; }
  .cp-mask { display: none; }
  .cp-sidebar-hidden .cp-sidebar { transform: translateX(-100%); }
  .cp-sidebar-hidden .cp-main { margin-left: 0; }
}

/* 圆环统计 */
.cp-ring-wrap { display: flex; flex-wrap: wrap; gap: 16px; }
.cp-ring { text-align: center; flex: 1; min-width: 130px; }
.cp-ring svg { display: block; margin: 0 auto; }
.cp-ring .ring-label { font-size: 12px; color: #1a1a1a; margin-top: 6px; }
.cp-ring .ring-center { font-size: 15px; font-weight: 700; fill: #1a1a1a; }

/* 文件列表 */
.cp-file-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid var(--yx-border); font-size: 13px; }
.cp-file-row .fname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cp-file-row .fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-console-badge { font-size: 11px; padding: 2px 7px; border-radius: var(--yx-radius); background: #f3f4f6; color: #1a1a1a; }

/* 目录选择器 */
.cp-dir-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--yx-border); border-radius: var(--yx-radius); }
.cp-dir-item { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--yx-border); }
.cp-dir-item:last-child { border-bottom: 0; }
.cp-dir-item:hover { background: #f3f4f6; }

/* ============================================================
   后台：抽屉式侧边栏
   ============================================================ */
.yx-admin-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; background: transparent; color: #1a1a1a;
  border-radius: var(--yx-radius); padding: 0; flex: 0 0 auto;
}
.yx-admin-menu-btn:hover { background: #f3f4f6; }
.yx-admin-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.38); z-index: 1100;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.yx-admin-mask.show { opacity: 1; visibility: visible; }
.yx-admin-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.yx-admin-topbar-left h5 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 桌面端：默认展开，按钮可收起 */
@media (min-width: 992px) {
  .yx-admin-sidebar { transition: transform .22s ease; }
  .admin-nav-hidden .yx-admin-sidebar { transform: translateX(-100%); }
  .admin-nav-hidden .yx-admin-main { margin-left: 0; }
  .yx-admin-mask { display: none; }
}
/* 手机端：默认收起，按钮展开 */
@media (max-width: 991.98px) {
  .yx-admin-sidebar { transform: translateX(-100%); transition: transform .22s ease; z-index: 1200; }
  .yx-admin-sidebar.show { transform: none; }
  .yx-admin-main { margin-left: 0; padding: 14px; }
  .yx-admin-topbar { margin: -14px -14px 14px; padding: 10px 14px; }
  .yx-toast-wrap { top: 64px; }
}

/* 负载条 */
.yx-load-bar { height: 5px; background: #ececec; border-radius: var(--yx-radius); overflow: hidden; min-width: 60px; }
.yx-load-bar > div { height: 100%; background: #22c55e; }
.yx-load-bar.warn > div { background: #f59e0b; }
.yx-load-bar.danger > div { background: #ef4444; }

/* 弹窗圆角统一 4px */
.modal-content { border-radius: var(--yx-radius) !important; }

/* ===== missing classes fix ===== */
.yx-copy, .yx-eye {
  cursor: pointer; color: #1a1a1a; display: inline-flex; align-items: center;
  gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 13px;
  text-decoration: none; transition: background .15s; white-space: nowrap;
}
.yx-copy:hover, .yx-eye:hover { background: #f0f0f0; color: #000; }
.yx-copy svg, .yx-eye svg { flex-shrink: 0; }
.yx-pass {
  cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; background: #f7f7f7; border: 1px solid #e5e5e5;
  border-radius: 4px; padding: 1px 8px; color: #1a1a1a; white-space: nowrap;
}
.yx-pass:hover { background: #f0f0f0; }
.yx-load { height: 5px; background: #ececec; border-radius: var(--yx-radius); overflow: hidden; min-width: 60px; display: inline-block; vertical-align: middle; }
.yx-load > div { height: 100%; background: #22c55e; }
.yx-load.warn > div { background: #f59e0b; }
.yx-load.danger > div { background: #ef4444; }
.amount-btn.active, .amount-btn.selected { border-color: #1a1a1a; background: #1a1a1a; color: #fff; }
.yx-act:disabled, .host-op:disabled { opacity: .45; cursor: not-allowed; }
