/* ============================================
   后台管理样式
   ============================================ */

/* 卡片标题 */
.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 图表容器 */
.chart-container {
    display: flex;
    gap: 16px;
    height: 280px;
}

.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.chart-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 0 8px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100%;
}

.chart-bar-item {
    flex: 1;
    background: var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    transition: all var(--transition);
}

.chart-bar-item:hover {
    opacity: 0.8;
}

.chart-bar-item.secondary {
    background: var(--primary-light);
    opacity: 0.5;
}

.chart-x-axis {
    display: flex;
    justify-content: space-between;
    padding: 12px 8px 0;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.chart-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* 存储列表 */
.storage-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.storage-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.storage-used {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.storage-total-label {
    font-size: 14px;
    color: var(--text-muted);
}

.storage-percent {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.storage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.storage-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.storage-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.storage-item-details {
    flex: 1;
}

.storage-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.storage-item-size {
    font-size: 13px;
    color: var(--text-muted);
}

.storage-item-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-item-progress {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* 表格操作 */
.table-actions {
    display: flex;
    gap: 8px;
}

/* 公告列表 */
.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.announcement-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.announcement-item:hover {
    background: var(--bg-tertiary);
}

.announcement-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.announcement-content {
    flex: 1;
}

.announcement-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.announcement-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.announcement-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* 快速操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.quick-action-item:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--shadow);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.quick-action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quick-action-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   添加网站页面
   ============================================ */

/* 步骤指示器 */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all var(--transition);
}

.step.active .step-number {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-primary);
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
}

/* 表单步骤 */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.required {
    color: var(--danger);
}

/* 服务器节点选择 */
.server-nodes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.server-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.server-node:hover {
    background: var(--bg-tertiary);
}

.server-node.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.server-node-flag {
    font-size: 24px;
}

.server-node-info {
    flex: 1;
}

.server-node-name {
    font-weight: 600;
    color: var(--text-primary);
}

.server-node-location {
    font-size: 13px;
    color: var(--text-muted);
}

.server-node-latency {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-full);
}

/* 域名选项 */
.domain-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.domain-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.domain-option:hover {
    background: var(--bg-tertiary);
}

.domain-option.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.domain-option-radio input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.domain-option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.domain-option-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.domain-input-wrapper {
    display: flex;
    gap: 12px;
}

.domain-input-wrapper input {
    flex: 1;
}

/* SSL 选项 */
.ssl-option {
    margin-top: 24px;
    padding: 20px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
}

.ssl-option-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ssl-option-icon {
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ssl-option-info {
    flex: 1;
}

.ssl-option-title {
    font-weight: 600;
    color: var(--text-primary);
}

.ssl-option-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 切换开关 */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* 部署方式 */
.deploy-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.deploy-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.deploy-method:hover {
    background: var(--bg-tertiary);
}

.deploy-method.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.deploy-method-icon {
    font-size: 32px;
}

.deploy-method-name {
    font-weight: 600;
    color: var(--text-primary);
}

.deploy-method-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* 上传区域 */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.02);
}

.upload-icon {
    font-size: 48px;
}

.upload-title {
    font-weight: 600;
    color: var(--text-primary);
}

.upload-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* 高级选项 */
.advanced-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.advanced-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.advanced-option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.advanced-option-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

/* 成功页面 */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease;
}

.success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.website-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-label {
    color: var(--text-secondary);
}

.preview-value {
    font-weight: 600;
    color: var(--text-primary);
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ============================================
   空间管理页面
   ============================================ */

/* 存储图表 */
.storage-chart {
    display: flex;
    align-items: center;
    gap: 40px;
}

.storage-donut {
    position: relative;
    width: 200px;
    height: 200px;
}

.storage-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.storage-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.storage-donut-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.storage-donut-label {
    font-size: 14px;
    color: var(--text-muted);
}

.storage-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.storage-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
}

/* 趋势图表 */
.trend-chart {
    margin-bottom: 24px;
}

.trend-line {
    height: 150px;
}

.trend-line svg {
    width: 100%;
    height: 100%;
}

.trend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.trend-stats {
    display: flex;
    gap: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.trend-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trend-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.trend-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 空间进度 */
.space-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.space-progress span {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 40px;
}

/* 大文件列表 */
.large-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.large-file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.large-file-item:hover {
    background: var(--bg-tertiary);
}

.large-file-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.large-file-info {
    flex: 1;
}

.large-file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.large-file-path {
    font-size: 13px;
    color: var(--text-muted);
}

.large-file-size {
    font-weight: 600;
    color: var(--primary);
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
}

/* 优化建议 */
.optimization-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.optimization-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.optimization-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.optimization-content {
    flex: 1;
}

.optimization-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.optimization-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   网站列表页面
   ============================================ */

/* 筛选栏 */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.view-btn {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* 网站卡片网格 */
.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.website-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.website-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-color);
}

.website-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.website-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.website-status.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.website-status.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.website-status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.website-card-body {
    padding: 24px;
    text-align: center;
}

.website-icon {
    width: 64px;
    height: 64px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.website-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.website-type {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.website-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.website-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.website-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.website-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.website-card-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.website-card-footer .btn {
    flex: 1;
}

/* 添加新网站卡片 */
.website-card.add-new {
    border: 2px dashed var(--border-color);
    background: transparent;
    box-shadow: none;
}

.website-card.add-new:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.02);
}

.add-new-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    gap: 16px;
}

.add-new-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
}

.add-new-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .storage-chart {
        flex-direction: column;
        text-align: center;
    }
    
    .deploy-methods {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .server-nodes {
        grid-template-columns: 1fr;
    }
    
    .steps-indicator {
        flex-wrap: wrap;
    }
    
    .step-line {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .deploy-methods {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 16px;
    }
    
    .filter-left {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-left .input {
        width: 100% !important;
    }
    
    .websites-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
