/* ============================================================================
   通用盾 · 用户控制台样式（复刻 layui 后台观感，零外部依赖）
   参考样式：layui + 橙色主题 #ffa924 + 深色左侧菜单 #20222a + 浅灰底 #f2f2f2
   为什么不用 CDN 引入 layui：部署环境可能没有外网，手写这份 CSS 保证一定能显示。
   若将来想换成真 layui，本文件的类名与 layui 一致，直接替换 CSS 即可。
   ============================================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f2f2f2;
    color: #333;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: #333; text-decoration: none; }
a:hover { color: #ffa924; }

/* ---------- 顶部 header ---------- */
.layui-header {
    height: 60px;
    background: #20222a;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}
.layui-logo {
    width: 220px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}
.layui-logo a { color: #fff; }
.layui-logo .logo img { height: 28px; vertical-align: middle; }

/* ★ 只给「顶部横向导航」加 flex。
   早期写法是裸的 `.layui-nav{display:flex;height:60px}`，而左侧菜单树复用了同一个 class
   （<ul class="layui-nav layui-nav-tree">），于是三组菜单被当成横排导航、每个只分到几十像素，
   二级文字逐字换行并被 60px 高度裁掉 —— 这就是"导航文字被遮挡/叠加"的根因。
   把作用域限定在 .layui-header 内，侧边栏从根上不会再被误伤（不依赖规则先后顺序）。 */
.layui-header .layui-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 60px;
}
/* 作用域必须压过上面 .layui-header .layui-nav（权重 0,2,0）的 margin:0，
   否则 .layui-layout-right 的 margin-left:auto 会被冲掉，右侧导航组就会从"贴右边"变成"贴 logo 右边"。
   当初就是只把 .layui-nav 收窄成 .layui-header .layui-nav（权重升到 0,2,0），
   而这里仍是 0,1,0，于是右侧导航被顶到左边——改回更高权重即可。 */
.layui-header .layui-nav.layui-layout-left { margin-left: 10px; }
.layui-header .layui-nav.layui-layout-right { margin-left: auto; margin-right: 20px; }

.layui-nav-item { position: relative; }
.layui-nav-item > a {
    display: block;
    padding: 0 18px;
    height: 60px;
    line-height: 60px;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    white-space: nowrap;
}
.layui-nav-item > a:hover { color: #fff; }
.layui-nav-child {
    display: none;
    position: absolute;
    top: 60px; left: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    z-index: 1001;
}
.layui-nav-item:hover .layui-nav-child { display: block; }
.layui-nav-child dd a { display: block; padding: 8px 16px; color: #333; }
.layui-nav-child dd a:hover { background: #f6f6f6; color: #ffa924; }
.layui-nav-img { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

/* ---------- 左侧菜单 ---------- */
.layui-side {
    position: fixed;
    top: 60px; bottom: 0; left: 0;
    width: 220px;
    background: #20222a;
    overflow-y: auto;
}
.layui-side-scroll { padding: 10px 0; }
/* 左侧菜单树：作用域锁定在 .layui-side 内（选择器权重 0,2,x），
   即使将来有人调整规则顺序，也不会再被 .layui-nav 的 flex/height 覆盖。 */
.layui-side .layui-nav-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    height: auto;
    width: 100%;
    align-items: stretch;
}
.layui-side .layui-nav-tree > .layui-nav-item { display: block; width: 100%; }
.layui-side .layui-nav-tree .layui-nav-item > a {
    display: block;
    padding: 0 20px;
    height: 42px;
    line-height: 42px;
    color: rgba(255,255,255,.7);
    font-size: 14px;
}
.layui-side .layui-nav-tree .layui-nav-item > a:hover { color: #fff; background: #2a2c33; }
.layui-side .layui-nav-tree .layui-nav-child {
    display: block;
    position: static;
    min-width: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.layui-side .layui-nav-tree .layui-nav-child dd a {
    display: block;
    padding: 0 20px 0 40px;
    height: 38px;
    line-height: 38px;
    color: rgba(255,255,255,.6);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.layui-side .layui-nav-tree .layui-nav-child dd a:hover { color: #fff; background: #2a2c33; }
.layui-side .layui-nav-tree .layui-nav-child dd a.active,
.layui-side .layui-nav-tree .layui-nav-child dd a.on {
    color: #ffa924;
    background: #2a2c33;
    border-left: 3px solid #ffa924;
    padding-left: 37px;
}

/* ---------- 主体 ---------- */
.layui-body {
    margin-left: 220px;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    background: #f2f2f2;
}
.content { padding: 15px 17.5px; }
.layui-row { display: flex; flex-wrap: wrap; margin: 0 -7.5px; }
.layui-col-md4, .layui-col-md6, .layui-col-md8, .layui-col-md3 {
    padding: 0 7.5px;
    margin-bottom: 15px;
}
.layui-col-md8 { width: 66.6667%; }
.layui-col-md6 { width: 50%; }
.layui-col-md4 { width: 33.3333%; }
.layui-col-md3 { width: 25%; }
@media screen and (max-width: 980px) {
    .layui-col-md8, .layui-col-md6, .layui-col-md4, .layui-col-md3 { width: 100%; }
    .layui-side { display: none; }
    .layui-body { margin-left: 0; }
}

/* ---------- 卡片 ---------- */
.layui-card {
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.layui-card-header {
    height: 48px;
    line-height: 48px;
    padding: 0 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #333;
}
.layui-card-header label { font-weight: 400; }
.layui-card-header a { float: right; color: #666; font-size: 13px; }
.layui-card-header a:hover { color: #ffa924; }
.layui-card-body { padding: 20px 15px; }
.mt15 { margin-top: 15px; }

/* ---------- 概览数字 ---------- */
.account { margin-top: 20px; text-align: center; }
.account .account-title { font-size: 15px; color: #888; margin-bottom: 8px; }
.account span { font-size: 21px; font-weight: 500; }
.recharge { margin-top: 35px; text-align: center; }
.recharge-wrap {
    background-color: #ffa924;
    color: #fff;
    display: inline-block;
    width: 80px; height: 30px; line-height: 30px;
    text-align: center;
    border-radius: 2px;
}
.recharge-wrap:hover { background-color: #ffba4f; color: #fff; }
.recharge-a { margin-left: 15px; color: #666; }
.recharge-a:hover { color: #ffa924; }

/* ---------- 运行状态 ---------- */
.service-wrap {
    background-color: #F7F9FA;
    border: 1px solid #F7F9FA;
    padding: 16px 20px;
    cursor: pointer;
    transition: .2s;
}
.service-wrap:hover { border: 1px solid #ffa924; background-color: #fff; }
.service-title { color: #000; float: left; font-size: 16px; }
.service-a { float: right; color: #666; font-size: 13px; }
.service-a:hover { color: #ffa924; }
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix { display: block; }

/* ---------- 资源用量条目 ---------- */
.user-product {
    margin-top: 10px;
    padding: 10px;
    cursor: pointer;
    display: block;
    transition: .2s;
}
.user-product:hover { background-color: #F7F9FA; }
.user-product-img { float: left; margin-top: 8px; margin-right: 10px; }
.user-product-img img { width: 32px; height: 32px; }
.user-product .dot {
    display: inline-block; width: 32px; height: 32px; border-radius: 6px;
    background: #ffa924; color: #fff; text-align: center; line-height: 32px;
    font-size: 13px; font-weight: 500;
}
.user-product-wrap { float: left; }
.user-product-wrap div { font-size: 14px; color: #000; margin-bottom: 2px; }
.user-product-wrap span { font-size: 12px; color: #666; }

/* ---------- 待办 / 教程 ---------- */
.pending { min-height: 140px; }
.pending-wrap {
    background-color: #F7F9FA;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #F7F9FA;
    transition: .2s;
}
.pending-wrap:hover { border: 1px solid #ffa924; background-color: #fff; }
.pending-wrap span { color: #666; float: left; }
.pending-wrap a { color: #666; float: right; }
.pending-wrap a:hover { color: #ffa924; }
.news { min-height: 150px; }
.news-wrap {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 8px; line-height: 22px;
}
.news-wrap i { width: 6px; height: 6px; background-color: #00AAFF; display: inline-block; }
.news-wrap span { color: #888; display: inline-block; margin: 0 5px; }
.news-wrap a:hover { color: #ffa924; }
.code { margin: 10px; }
.code-wrap p { margin: 0 0 6px; color: #666; }
.code-wrap a {
    display: inline-block;
    border: 1px solid #ffa924;
    padding: 3px 10px;
    color: #ffa924;
    border-radius: 2px;
}

/* ---------- 表格 ---------- */
.layui-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.layui-table th, .layui-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    color: #333;
}
.layui-table th { color: #888; font-weight: 400; background: #fafafa; }
.layui-table tr:hover td { background: #fcfcfc; }
.layui-table .tag {
    display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px;
}
.tag-on  { background: #e8f7ee; color: #1a9e5c; }
.tag-off { background: #f2f2f2; color: #888; }
.tag-warn{ background: #fff4e0; color: #d98a00; }

/* ---------- 按钮 / 表单 ---------- */
.layui-btn {
    display: inline-block;
    height: 34px; line-height: 34px;
    padding: 0 18px;
    background: #ffa924; color: #fff;
    border: 0; border-radius: 2px;
    cursor: pointer; font-size: 14px;
}
.layui-btn:hover { background: #ffba4f; color: #fff; }
.layui-btn-primary { background: #fff; color: #333; border: 1px solid #ddd; }
.layui-btn-primary:hover { border-color: #ffa924; color: #ffa924; background: #fff; }
.layui-btn-sm { height: 28px; line-height: 28px; padding: 0 12px; font-size: 13px; }
/* 禁用态：调试套餐"剩余不足 3 天不能续期"等场景要一眼看出按钮不可点，
   否则按钮外观与可点状态一样，用户会以为点了没反应。 */
.layui-btn:disabled, .layui-btn[disabled] {
    background: #d5d5d5; color: #fff; cursor: not-allowed;
}
.layui-btn-primary:disabled, .layui-btn-primary[disabled] {
    background: #f5f5f5; color: #bbb; border-color: #e6e6e6; cursor: not-allowed;
}
.layui-input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    font-size: 14px;
    color: #333;
    outline: none;
}
.layui-input:focus { border-color: #ffa924; }
.layui-form-item { margin-bottom: 14px; }
.layui-form-label {
    display: block; margin-bottom: 6px; color: #666; font-size: 13px;
}
.form-tip { color: #999; font-size: 12px; margin-top: 4px; }

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: #20222a;
}
.login-box {
    width: 380px;
    background: #fff;
    border-radius: 4px;
    padding: 32px 30px 28px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.login-box h1 {
    font-size: 20px; font-weight: 500; margin: 0 0 6px; color: #20222a;
}
.login-box .sub { color: #999; font-size: 13px; margin-bottom: 22px; }
.login-box .layui-btn { width: 100%; height: 40px; line-height: 40px; font-size: 15px; }
.login-box .foot { margin-top: 16px; font-size: 13px; color: #999; text-align: center; }
.login-box .foot a { color: #ffa924; }
.form-msg { color: #d9534f; font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: #999; padding: 36px 0; font-size: 13px; }

/* ---------- 提示条 ---------- */
.toast {
    position: fixed;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    background: #20222a;
    color: #fff;
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.toast.show { opacity: .95; }
.toast.err { background: #d9534f; }
.toast.ok  { background: #1a9e5c; }
