/* 开服页面优化样式 */

/* 横向长条状套餐卡片 */
.plan-card-horizontal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--card-bg);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 24px;
    min-height: 80px;
}

.plan-card-horizontal:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.plan-card-horizontal.selected {
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

body.dark-theme .plan-card-horizontal {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

body.dark-theme .plan-card-horizontal.selected {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border-color: var(--primary-color);
}

.plan-header-horizontal {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.plan-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.plan-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plan-card-horizontal .plan-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.plan-description {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.2;
}

.plan-specs-horizontal {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: nowrap;
}

.spec-item-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    background: var(--secondary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.plan-card-horizontal.selected .spec-item-horizontal {
    background: rgba(102, 126, 234, 0.1);
}

body.dark-theme .spec-item-horizontal {
    background: var(--secondary-color);
}

body.dark-theme .plan-card-horizontal.selected .spec-item-horizontal {
    background: rgba(129, 140, 248, 0.15);
}

.spec-item-horizontal .spec-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1;
}

.spec-item-horizontal .spec-value {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1;
}

/* 响应式设计 - 横向长条卡片 */
@media (max-width: 768px) {
    .plan-card-horizontal {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
        min-height: auto;
    }
    
    .plan-header-horizontal {
        width: 100%;
    }
    
    .plan-specs-horizontal {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    
    .spec-item-horizontal {
        flex: 1;
        min-width: 55px;
        padding: 6px 10px;
    }
    
    .plan-icon {
        width: 42px;
        height: 42px;
    }
    
    .plan-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* 步骤指示器 */
.create-server-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.8;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.step-item.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-item.completed .step-number::before {
    content: '✓';
    font-size: 1.5rem;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step-divider {
    width: 80px;
    height: 3px;
    background: var(--border-color);
    margin: 0 15px;
    position: relative;
    top: -20px;
}

.step-item.completed + .step-divider {
    background: var(--success-color);
}

/* 区块头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.3rem;
}

.step-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 自定义配置网格 */
.custom-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* 自定义配置一行显示 - 改为长条状 */
.custom-options-inline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.custom-options-inline .form-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.custom-options-inline .form-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.custom-options-inline .form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    min-width: 100px;
    margin: 0;
}

.custom-options-inline .form-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--background-color);
    color: var(--text-color);
}

.custom-options-inline .form-group select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 16 16%27%3E%3Cpath fill=%27%23667eea%27 d=%27M8 11L3 6h10z%27/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

.custom-options-inline .form-group input:focus,
.custom-options-inline .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: var(--card-bg);
}

/* 暗色主题下的样式 */
body.dark-theme .custom-options-inline .form-group {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .custom-options-inline .form-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.2);
}

body.dark-theme .custom-options-inline .form-group input,
body.dark-theme .custom-options-inline .form-group select {
    background: var(--background-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-theme .custom-options-inline .form-group input:focus,
body.dark-theme .custom-options-inline .form-group select:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

body.dark-theme .custom-options-inline .form-group select {
    background-color: var(--background-color);
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 16 16%27%3E%3Cpath fill=%27%23818cf8%27 d=%27M8 11L3 6h10z%27/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.config-item label svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    flex: 1;
    padding: 12px 60px 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-with-unit input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-with-unit .unit {
    position: absolute;
    right: 14px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
}

/* 服务器信息网格 */
.server-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.info-item label svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.info-item input,
.info-item select {
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.info-item input:focus,
.info-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.info-item select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 16 16%27%3E%3Cpath fill=%27%23667eea%27 d=%27M8 11L3 6h10z%27/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* 已选配置显示 */
.selected-plan-display {
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    min-height: 56px;
}

/* 价格显示容器 */
.custom-plan-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid #fbbf24;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.price-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #92400e;
    transition: color 0.3s ease;
}

.price-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #b45309;
    transition: color 0.3s ease;
}

/* 暗色主题下的价格显示容器 */
body.dark-theme .custom-plan-price-container {
    background: linear-gradient(135deg, #422006 0%, #78350f 100%);
    border-color: #d97706;
}

body.dark-theme .price-label {
    color: #fde68a;
}

body.dark-theme .price-display {
    color: #fbbf24;
}

/* 大按钮样式 */
.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    gap: 12px;
}

.btn-large svg {
    width: 24px;
    height: 24px;
}

/* 套餐卡片增强 */
.plan-card {
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.plan-card.selected::before {
    transform: scaleX(1);
}

/* 卡片选择器样式 (替代下拉框) */
.card-selector-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 12px;
}

.card-selector-item {
    position: relative;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-selector-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.card-selector-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body.dark-theme .card-selector-item.selected {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
}

.card-selector-item.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.card-selector-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-selector-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.card-selector-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

.card-selector-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--secondary-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
}

.card-selector-item.selected .card-selector-badge {
    background: var(--primary-color);
    color: white;
}

.card-selector-item.recommended {
    border-color: #10b981;
}

.card-selector-item.recommended::after {
    content: '推荐';
    position: absolute;
    top: -10px;
    left: 12px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Java版本卡片特殊样式 */
.java-card {
    position: relative;
}

.java-card .java-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* 节点卡片特殊样式 */
.daemon-card .daemon-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin-top: 4px;
}

.daemon-card .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.daemon-card .daemon-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.daemon-card .daemon-location svg {
    width: 14px;
    height: 14px;
}

/* 隐藏原始的select元素 */
.hidden-select {
    display: none !important;
}

/* 配置概要卡片 */
.config-summary-card {
    position: sticky;
    top: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.config-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.config-summary-header svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.config-summary-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.config-summary-section {
    margin-bottom: 20px;
}

.config-summary-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.config-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.config-summary-item:last-child {
    border-bottom: none;
}

.config-summary-label {
    font-size: 0.95rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-summary-label svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.config-summary-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.config-summary-value.empty {
    color: var(--text-light);
    font-style: italic;
}

.config-summary-value.highlight {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.config-summary-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.config-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.config-summary-total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.config-summary-total-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.config-summary-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    margin-bottom: 16px;
}

body.dark-theme .config-summary-balance {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.config-summary-balance-label {
    font-size: 0.9rem;
    color: #059669;
}

body.dark-theme .config-summary-balance-label {
    color: #6ee7b7;
}

.config-summary-balance-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #047857;
}

body.dark-theme .config-summary-balance-value {
    color: #34d399;
}

.config-summary-warning {
    padding: 12px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #92400e;
}

body.dark-theme .config-summary-warning {
    background: #78350f;
    color: #fde68a;
}

.config-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-summary-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.config-summary-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.config-summary-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.config-summary-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.config-summary-btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.config-summary-btn-secondary:hover {
    background: var(--secondary-hover);
}

.config-summary-btn svg {
    width: 20px;
    height: 20px;
}

/* 两栏布局 */
.create-server-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

.create-server-main {
    min-width: 0;
}

.create-server-sidebar {
    min-width: 0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .create-server-layout {
        grid-template-columns: 1fr 320px;
        gap: 20px;
    }
}

@media (max-width: 968px) {
    .create-server-layout {
        grid-template-columns: 1fr;
    }
    
    .config-summary-card {
        position: static;
    }
    
    .create-server-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .create-server-steps {
        padding: 20px 10px;
    }
    
    .step-divider {
        width: 40px;
        margin: 0 8px;
    }
    
    .step-label {
        font-size: 0.8rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .custom-config-grid,
    .server-info-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .custom-plan-price-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.create-server-section {
    animation: slideInUp 0.5s ease;
}

/* 暗色主题适配 */
body.dark-theme .create-server-steps {
    background: var(--card-bg);
}

body.dark-theme .selected-plan-display {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border-color: var(--primary-color);
}

