:root {
    /* 极简风配色系统 */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    
    --text-primary: #64748B;  /* Slate 500 */
    --text-secondary: #94A3B8; /* Slate 400 */
    --text-emphasis: #334155;  /* Slate 700 */
    
    --border-color: #E2E8F0;   /* Slate 200 */
    
    /* 状态色 - 仅作点缀 */
    --risk-high: #EF4444;      /* Red 500 */
    --risk-medium: #F59E0B;    /* Amber 500 (调整为更温和的橙色) */
    --risk-low: #10B981;       /* Emerald 500 */
    --accent-blue: #3B82F6;    /* Blue 500 */

    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    
    --font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    overflow: hidden; /* Ensure shapes don't spill out */
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-emphasis);
}

.tab-btn.active {
    background-color: white;
    color: var(--text-emphasis);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* Modules */
.module {
    /* 保持原有的淡入动画 */
    position: relative;
    z-index: 1;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
}

h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-emphasis);
    margin: 0; /* Override default */
}

/* Risk Distribution Card */
.card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.total-asset-badge {
    background: #F1F5F9;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.total-asset-badge .label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.total-asset-badge .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-emphasis);
    font-family: var(--font-family);
}

/* Income Settings Styles (Removed) */


.risk-legend {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.risk-legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.legend-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.legend-label {
    color: var(--text-primary);
    font-weight: 500;
}

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

.legend-value {
    color: var(--text-emphasis);
    font-weight: 600;
}

.legend-percent {
    color: var(--text-secondary);
    font-size: 11px;
    background: #F8FAFC;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

/* Projection Card */
/* Removed Wealth Projection specific styles */

.chart-container-small {
    position: relative;
    height: 180px;
    width: 100%;
}

.projection-mini-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

/* Charts */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    background-color: #F8FAFC;
}

th:first-child {
    border-top-left-radius: 8px;
}
th:last-child {
    border-top-right-radius: 8px;
}

td {
    padding: 16px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
    transition: color 0.2s;
}

tr:hover td {
    background-color: #F8FAFC;
    color: var(--text-emphasis);
}

tr:last-child td {
    border-bottom: none;
}

/* Risk Badges (Capsule Style) */
.badge {
    padding: 2px 8px;
    border-radius: 999px; /* Capsule */
    font-size: 10px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: #fff;
    white-space: nowrap;
}

.badge-low {
    border-color: var(--border-color);
    color: var(--risk-low);
}
.badge-low::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--risk-low);
    margin-right: 4px;
}

.badge-medium {
    border-color: var(--border-color);
    color: var(--risk-medium);
}
.badge-medium::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--risk-medium);
    margin-right: 4px;
}

.badge-high {
    border-color: var(--border-color);
    color: var(--risk-high);
}
.badge-high::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--risk-high);
    margin-right: 4px;
}


/* Data Values */
.value-emphasis {
    color: var(--text-emphasis);
    font-weight: bold;
    font-family: var(--font-family);
}

.value-positive {
    color: var(--risk-low);
}

.value-negative {
    color: var(--risk-high);
}

/* Buttons */
.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-icon:hover {
    background: white;
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-edit {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-right: 4px;
}

.btn-edit:hover {
    background-color: #EFF6FF; /* Light blue */
    color: var(--accent-blue);
}

.btn-delete {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background-color: #FEF2F2;
    color: var(--risk-high);
}

.btn-primary {
    background: var(--text-emphasis);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1e293b;
}

/* Time Toggle Styles */
.toggle-group {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.radio-label input {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    cursor: pointer;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 2;
}

.input-row select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--text-emphasis);
    font-family: var(--font-family);
}

.hint-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6); /* Lighter backdrop */
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-emphasis);
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--text-emphasis);
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Performance Bars & Charts */
.perf-bar-container {
    margin-bottom: 12px;
}
.perf-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.perf-bar-bg {
    height: 6px;
    background: #F1F5F9;
    border-radius: 3px;
    overflow: hidden;
}
.perf-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reinvestment Simulator */
.reinvestment-simulator {
    margin-top: 16px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.highlight-blue {
    color: var(--accent-blue);
    font-weight: 600;
}

.slider-container {
    margin-bottom: 16px;
}

input[type=range] {
    width: 100%;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    background: #E2E8F0;
    border-radius: 4px;
    height: 4px;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    margin-top: -6px;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reinvestment-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

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

.re-value {
    font-weight: 600;
    color: var(--text-emphasis);
    font-family: var(--font-family);
}

/* Income Settings Styles */
.extra-income-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.extra-income-row select {
    width: 80px;
}

.extra-income-row input {
    flex: 1;
}

.btn-remove-row {
    color: var(--risk-high);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

/* Stats in Projection */
.projection-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #E2E8F0;
}

.stat-box {
    text-align: center;
}

.stat-label {
    font-size: 10px;
    color: #94A3B8;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.stat-value.gain {
    color: #10B981;
}


/* Graphic UI Elements - Abstract Shapes */
.graphic-shape {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.shape-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(59, 130, 246, 0.05); /* Very faint blue ring */
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(255,255,255,0) 0%, rgba(248,250,252,0.8) 100%);
}

.shape-dots {
    width: 150px;
    height: 150px;
    background-image: radial-gradient(#E2E8F0 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    top: 40px;
    right: 20px;
    opacity: 0.5;
}

.shape-line {
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #E2E8F0, transparent);
    bottom: 20%;
    left: 10%;
    transform: rotate(-45deg);
}
