/* ============================================================
   呆呆面板云 · 全局样式
   ============================================================ */
:root {
    --bg: #080b18;
    --bg-2: #0e1226;
    --panel: rgba(23, 28, 51, 0.82);
    --panel-solid: #171c33;
    --panel-2: rgba(14, 18, 40, 0.75);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #eef0fa;
    --muted: #97a0bf;
    --accent: #6c7bff;
    --accent-2: #8a63ff;
    --success: #2fb068;
    --danger: #e5484d;
    --warning: #f5a623;
    --radius: 14px;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(900px 500px at 85% -10%, rgba(108, 123, 255, 0.14), transparent 60%),
        radial-gradient(700px 420px at -10% 20%, rgba(138, 99, 255, 0.10), transparent 60%),
        radial-gradient(600px 400px at 50% 110%, rgba(47, 176, 104, 0.06), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #9aa8ff; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   导航
   ============================================================ */
.navbar {
    background: rgba(11, 14, 30, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; position: relative; }
.brand { font-size: 17px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 9px; letter-spacing: .2px; }
.brand .logo {
    width: 28px; height: 28px; border-radius: 8px; background: var(--grad);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
    box-shadow: 0 4px 14px rgba(108, 123, 255, 0.4);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { color: var(--muted); font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links form { display: inline; }
.nav-links .btn { margin-left: 6px; }

.nav-toggle {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; border: 1px solid var(--border);
    border-radius: 10px; background: rgba(255, 255, 255, 0.04); cursor: pointer;
    padding: 0 11px;
}
.nav-toggle span { height: 2px; border-radius: 2px; background: var(--text); transition: .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   布局
   ============================================================ */
.main { padding: 30px 20px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: .2px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 14px; cursor: pointer; transition: all .18s ease; font-weight: 600;
    white-space: nowrap; user-select: none;
}
.btn-primary {
    background: var(--grad); color: #fff;
    box-shadow: 0 6px 18px rgba(108, 123, 255, 0.35);
}
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(108, 123, 255, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.08); }
.btn-success { background: linear-gradient(135deg, #2fb068, #23a05c); color: #fff; box-shadow: 0 6px 18px rgba(47, 176, 104, 0.3); }
.btn-success:hover { color: #fff; transform: translateY(-1px); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(229, 72, 77, 0.4); }
.btn-danger:hover { background: rgba(229, 72, 77, 0.14); color: #ff7f83; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.input, select.input, textarea.input {
    width: 100%; padding: 11px 13px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--panel-2);
    color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 123, 255, 0.18); }
.input[disabled] { opacity: .55; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============================================================
   提示
   ============================================================ */
.alert { padding: 13px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: rgba(47, 176, 104, 0.13); color: #7fe0ae; border: 1px solid rgba(47, 176, 104, 0.32); }
.alert-error { background: rgba(229, 72, 77, 0.13); color: #ff9da5; border: 1px solid rgba(229, 72, 77, 0.32); }
.alert-warning { background: rgba(245, 166, 35, 0.13); color: #ffcf7e; border: 1px solid rgba(245, 166, 35, 0.32); }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 13.5px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* ============================================================
   徽章
   ============================================================ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(47, 176, 104, 0.16); color: #7fe0ae; }
.badge-danger { background: rgba(229, 72, 77, 0.16); color: #ff9da5; }
.badge-warning { background: rgba(245, 166, 35, 0.16); color: #ffcf7e; }
.badge-muted { background: rgba(151, 160, 191, 0.14); color: var(--muted); }
.badge-accent { background: rgba(108, 123, 255, 0.16); color: #9aa8ff; }

/* ============================================================
   统计卡片
   ============================================================ */
.stat-card {
    background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); transition: transform .18s, border-color .18s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-card .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-card .num { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: .2px; }

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
    position: relative; overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px; padding: 56px 44px 40px; margin-bottom: 34px;
    background:
        linear-gradient(135deg, rgba(108, 123, 255, 0.16), rgba(138, 99, 255, 0.08) 55%, rgba(47, 176, 104, 0.06));
    box-shadow: var(--shadow);
}
.hero::before {
    content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px;
    background: radial-gradient(circle, rgba(108, 123, 255, 0.28), transparent 65%);
    border-radius: 50%; pointer-events: none;
}
.hero::after {
    content: ""; position: absolute; width: 300px; height: 300px; left: -100px; bottom: -160px;
    background: radial-gradient(circle, rgba(138, 99, 255, 0.22), transparent 65%);
    border-radius: 50%; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 620px; }
.hero-badge {
    display: inline-block; padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(108, 123, 255, 0.18); color: #aab4ff; border: 1px solid rgba(108, 123, 255, 0.35);
    margin-bottom: 18px; letter-spacing: .3px;
}
.hero h1 { font-size: 34px; line-height: 1.25; font-weight: 900; margin-bottom: 14px; letter-spacing: .3px; }
.hero p { color: var(--muted); font-size: 15px; max-width: 520px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats {
    position: relative; z-index: 1;
    display: flex; gap: 34px; margin-top: 40px; padding-top: 22px;
    border-top: 1px solid var(--border); flex-wrap: wrap;
}
.hero-stat .num { font-size: 20px; font-weight: 800; color: #fff; }
.hero-stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   套餐卡片
   ============================================================ */
.plan-card { display: flex; flex-direction: column; gap: 14px; position: relative; }
.plan-card.featured { border-color: rgba(108, 123, 255, 0.5); background: linear-gradient(180deg, rgba(108, 123, 255, 0.1), var(--panel) 40%); }
.plan-card.featured .plan-name { color: #b9c2ff; }
.plan-tag {
    position: absolute; top: -1px; right: 20px;
    background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700;
    padding: 4px 12px; border-radius: 0 0 10px 10px; box-shadow: 0 4px 12px rgba(108, 123, 255, 0.4);
}
.plan-name { font-size: 18px; font-weight: 800; }
.plan-price { font-size: 32px; font-weight: 900; color: var(--accent); letter-spacing: .2px; }
.plan-price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan-desc { color: var(--muted); font-size: 13px; min-height: 42px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; flex: 1; }
.plan-features li { display: flex; gap: 9px; align-items: flex-start; color: #ccd2e8; }
.plan-features .tick {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    background: rgba(47, 176, 104, 0.16); color: #7fe0ae;
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 2px;
}

/* ============================================================
   收银台
   ============================================================ */
.pay-card { padding: 32px 28px; }
.pay-amount { font-size: 38px; font-weight: 900; color: var(--warning); margin: 10px 0 22px; letter-spacing: .3px; }
.pay-tip {
    background: rgba(245, 166, 35, 0.1); border: 1px dashed rgba(245, 166, 35, 0.4);
    border-radius: 10px; padding: 16px; margin-bottom: 20px; font-size: 13.5px; color: #ffcf7e;
}
.pay-tip-ok { background: rgba(47, 176, 104, 0.1); border-color: rgba(47, 176, 104, 0.4); color: #7fe0ae; }
.pay-qr-box {
    display: inline-block; padding: 14px; border-radius: 12px; margin-bottom: 4px;
    background: #fff; box-shadow: var(--shadow);
}
.pay-qr-box img { display: block; border-radius: 6px; }

/* ============================================================
   实例
   ============================================================ */
.instance-card { transition: transform .18s, border-color .18s; }
.instance-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.instance-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.instance-addr { font-size: 16px; font-weight: 700; color: #9aa8ff; letter-spacing: .2px; word-break: break-all; }
.inst-meta { font-size: 12.5px; margin-top: 5px; }
.inst-meta-row { display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.inst-meta-row .expire { color: #ffcf7e; font-weight: 600; }
.inst-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ============================================================
   认证页
   ============================================================ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 18px; padding: 36px 32px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: .2px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }

/* ============================================================
   后台
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 226px; background: rgba(11, 14, 30, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border); padding: 22px 14px; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { margin: 4px 10px 24px; }
.sidebar .menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px; border-radius: 9px; color: var(--muted); margin-bottom: 2px; font-size: 14px;
    transition: background .15s, color .15s;
}
.sidebar .menu-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.sidebar .menu-item.active { color: #fff; background: rgba(108, 123, 255, 0.18); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .menu-item .mi-icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar .menu-section { font-size: 11px; color: #5b6182; text-transform: uppercase; letter-spacing: .07em; margin: 20px 12px 8px; font-weight: 700; }
.admin-main { flex: 1; padding: 28px 32px 60px; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.sidebar-toggle {
    display: none; position: fixed; top: 12px; right: 14px; z-index: 110;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; border: 1px solid var(--border);
    border-radius: 10px; background: rgba(23, 28, 51, 0.9); cursor: pointer; padding: 0 11px;
}
.sidebar-toggle span { height: 2px; border-radius: 2px; background: var(--text); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 95; }

/* ============================================================
   页脚 / 空状态 / 工具
   ============================================================ */
footer.footer { text-align: center; color: #5b6182; font-size: 12.5px; padding: 26px 0 44px; }
.empty { text-align: center; padding: 52px 0; color: var(--muted); }
.empty .icon { font-size: 36px; margin-bottom: 12px; opacity: .7; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 980px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute; top: 100%; left: -20px; right: -20px;
        background: rgba(11, 14, 30, 0.97); border-bottom: 1px solid var(--border);
        flex-direction: column; align-items: stretch; gap: 2px;
        padding: 10px 20px 16px; box-shadow: 0 18px 30px rgba(0, 0, 0, 0.4);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 11px 12px; font-size: 15px; }
    .nav-links form { display: block; }
    .nav-links form .btn, .nav-links .btn { width: 100%; margin: 6px 0 0; }

    .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 100; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 40px rgba(0,0,0,.4); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay.show { display: block; }
    .admin-main { padding: 20px 16px 60px; }
}

@media (max-width: 600px) {
    .container { padding: 0 14px; }
    .main { padding: 22px 14px 56px; }
    .grid-4 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    .page-head { flex-direction: column; align-items: flex-start; }
    .page-head .btn { width: 100%; }

    .hero { padding: 40px 24px 28px; border-radius: 16px; }
    .hero h1 { font-size: 27px; }
    .hero p { font-size: 14px; }
    .hero-actions .btn { flex: 1; }
    .hero-stats { gap: 22px; }

    .card { padding: 20px; border-radius: 12px; }
    .auth-card { padding: 28px 22px; }

    .inst-actions .btn, .inst-actions form { flex: 1; }
    .inst-actions form .btn { width: 100%; }

    .table td, .table th { white-space: nowrap; }
}
