/* 商品ROI计算器 */
.roi-app {
    display: flex;
    /* 页面高度锁定，改由右侧内容区内部滚动，左侧子菜单不再跟随页面滚动 */
    height: 100%;
    min-height: 0;
    --roi-brand: #1980fa;
    --roi-brand-2: #4da3ff;
    --roi-ink: #2c2c2c;
    --roi-muted: #888;
    --roi-sub: #aaa;
    --roi-line: #f5f5f5;
}

.roi-app * { box-sizing: border-box; }

.roi-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding: 0 0 60px;
    background: linear-gradient(180deg, #0b4fc4, #1980fa 8%, #5db0ff 16%, #f2f8ff 24%, #e7f1ff);
    color: var(--roi-ink);
}

.roi-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 0;
}

.roi-main input { font-family: inherit; }

/* header */
.roi-header { text-align: center; margin-bottom: 22px; padding: 8px 0 4px; }
.roi-header__title {
    font-size: 28px; font-weight: 800; color: #fff; letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(5, 50, 140, .35);
}
.roi-header__title .roi-accent {
    background: linear-gradient(135deg, #fff8d0, #f4d03f 50%, #fff4c2);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    margin-left: 4px;
}
.roi-header__sub { font-size: 13px; color: rgba(255, 240, 220, .9); margin-top: 6px; letter-spacing: .5px; }

/* tabs */
.roi-tabs {
    display: flex; background: #fff; border-radius: 12px; padding: 4px;
    margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}
.roi-tab {
    flex: 1; padding: 10px; text-align: center; font-size: 14px; color: var(--roi-muted);
    cursor: pointer; border-radius: 8px; transition: all .2s; font-weight: 500;
}
.roi-tab.active { background: linear-gradient(135deg, var(--roi-brand), var(--roi-brand-2)); color: #fff; font-weight: 600; }

/* banner */
.roi-banner {
    background: linear-gradient(135deg, var(--roi-brand), var(--roi-brand-2));
    color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 14px; text-align: center;
}
.roi-banner .roi-banner-label { font-size: 13px; opacity: .9; margin-bottom: 6px; }
.roi-banner .roi-banner-value { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.roi-banner .roi-banner-value .unit { font-size: 18px; font-weight: 500; margin-left: 4px; }
.roi-banner .roi-banner-status {
    display: inline-block; margin-top: 8px; padding: 4px 12px;
    background: hsla(0, 0%, 100%, .25); border-radius: 20px; font-size: 12px;
}
.roi-banner.loss { background: linear-gradient(135deg, #555, #777); }

/* cards */
.roi-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .roi-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .roi-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.roi-card {
    background: #fff; border-radius: 16px; padding: 20px 18px;
    box-shadow: 0 4px 20px rgba(25, 128, 250, .08);
}
.roi-card-title {
    font-size: 15px; font-weight: 700; color: var(--roi-brand); margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.roi-card-title::before {
    content: ""; display: inline-block; width: 4px; height: 16px;
    background: var(--roi-brand); border-radius: 2px;
}

/* fields */
.roi-field {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 0; border-bottom: 1px solid var(--roi-line);
}
.roi-field:last-child { border-bottom: none; }
.roi-field-label { flex: 1; min-width: 0; }
.roi-field-label .name { font-size: 15px; color: var(--roi-ink); font-weight: 500; }
.roi-field-label .hint { font-size: 11px; color: #999; margin-top: 2px; line-height: 1.4; }
.roi-field-input { width: 110px; text-align: right; flex-shrink: 0; position: relative; }
.roi-field-input input {
    width: 100%; border: none; background: #f7f7f7; border-radius: 8px;
    padding: 8px 28px 8px 10px; font-size: 16px; text-align: right; color: var(--roi-brand);
    font-weight: 600; outline: none; transition: background .2s; -moz-appearance: textfield;
}
.roi-field-input input::-webkit-inner-spin-button,
.roi-field-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.roi-field-input input:focus { background: #eaf3ff; }
.roi-field-input .unit {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #999; pointer-events: none;
}

/* results */
.roi-results { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 900px) { .roi-results { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.roi-result {
    background: linear-gradient(135deg, #f2f8ff, #e7f1ff);
    border-radius: 12px; padding: 12px; position: relative; overflow: hidden;
}
.roi-result.highlight { background: linear-gradient(135deg, var(--roi-brand), var(--roi-brand-2)); }
.roi-result.highlight .label,
.roi-result.highlight .sub,
.roi-result.highlight .value { color: #fff; }
.roi-result.full { grid-column: 1 / -1; }
.roi-result .label { font-size: 12px; color: var(--roi-muted); margin-bottom: 6px; }
.roi-result .value {
    font-size: 22px; font-weight: 700; color: var(--roi-brand);
    font-family: -apple-system, "SF Pro Display", sans-serif;
}
.roi-result .value .unit { font-size: 13px; font-weight: 500; margin-left: 2px; }
.roi-result .sub { font-size: 11px; color: var(--roi-sub); margin-top: 3px; }

.roi-tip {
    background: #fffbf5; border-left: 3px solid #ffc107; border-radius: 6px;
    padding: 10px 12px; margin-top: 12px; font-size: 12px; color: #8a6d3b; line-height: 1.6;
}
.roi-tip strong { color: #d68910; }

.roi-reset {
    width: 100%; background: #fff; border: 1px solid var(--roi-brand); color: var(--roi-brand);
    border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 600;
    margin-top: 8px; cursor: pointer; transition: all .2s;
}
.roi-reset:active { background: var(--roi-brand); color: #fff; }

.roi-footer {
    text-align: center; font-size: 11px; color: rgba(30, 70, 140, .7);
    margin-top: 24px; line-height: 1.6;
}

.roi-pane { display: none; }
.roi-pane.show { display: block; }
