/* ============ CSS Reset & Base ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #eef1f6;
    background-image:
        radial-gradient(ellipse at 15% 30%, rgba(79, 70, 229, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 78% 65%, rgba(124, 58, 237, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 85%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 35% 10%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============ 装饰性背景粒子 ============ */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-decoration::before,
.bg-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.35;
    animation: floatParticle 18s ease-in-out infinite;
    will-change: transform;
}

.bg-decoration::before {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.13) 0%, rgba(79, 70, 229, 0) 70%);
    top: -8%;
    left: -6%;
    animation-delay: 0s;
}

.bg-decoration::after {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.11) 0%, rgba(124, 58, 237, 0) 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -9s;
    animation-duration: 22s;
}

@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -35px) scale(1.08); }
    50% { transform: translate(-20px, 25px) scale(0.94); }
    75% { transform: translate(-35px, -20px) scale(1.04); }
}

.bg-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image:
        radial-gradient(circle at 12% 22%, rgba(79,70,229,0.25) 1px, transparent 1px),
        radial-gradient(circle at 72% 18%, rgba(99,102,241,0.2) 1px, transparent 1px),
        radial-gradient(circle at 85% 70%, rgba(124,58,237,0.22) 1px, transparent 1px),
        radial-gradient(circle at 22% 75%, rgba(59,130,246,0.18) 1px, transparent 1px),
        radial-gradient(circle at 55% 40%, rgba(139,92,246,0.16) 1px, transparent 1px),
        radial-gradient(circle at 40% 88%, rgba(79,70,229,0.2) 1px, transparent 1px);
    background-size: 100% 100%;
}

/* ============ 卡片容器 ============ */
.card-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    animation: cardFadeIn 0.6s ease-out both;
}

.card-wrapper.wide {
    max-width: 960px;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 44px 40px 36px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 28px rgba(0,0,0,0.07), 0 20px 60px rgba(79,70,229,0.06);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 35%, #6366f1 65%, #4f46e5 100%);
    background-size: 200% 100%;
    animation: shimmerLine 4s ease-in-out infinite;
}

@keyframes shimmerLine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============ 品牌区域 ============ */
.brand-area {
    text-align: center;
    margin-bottom: 30px;
}

.brand-logo {
    display: inline-block;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    position: relative;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e1b4b;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
}

.brand-subtitle {
    font-size: 13px;
    color: #888;
    letter-spacing: 0.3px;
    font-weight: 400;
}

/* ============ 提示消息 ============ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #991b1b;
    line-height: 1.5;
    animation: shakeHint 0.5s ease-out;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left-color: #22c55e;
    color: #166534;
}

@keyframes shakeHint {
    0%,100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(5px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(1px); }
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.alert-icon svg {
    width: 100%;
    height: 100%;
}

/* ============ 表单样式 ============ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 1;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.input-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    font-size: 16px;
    font-family: inherit;
    color: #1f2937;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    letter-spacing: 0.3px;
}

.form-input::placeholder {
    color: #b0b7c3;
    font-size: 15px;
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1), 0 1px 3px rgba(0,0,0,0.04);
    background: #ffffff;
}

.form-input:focus ~ .input-icon,
.input-wrap:focus-within .input-icon {
    color: #6366f1;
}

.form-input[type="password"],
.form-input[type="text"].pw-input {
    padding-right: 48px;
}

/* 密码可见性切换按钮 */
.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    padding: 0;
}

.toggle-password:hover {
    color: #6366f1;
    background: rgba(99,102,241,0.06);
}
.toggle-password:active {
    background: rgba(99,102,241,0.12);
}
.toggle-password:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 8px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

/* ============ 按钮 ============ */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #4f46e5 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: background-position 0.5s ease, box-shadow 0.25s ease, transform 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    text-decoration: none;
}

.btn:hover {
    background-position: 100% 50%;
    box-shadow: 0 6px 22px rgba(79,70,229,0.3), 0 2px 6px rgba(79,70,229,0.15);
}

