:root {
    --primary-color: #ff6a00; /* Aliyun Orange */
    --primary-hover: #ff8a33;
    --text-color: #333333;
    --text-secondary: #888888;
    --border-color: #cccccc;
    --bg-color: #f5f5f5;
    --panel-bg: #ffffff;
    --header-bg: #262f3e; /* Aliyun Console Dark Header */
    --header-text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: var(--header-bg);
    color: var(--header-text);
    height: 50px;
    display: flex;
    justify-content: center; /* Center the inner content */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    width: 100%;
    max-width: 1440px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    letter-spacing: 1px;
}

.ali-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
}

.header-nav {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #aeb4b9;
}

.nav-item {
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item:hover {
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-aux-nav {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #aeb4b9;
    margin-right: 10px;
}

.header-aux-nav .nav-item {
    font-size: 12px; /* Slightly smaller for aux nav */
}

.header-action {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.action-icon {
    width: 20px;
    height: 20px;
    fill: #aeb4b9;
    transition: fill 0.2s;
}

.header-action:hover .action-icon {
    fill: #fff;
}

.header-user .avatar {
    width: 24px;
    height: 24px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .header-left {
        gap: 0;
    }
}

/* Layout */
.main-container {
    display: flex;
    max-width: 1440px;
    margin: 20px auto;
    padding: 0 20px;
    gap: 20px;
    flex: 1;
    width: 100%;
}

/* Left Config Panel */
.config-panel {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid #e3e4e6;
    padding: 0 20px;
}

.section {
    padding: 24px 0;
    border-bottom: none;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    line-height: 1;
}

.form-row {
    display: flex;
    margin-bottom: 0;
    padding: 20px 0;
    align-items: flex-start;
    border-bottom: 1px dashed #e3e4e6;
}

.form-row:last-child {
    border-bottom: none;
}

.label {
    width: 100px;
    padding-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.content {
    flex: 1;
}

/* Select Group */
.select-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.select-btn {
    border: 1px solid var(--border-color);
    padding: 0 16px;
    height: 36px;
    line-height: 34px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    position: relative;
    min-width: 100px;
    text-align: center;
    color: var(--text-color);
}

.select-btn:hover {
    border-color: var(--text-secondary);
}

/* Aliyun Style Active State: Orange Border + Bottom-Right Check */
.select-btn.active {
    border: 1px solid var(--primary-color);
    color: var(--text-color);
}

.select-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 16px 16px; /* Triangle */
    border-color: transparent transparent var(--primary-color) transparent;
}

.select-btn.active::before {
    content: '✓';
    position: absolute;
    bottom: -3px;
    right: 0px;
    color: #fff;
    font-size: 10px;
    z-index: 1;
    line-height: 1;
    font-weight: bold;
    transform: scale(0.7);
}

/* Instance Cards */
.instance-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.instance-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: auto;
    padding: 12px 16px;
    text-align: left;
    width: 100%;
}

.instance-card .plan-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.instance-card .plan-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Right Summary Panel */
.summary-panel {
    width: 300px;
    background: var(--panel-bg);
    border: 1px solid #e3e4e6;
    height: fit-content;
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: column;
}

.summary-header {
    background: #f7f9fa;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #e3e4e6;
}

.summary-content {
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.summary-row .key {
    color: var(--text-secondary);
}

.summary-row .val {
    color: var(--text-color);
    text-align: right;
    max-width: 60%;
}

.price-section {
    margin-top: 20px;
    border-top: 1px solid #f2f2f2;
    padding-top: 20px;
}

.price-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.price-value {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1;
}

.price-unit {
    font-size: 14px;
    color: var(--text-color);
    margin-left: 4px;
}

.original-price {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-bottom: 4px;
}

.action-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    height: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--primary-hover);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: auto;
    background-color: #f7f9fa;
    border-top: 1px solid #e3e4e6;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
    }

    .summary-panel {
        width: 100%;
        position: static;
    }

    .instance-group {
        grid-template-columns: 1fr;
    }

    .label {
        width: 100%;
        margin-bottom: 8px;
    }

    .form-row {
        flex-direction: column;
    }
}
