/* --- 基础样式与重置 --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5; }
/* --- 布局容器 --- */
.app-body { background-color: #f9fafb; color: #1f2937; min-height: 100vh; padding-bottom: 3rem; }
.container { max-width:40rem; margin: 0 auto; padding:1rem; }
.header { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; }
.header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align: center;}
.main-grid { 
    display: block; 
    width: 100%; 
}
.left-col { display: flex; flex-direction: column; gap: 0.5rem; }
.right-col { width: 100%; }
/* 输入框在规则行内不要撑满宽度，保持紧凑 */
.rule-row .input-field {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

/* 删除按钮样式 */
.rule-del-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    line-height: 1;
}

.rule-del-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
/* --- 结果看板单行排版样式 --- */
.result-card { display: flex; flex-direction: column; gap: 0.75rem; background: #1e40af;}

/* 核心数据行：横向排列 */
.result-row {background: #1e40af;
    display: flex;
    align-items: baseline; /* 文字基线对齐 */
    gap: 1rem;             /* 三组数据之间的间距 */
    flex-wrap: nowrap;     /* 强制不换行 */
}

/* 每一组数据的布局 */
.result-inline-item {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

/* 【核心】统一的文字样式 */
.result-label-row { 
    font-size: 1rem;  /* 统一较小的字号 */
    color: #bfdbfe;      /* 统一的浅蓝色标签 */
    white-space: nowrap; /* 防止文字被截断 */
}
.result-value-row { 
    font-size: 1rem;  /* 【关键】数字也使用相同字号，不再放大 */
    font-weight: 700;    /* 保持加粗以区分标签 */
    color: #fff;         /* 统一的白色数字 */
}

/* --- 目标测算样式 (统一风格) --- */
.target-section { background: #1e40af;
    border-top: 1px solid #1e40af; 
}

.target-inputs { 
    display: flex; 
    gap: 0.1rem;   
    align-items: baseline;   
    flex-wrap: nowrap;   
}
.share-grid { 
    margin-top: 0.1rem; 
    display: flex; 
    gap: 0.5rem; 
    justify-content: flex-end;  
} 
.input-dark {font-size: 1rem;
    background: #1e40af;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    padding: 0.1rem 0.25rem; /* 极小的内边距，保持紧凑 */
    outline: none; 
    width: 60px;             /* 固定一个合适的宽度 */
    text-align: center;
}

/* --- 响应式布局 (核心修复) --- */
@media (min-width: 1024px) {
    .header { flex-direction: row; align-items: center; }
    .main-grid { grid-template-columns: 2fr 1fr; }
    .right-col { position: sticky; top: 1.5rem; }
}

/* --- 通用组件 --- */
.card { background: #fff; border-radius: 0.75rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid #f3f4f6; padding: 0.5rem; }
.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.section-title { font-size: 1rem; font-weight: 700; color: #374151; margin-bottom: 0.1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.1rem; }
.card-actions { display: flex; gap: 0.75rem; }
.title-bar { width: 4px; height: 1.5rem; background: #2563eb; border-radius: 9999px; display: inline-block; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.1rem; }
.input-field { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.875rem; outline: none; transition: all 0.2s; }
.input-field:focus { border-color: transparent; box-shadow: 0 0 0 2px #3b82f6; }
.btn-secondary { padding: 0.5rem 1rem; background: #fff; color: #374151; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: #f9fafb; box-shadow: 0 0 0 2px #3b82f6; }
.btn-danger { padding: 0.5rem 1rem; background: #fff; color: #dc2626; border: 1px solid #fecaca; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-danger:hover { background: #fef2f2; }
.link-btn { background: none; border: none; color: #2563eb; font-size: 0.875rem; cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.w-20 { width: 6rem; }  
.w-24 { width: 6rem; }   
.rounded-l-lg{ width: 12rem; }
.rounded-r-lg { width: 3rem; } 