/* 熔盐物性计算系统 全局样式（中文界面） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f3f6f9; color: #243447; font-size: 14px;
}
a { color: #1f6fb2; text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 220px; background: #1f3a5f; color: #e8eef5; display: flex;
  flex-direction: column; padding: 20px 0;
}
.brand { font-size: 16px; font-weight: 700; padding: 0 20px 24px; line-height: 1.5; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  color: #d6e2ef; padding: 10px 20px; display: block; border-left: 3px solid transparent;
}
.nav-link:hover { background: #2a4d77; text-decoration: none; }
.sidebar-user { margin-top: auto; padding: 16px 20px; border-top: 1px solid #35577e; }
.uname { font-weight: 600; }
.urole { font-size: 12px; color: #9fb8d1; margin: 2px 0 8px; }
.logout { color: #ffb4a2; font-size: 13px; }

/* 主区 */
.main { flex: 1; padding: 24px 28px; }
.page-title { font-size: 20px; margin-bottom: 18px; }
.page-sub { color: #6b7c8d; margin-bottom: 16px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(20, 50, 80, 0.08);
}
.card h3 { font-size: 15px; margin-bottom: 12px; color: #1f3a5f; }

/* 统计块 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(20,50,80,.08); }
.stat .num { font-size: 24px; font-weight: 700; color: #1f6fb2; }
.stat .label { color: #6b7c8d; margin-top: 4px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e6edf3; text-align: left; }
th { color: #5a6b7b; font-weight: 600; background: #f7fafc; }
tr:hover td { background: #f9fbfd; }

/* 标签 / 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.badge-admin { background: #fde2e1; color: #c0392b; }
.badge-pi { background: #e3f0fd; color: #1f6fb2; }
.badge-researcher { background: #e6f6ec; color: #27834c; }
.badge-visitor { background: #eee; color: #666; }
.status-draft { background: #eee; color: #555; }
.status-submitted { background: #fef3d7; color: #b8860b; }
.status-running { background: #e3f0fd; color: #1f6fb2; }
.status-completed { background: #e6f6ec; color: #27834c; }
.status-failed { background: #fde2e1; color: #c0392b; }
.status-archived { background: #eee; color: #888; }
.module-tag { font-weight: 600; color: #1f3a5f; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: #5a6b7b; }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid #ccd8e2; border-radius: 6px; font-size: 14px; background: #fff;
}
.field textarea { resize: vertical; }
.field .help { font-size: 12px; color: #8a99a8; }
.field input:disabled, .field select:disabled { background: #f0f3f6; color: #777; }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid transparent;
  background: #1f6fb2; color: #fff; cursor: pointer; font-size: 14px;
}
.btn:hover { background: #185a91; text-decoration: none; }
.btn.secondary { background: #fff; color: #1f6fb2; border-color: #1f6fb2; }
.btn.danger { background: #c0392b; }
.btn.ghost { background: #eef2f6; color: #33475b; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filter-bar .field { min-width: 150px; }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e6edf3; margin-bottom: 18px; }
.tab { padding: 10px 18px; cursor: pointer; color: #5a6b7b; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #1f6fb2; border-bottom-color: #1f6fb2; font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 代码 / 文本预览 */
pre.preview {
  background: #0f2233; color: #d7e6f2; padding: 14px; border-radius: 8px;
  overflow: auto; font-size: 13px; line-height: 1.6; max-height: 420px;
}
textarea.code-editor {
  width: 100%; min-height: 320px; font-family: "Consolas", "Menlo", monospace;
  background: #0f2233; color: #d7e6f2; border: 1px solid #24445f; border-radius: 8px; padding: 12px;
}

/* 图表 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.chart-box { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 3px rgba(20,50,80,.08); }
.chart { width: 100%; height: 320px; }
.chart-box h4 { margin-bottom: 8px; color: #1f3a5f; font-size: 14px; }

/* 提示框 */
.notice { background: #fff8e6; border-left: 4px solid #e0a800; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; color: #6b5310; }
.notice.info { background: #eef6fd; border-left-color: #1f6fb2; color: #24506e; }
.notice.error { background: #fdecea; border-left-color: #c0392b; color: #922; }

/* 登录页 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1f3a5f, #3a6ea5); }
.login-card { background: #fff; border-radius: 12px; padding: 34px; width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.login-card h2 { margin-bottom: 6px; }
.login-card .sub { color: #6b7c8d; margin-bottom: 22px; font-size: 13px; }
.login-card .field { margin-bottom: 16px; }

/* 附件列表 */
.attach-list { display: flex; flex-direction: column; gap: 10px; }
.attach-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid #e6edf3; border-radius: 8px; }
.attach-meta { font-size: 12px; color: #8a99a8; }
.attach-actions { display: flex; gap: 8px; }

.muted { color: #8a99a8; }
.mt-12 { margin-top: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; }
.kv div span { color: #6b7c8d; margin-right: 6px; }