.btn:active {
    transform: scale(0.975);
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:focus-visible {
    outline: 3px solid rgba(99,102,241,0.5);
    outline-offset: 3px;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
    color: transparent;
}

.btn .btn-text { display: inline; }

.btn .btn-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.loading .btn-text { visibility: hidden; }
.btn.loading .btn-spinner { display: block; }

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    box-shadow: none;
}
.btn-secondary:hover {
    background: #9DA0A4;
    color: #111827;
}

.btn-sm {
    height: 38px;
    font-size: 14px;
    width: auto;
    padding: 0 24px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #4f46e5 100%);
    background-size: 200% 100%;
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.15);
    transition: background-position 0.5s ease, box-shadow 0.25s ease;
}

.btn-sm:hover {
    background-position: 100% 50%;
    box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}

/* ============ 底部链接 ============ */
.form-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #6b7280;
}

.form-footer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    padding: 4px 6px;
    border-radius: 4px;
}

.form-footer a:hover {
    color: #3730a3;
    text-decoration: underline;
    background: rgba(79,70,229,0.04);
}

/* 安全提示 */
.security-note {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: 0.2px;
}

.security-note .lock-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.security-note .lock-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============ 首页仪表盘 ============ */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.user-info .user-name {
    font-weight: 700;
    color: #1e1b4b;
}

.user-info .user-role {
    font-size: 12px;
    color: #888;
}

/* 左右分栏 */
.dashboard-main {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    align-items: stretch; 
}

.dashboard-left,
.dashboard-right {
    flex: 1;               /* 等宽 */
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

/* 套餐大卡片 (合并优化) */
.package-card {
    background: linear-gradient(135deg, #f8f7ff 0%, #ffffff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: box-shadow 0.2s ease;
    height: 100%; /* 保证高度自适应 */
}

.package-card:hover {
    box-shadow: 0 8px 28px rgba(79, 70, 229, 0.08);
}

.package-visual {
    width: 64px;
    height: 64px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    margin-bottom: 16px;
}

.package-visual svg {
    width: 36px;
    height: 36px;
}

.package-header {
    text-align: center;
    margin-bottom: 20px;
}

.package-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 8px;
}

.package-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
    line-height: 1;
}

.price-period {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 260px;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #4b5563;
    border-bottom: 1px dashed #e5e7eb;
}

.spec-list li:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: #6366f1;
}

.spec-value {
    font-weight: 500;
    color: #1f2937;
}

.package-form {
    width: 100%;
    margin-top: 24px;
}

.package-form .btn-submit {
    width: 100%;
    height: 50px;
    font-size: 17px;
    letter-spacing: 1px;
}

/* 套餐亮点区域（填补左侧空白） */
.package-highlights {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
    margin-top: auto;
}

.package-highlights h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 12px;
}

.highlight-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}

.highlight-item svg {
    width: 16px;
    height: 16px;
    color: #22c55e;
    flex-shrink: 0;
}

/* 状态面板 */
.vm-status-panel {
    background: #f9fafb;
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #9ca3af;
}

.status-badge svg {
    width: 28px;
    height: 28px;
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.status-count {
    font-size: 28px;
    font-weight: 700;
    color: #4f46e5;
    margin-right: 4px;
}

/* 二维码卡片 */
.qrcode-card {
    margin-top: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    margin-top: auto; 
}

.qrcode-icon {
    width: 36px;
    height: 36px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #4f46e5;
}

.qrcode-icon svg {
    width: 20px;
    height: 20px;
}

.qrcode-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 2px;
}

.qrcode-card p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
}

