/* ================================
   云诺虚拟主机 - 全局样式
   ================================ */

:root {
    --primary: #20a53a;
    --primary-dark: #189030;
    --primary-light: #e8f5e9;
    --sidebar-width: 220px;
    --sidebar-bg: #2d3a4b;
    --sidebar-hover: #364358;
    --sidebar-active: #3d4f65;
    --body-bg: #f5f6fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e9ecef;
    --success: #20a53a;
    --warning: #ff9800;
    --danger: #ff5722;
    --info: #1890ff;
}

/* 全局 */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--body-bg);
    margin: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ================================
   认证页面
   ================================ */
.auth-body { background: linear-gradient(135deg, #2d3a4b 0%, #1a2332 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-wrapper { display: flex; width: 100%; max-width: 900px; min-height: 520px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); margin: 2rem; }
.auth-brand { flex: 1; background: linear-gradient(135deg, var(--primary) 0%, #15702a 100%); display: flex; align-items: center; justify-content: center; color: #fff; padding: 3rem; }
.auth-brand h1 { font-size: 4rem; margin: 0; }
.auth-brand h2 { font-size: 1.6rem; font-weight: 600; }
.auth-brand p { font-size: 0.95rem; }
.auth-form-side { flex: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 3rem; }
.auth-form-card { width: 100%; max-width: 360px; }
.btn-login { background: var(--primary); border-color: var(--primary); border-radius: 8px; padding: 10px; font-size: 15px; font-weight: 500; }
.btn-login:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

@media (max-width: 768px) {
    .auth-wrapper { flex-direction: column; max-width: 420px; }
    .auth-brand { padding: 2rem; min-height: auto; }
    .auth-brand h1 { font-size: 2.5rem; }
}

/* ================================
   侧边栏
   ================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s;
}
.sidebar-header {
    padding: 1.2rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-brand { font-size: 1rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.25rem;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 0.6rem;
}
.sidebar-link:hover { color: #fff; background: var(--sidebar-hover); text-decoration: none; }
.sidebar-link.active { color: #fff; background: var(--sidebar-active); border-left-color: var(--primary); }
.sidebar-link i { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 13px; }
.sidebar-balance { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; }
.sidebar-logout { font-size: 12px; padding: 2px 10px; }

/* ================================
   主内容区
   ================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}
.top-bar {
    background: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar-right { display: flex; align-items: center; gap: 0.75rem; }
.content-area {
    padding: 1.5rem;
}

/* ================================
   卡片组件
   ================================ */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.card-header { background: #fff; border-bottom: 1px solid var(--border-color); font-weight: 600; padding: 0.85rem 1.25rem; }

/* 统计卡片 */
.stat-card {
    border-left: 4px solid var(--primary);
    border-radius: 8px;
}
.stat-card.card-success { border-left-color: var(--success); }
.stat-card.card-info { border-left-color: var(--info); }
.stat-card.card-warning { border-left-color: var(--warning); }
.stat-card.card-danger { border-left-color: var(--danger); }
.stat-card .stat-icon { font-size: 2.2rem; opacity: 0.15; position: absolute; right: 1rem; top: 1rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 0.25rem; }

/* ================================
   表格
   ================================ */
.table { font-size: 14px; }
.table th { font-weight: 600; color: var(--text-secondary); background: #fafbfc; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: var(--primary-light); }

/* ================================
   状态标签
   ================================ */
.badge-active { background: var(--success) !important; }
.badge-suspended { background: var(--warning) !important; }
.badge-expired { background: #9e9e9e !important; }
.badge-deleted { background: var(--danger) !important; }
.badge-pending { background: var(--info) !important; }
.badge-completed { background: var(--success) !important; }
.badge-failed { background: var(--danger) !important; }
.badge-refunded { background: #7c4dff !important; }

/* ================================
   进度条
   ================================ */
.progress { height: 8px; border-radius: 4px; background: #e9ecef; }
.progress-bar-green { background: linear-gradient(90deg, #20a53a, #4caf50); }
.progress-bar-blue { background: linear-gradient(90deg, #1890ff, #42a5f5); }
.progress-bar-orange { background: linear-gradient(90deg, #ff9800, #ffb74d); }
.progress-bar-red { background: linear-gradient(90deg, #ff5722, #ff8a65); }

/* ================================
   按钮
   ================================ */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ================================
   表单
   ================================ */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(32,165,58,0.15);
}
.form-label { font-weight: 500; font-size: 13px; color: var(--text-secondary); }

/* ================================
   开关组件
   ================================ */
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ================================
   步骤指示器
   ================================ */
.step-wizard { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }
.step-item { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.step-item.active { color: var(--primary); font-weight: 600; }
.step-item.done { color: var(--success); }
.step-circle {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e9ecef; color: var(--text-muted); font-weight: 600; font-size: 14px;
}
.step-item.active .step-circle { background: var(--primary); color: #fff; }
.step-item.done .step-circle { background: var(--success); color: #fff; }
.step-line { width: 60px; height: 2px; background: #e9ecef; margin: 0 0.5rem; }
.step-line.active { background: var(--primary); }
.step-line.done { background: var(--success); }

/* 套餐卡片选中 */
.plan-card { cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.plan-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.plan-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-card.selected .card-header { background: var(--primary); color: #fff; }

/* 服务器卡片选中 */
.server-card { cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.server-card:hover { border-color: var(--primary-light); }
.server-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* ================================
   Toast 通知
   ================================ */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }

/* ================================
   Modal
   ================================ */
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-footer { border-top: 1px solid var(--border-color); }

/* ================================
   响应式
   ================================ */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: inline-block !important; }
}
.mobile-toggle { display: none !important; }
