:root {
    --bg: #0b0f19;
    --card: rgba(22, 30, 48, 0.85);
    --card-border: rgba(89, 110, 158, 0.22);
    --text-main: #f1f5fb;
    --text-sub: #8b9bb4;
    --accent-blue: #3b82f6;
    --accent-cyan: #22d3ee;
    --accent-gold: #f59e0b;
    --accent-teal: #14b8a6;
    --rise: #ef4444;
    --fall: #22c55e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text-main);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% -10%, rgba(59, 130, 246, 0.12), transparent 45%),
        radial-gradient(circle at 100% 80%, rgba(34, 211, 238, 0.08), transparent 40%);
}
.app { max-width: 430px; margin: 0 auto; padding: 0 16px 32px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
    width: 40px; height: 40px; border-radius: 50%;
    overflow: hidden; border: 2px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.brand-tag { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.date-pill {
    font-size: 11px; color: var(--text-sub);
    background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 20px;
    border: 1px solid var(--card-border);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.rules-pill {
    font-size: 11px; color: #7db4ff; text-decoration: none;
    background: rgba(59,130,246,0.12); padding: 5px 10px; border-radius: 20px;
    border: 1px solid rgba(59,130,246,0.35);
}
.rules-pill:active { background: rgba(59,130,246,0.25); }

.card {
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: 20px; padding: 18px; margin-bottom: 14px;
    backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.hero { text-align: center; padding: 24px 18px; position: relative; overflow: hidden; }
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(34,211,238,0.08));
    pointer-events: none;
}
.hero-label { font-size: 12px; color: var(--text-sub); letter-spacing: 0.8px; position: relative; }
.hero-value { font-size: 40px; font-weight: 700; margin: 6px 0 2px; position: relative;
    background: linear-gradient(90deg, #fff, #bae6fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 13px; color: var(--text-sub); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; position: relative; }
.hero-cell { text-align: left; }
.hero-cell-label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.hero-cell-value { font-size: 18px; font-weight: 600; }

.section-title {
    font-size: 13px; font-weight: 600; color: var(--text-sub);
    margin: 22px 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
    content: ""; width: 4px; height: 14px; border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-cyan));
}

.plan-progress { padding: 20px; }
.plan-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.plan-title { font-size: 14px; font-weight: 600; }
.plan-amount { font-size: 13px; color: var(--text-sub); }
.plan-amount b { color: var(--text-main); font-weight: 600; }
.progress-track {
    height: 14px; border-radius: 10px; background: rgba(255,255,255,0.06);
    overflow: hidden; border: 1px solid rgba(255,255,255,0.05);
}
.progress-fill {
    width: 0; height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    box-shadow: 0 0 14px rgba(59,130,246,0.45);
    transition: width 0.8s ease;
}
.plan-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-sub); }

.allocation { display: flex; align-items: center; gap: 16px; }
.donut {
    width: 96px; height: 96px; border-radius: 50%;
    background: conic-gradient(var(--accent-blue) 0% 57.4%, var(--accent-gold) 57.4% 92.7%, var(--accent-teal) 92.7% 100%);
    position: relative; flex-shrink: 0;
    box-shadow: 0 0 20px rgba(59,130,246,0.2);
    transition: background 0.5s ease;
}
.donut::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg); }
.donut-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--text-sub); z-index: 1; }
.alloc-legend { flex: 1; }
.alloc-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.alloc-row:last-child { margin-bottom: 0; }
.alloc-left { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.alloc-val { font-weight: 600; }
.alloc-sub { font-size: 11px; color: var(--text-sub); text-align: right; margin-top: 2px; }

.asset-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.asset-name { display: flex; align-items: center; gap: 10px; }
.asset-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.asset-title { font-size: 16px; font-weight: 600; }
.asset-code { font-size: 11px; color: var(--text-sub); }
.asset-pnl { text-align: right; }
.asset-pnl-value { font-size: 18px; font-weight: 700; color: var(--rise); }
.asset-pnl-pct { font-size: 12px; color: var(--rise); }

.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.asset-cell {
    background: rgba(255,255,255,0.04); border-radius: 12px; padding: 12px;
    border: 1px solid rgba(255,255,255,0.04);
}
.asset-cell-label { font-size: 11px; color: var(--text-sub); margin-bottom: 5px; }
.asset-cell-value { font-size: 15px; font-weight: 600; }
.asset-cell-sub { font-size: 11px; color: var(--text-sub); margin-top: 3px; }

.tag {
    display: inline-block; font-size: 10px; padding: 3px 8px; border-radius: 6px;
    background: rgba(34,211,238,0.12); color: var(--accent-cyan); margin-left: 6px;
}

.chart-card { padding: 18px; }
.chart-placeholder { font-size: 12px; color: var(--text-sub); text-align: center; padding: 40px 0; }
#chart { width: 100%; height: 180px; border-radius: 12px; background: rgba(255,255,255,0.03); }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--text-sub); margin-top: 10px; }
.chart-legend i { margin-right: 4px; }

.live-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--fall); vertical-align: middle; margin-left: 3px;
    box-shadow: 0 0 6px var(--fall);
}
.update-foot { font-size: 11px; color: var(--text-sub); text-align: center; margin: 16px 0 8px; }

.disclaimer {
    font-size: 10px; color: var(--text-sub); line-height: 1.6;
    padding: 16px; border-radius: 14px;
    background: rgba(255,255,255,0.03); border: 1px dashed var(--card-border);
}

.rise { color: var(--rise); }
.fall { color: var(--fall); }