.qrcode-img {
    width: 160px;   /* 桌面端增大 */
    height: 160px;
    margin: 0 auto 10px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.qrcode-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-tip {
    font-size: 12px;
    color: #9ca3af;
}

/* ============ 响应式设计 ============ */
@media screen and (max-width: 768px) {
    .dashboard-main {
        flex-direction: column;
        gap: 20px;
    }

    .package-card {
        padding: 24px 20px;
    }

    .vm-status-panel {
        padding: 24px 20px;
    }

    .qrcode-img {
        width: 140px;
        height: 140px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 30px;
        background-image:
            radial-gradient(ellipse at 50% 10%, rgba(79,70,229,0.08) 0%, transparent 60%),
            radial-gradient(ellipse at 50% 90%, rgba(124,58,237,0.05) 0%, transparent 50%);
    }

    .card {
        padding: 32px 22px 28px;
        border-radius: 14px;
    }

    .card::before {
        width: 50%;
        height: 2.5px;
    }

    .brand-logo { width: 44px; height: 44px; margin-bottom: 10px; }
    .brand-title { font-size: 20px; }
    .brand-subtitle { font-size: 12px; }

    .form-input {
        height: 46px;
        font-size: 16px;
        padding-left: 40px;
        padding-right: 42px;
        border-radius: 9px;
    }

    .form-input[type="password"],
    .form-input.pw-input {
        padding-right: 44px;
    }

    .input-icon { left: 11px; width: 18px; height: 18px; }
    .toggle-password { right: 3px; width: 34px; height: 34px; }
    .toggle-password svg { width: 18px; height: 18px; }

    .btn { height: 46px; font-size: 15px; border-radius: 9px; }
    .form-group { margin-bottom: 15px; }
    .alert { font-size: 13px; padding: 10px 12px; border-radius: 7px; }
    .form-label { font-size: 13px; }
    .form-footer { font-size: 13px; }

    .card-wrapper.wide { max-width: 100%; }

    .dashboard-main {
        gap: 16px;
    }

    .package-highlights {
        padding: 14px 12px;
    }

    .highlight-list {
        gap: 12px;
    }

    .qrcode-card {
        padding: 16px 14px;
    }
    .qrcode-img {
        width: 120px;
        height: 120px;
    }
}

@media screen and (max-width: 360px) {
    body { padding: 8px; padding-top: 16px; }
    .card { padding: 24px 16px 22px; border-radius: 12px; }
    .brand-logo { width: 38px; height: 38px; margin-bottom: 8px; }
    .brand-title { font-size: 18px; }
    .form-input { height: 44px; font-size: 15px; padding-left: 36px; padding-right: 38px; }
    .form-input[type="password"],
    .form-input.pw-input { padding-right: 40px; }
    .input-icon { left: 9px; width: 16px; height: 16px; }
    .toggle-password { right: 2px; width: 30px; height: 30px; }
    .toggle-password svg { width: 16px; height: 16px; }
    .btn { height: 44px; font-size: 15px; }
    .form-group { margin-bottom: 12px; }
}

@media screen and (min-width: 768px) {
    .card { padding: 48px 44px 40px; }
    .brand-logo { width: 56px; height: 56px; }
    .brand-title { font-size: 24px; }
}

@media screen and (min-width: 1200px) {
    .card { padding: 50px 48px 42px; border-radius: 18px; }
    .card-wrapper.wide { max-width: 1000px; }
}

/* 高对比度 */
@media (prefers-contrast: high) {
    .card { border: 2px solid #333; box-shadow: 0 0 0 2px #000; }
    .form-input { border: 2px solid #555; }
    .form-input:focus { border-color: #000; box-shadow: 0 0 0 4px rgba(0,0,0,0.2); }
    .btn { background: #1e1b4b; border: 2px solid #000; }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .bg-decoration::before, .bg-decoration::after { animation: none; }
    .card::before { animation: none; }
    .card-wrapper { animation: none; opacity: 1; transform: none; }
    .alert { animation: none; }
    .btn { transition: none; }
    .btn.loading .btn-spinner { animation: none; border-top-color: transparent; opacity: 0.5; }
}