/* =========================================================
   NyouOS Admin 样式 · admin/admin.css
   深色、专业、安全感的控制台风格
   ========================================================= */

.admin-body {
    background: #06070a;
    color: #f5f5f7;
    min-height: 100vh;
}

/* ---------- 顶部细条 ---------- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 44px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(10, 11, 14, 0.78);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f7;
}

.admin-topbar-brand img {
    width: 18px;
    height: 18px;
}

.admin-topbar-tag {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #86868b;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.admin-topbar-back {
    margin-left: auto;
    font-size: 12.5px;
    color: #86868b;
    transition: color 0.2s ease;
}

.admin-topbar-back:hover {
    color: #f5f5f7;
}

/* ---------- 登录视图 ---------- */
.admin-main {
    min-height: calc(100vh - 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 22px;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 120, 212, 0.12), transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 90%, rgba(91, 60, 196, 0.08), transparent 70%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(20, 22, 28, 0.6);
    backdrop-filter: blur(40px) saturate(160%);
    -webkit-backdrop-filter: blur(40px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 44px 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-shield {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0078d4, #5b3cc4);
    border-radius: 22px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 120, 212, 0.35);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.login-sub {
    font-size: 13px;
    color: #a1a1a6;
    margin: 0 0 28px;
    line-height: 1.5;
}

.login-form {
    text-align: left;
}

.login-field {
    position: relative;
    margin-bottom: 14px;
}

.login-input {
    width: 100%;
    height: 46px;
    padding: 0 48px 0 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f5f5f7;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.login-input::placeholder {
    color: #6e6e73;
}

.login-input:focus {
    outline: none;
    border-color: #2997ff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.15);
}

.login-input[type="text"] {
    letter-spacing: 0.08em;
}

.login-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    color: #86868b;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.login-eye:hover {
    color: #f5f5f7;
    background: rgba(255, 255, 255, 0.06);
}

.login-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0078d4, #2997ff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 120, 212, 0.35);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.login-btn.loading .login-btn-label {
    display: none;
}

.login-btn.loading .login-btn-spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-msg {
    margin-top: 14px;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.login-msg.error {
    color: #ff6b6b;
}

.login-msg.success {
    color: #30d158;
}

.login-meta {
    margin-top: 6px;
    font-size: 12px;
    text-align: center;
    color: #86868b;
    min-height: 16px;
}

.login-foot {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.login-tag {
    font-size: 11px;
    color: #6e6e73;
    letter-spacing: 0.02em;
}

/* ---------- 控制台视图 ---------- */
.admin-dashboard {
    min-height: calc(100vh - 44px);
    padding: 36px 0 60px;
}

.dash-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 22px;
}

.dash-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.dash-sub {
    font-size: 14px;
    color: #a1a1a6;
    margin: 0;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-dashboard .btn-ghost {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.admin-dashboard .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.dash-session {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 980px;
    font-size: 12px;
    color: #a1a1a6;
    font-variant-numeric: tabular-nums;
}

.dash-session.warn {
    color: #ffd60a;
    border-color: rgba(255, 214, 10, 0.4);
    background: rgba(255, 214, 10, 0.08);
}

.dash-session.danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.08);
}

/* ---------- 安全横幅 ---------- */
.dash-banner {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(41, 151, 255, 0.08);
    border: 1px solid rgba(41, 151, 255, 0.2);
    border-radius: 14px;
    margin-bottom: 36px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #c7d8e8;
}

.dash-banner-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #2997ff;
}

.dash-banner a {
    color: #2997ff;
    text-decoration: underline;
}

/* ---------- 章节 ---------- */
.dash-section {
    margin-bottom: 36px;
}

.dash-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #f5f5f7;
}

/* ---------- 账号卡片 ---------- */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.25s ease;
    cursor: pointer;
    color: inherit;
}

.account-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.account-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.account-icon svg {
    width: 22px;
    height: 22px;
}

.account-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.account-body {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f7;
    margin-bottom: 2px;
}

.account-desc {
    font-size: 12px;
    color: #86868b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-arrow {
    color: #6e6e73;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.account-card:hover .account-arrow {
    color: #f5f5f7;
    transform: translateX(2px);
}

/* ---------- 快捷操作 ---------- */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: all 0.25s ease;
    color: inherit;
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.action-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
}

.action-icon img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f7;
    margin-bottom: 2px;
}

.action-desc {
    font-size: 12px;
    color: #86868b;
}

/* ---------- 页脚 ---------- */
.dash-footer {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6e6e73;
}

.dash-footer code {
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1a6;
    font-size: 11px;
}

/* ---------- setup 页 ---------- */
.setup-label {
    display: block;
    font-size: 12.5px;
    color: #a1a1a6;
    margin: 14px 0 6px;
    text-align: left;
}
.setup-label:first-of-type {
    margin-top: 4px;
}

.strength {
    margin: 14px 0 4px;
    text-align: left;
}
.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.strength-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    background: #6e6e73;
}
.strength-bar span.lvl-1 { background: #ff453a; }
.strength-bar span.lvl-2 { background: #ff9f0a; }
.strength-bar span.lvl-3 { background: #ffd60a; }
.strength-bar span.lvl-4 { background: #30d158; }
.strength-bar span.lvl-5 { background: #30d158; }
.strength-label {
    margin-top: 6px;
    font-size: 12px;
    color: #86868b;
}
.strength-label.lvl-1 { color: #ff453a; }
.strength-label.lvl-2 { color: #ff9f0a; }
.strength-label.lvl-3 { color: #ffd60a; }
.strength-label.lvl-4 { color: #30d158; }
.strength-label.lvl-5 { color: #30d158; }

.setup-output {
    margin-top: 26px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-align: left;
}
.setup-output-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.setup-output-head h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
.setup-output-note {
    font-size: 12px;
    color: #a1a1a6;
    margin: 0 0 12px;
    line-height: 1.5;
}
.setup-output-note code {
    background: rgba(255, 255, 255, 0.1);
    color: #2997ff;
    padding: 1px 6px;
    border-radius: 4px;
}
.setup-output-pre {
    margin: 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #c7d8e8;
    overflow-x: auto;
    max-height: 280px;
    overflow-y: auto;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .login-card {
        padding: 36px 24px 26px;
    }
    .dash-header {
        align-items: flex-start;
    }
    .dash-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}
