/* 数据分析工作台 - 唯一样式文件（无框架、无构建） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f6fa; color: #243044; font-size: 15px; line-height: 1.6;
}
a { color: #2b5fd9; text-decoration: none; }
.container { max-width: 1100px; margin: 24px auto 60px; padding: 0 20px; }
.page-title { margin-bottom: 18px; font-size: 22px; }
.muted { color: #8a94a6; }
.hint { color: #8a94a6; font-size: 13px; margin-bottom: 10px; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.mt { margin-top: 16px; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 1px solid #e4e8f0; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 54px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 17px; color: #243044; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.top-link { font-size: 14px; }
.top-user { font-size: 14px; color: #5a6478; }
.inline-form { display: inline; }

/* 按钮 */
.btn { border: 1px solid transparent; border-radius: 6px; padding: 8px 18px; font-size: 14px; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-primary { background: #2b5fd9; color: #fff; }
.btn-ok { background: #1f9d61; color: #fff; }
.btn-warn { background: #d9822b; color: #fff; }
.btn-danger { background: #d94b4b; color: #fff; }
.btn-ghost { background: #fff; color: #5a6478; border-color: #d4dae5; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-delete { margin: -6px 0 8px; display: block; }

/* 登录页 */
.login-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #4a6fdc 0%, #2b5fd9 55%, #1f3f9e 100%); }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(20,35,80,.35); padding: 36px 40px; width: 380px; }
.login-title { font-size: 20px; text-align: center; }
.login-sub { text-align: center; color: #8a94a6; font-size: 13px; margin: 6px 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #5a6478; margin-bottom: 5px; }
.field input[type=text], .field input[type=password], .field input[type=number] {
  width: 100%; padding: 9px 12px; border: 1px solid #d4dae5; border-radius: 6px; font-size: 14px;
}
.field input:focus { outline: none; border-color: #2b5fd9; }
.num { width: 90px !important; }

/* 提示 */
.alert { border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecec; color: #b33232; border: 1px solid #f3caca; }
.alert-ok { background: #e8f7ef; color: #177a4c; border: 1px solid #c5ead6; }

/* 工作台卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.module-card { background: #fff; border: 1px solid #e4e8f0; border-radius: 10px; padding: 20px 22px; color: #243044; transition: box-shadow .15s, transform .15s; }
.module-card:hover { box-shadow: 0 8px 24px rgba(36,48,68,.12); transform: translateY(-2px); }
.module-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.module-desc { color: #8a94a6; font-size: 13px; min-height: 20px; }
.module-meta { margin-top: 12px; font-size: 13px; color: #2b5fd9; }

/* 子功能页 */
.breadcrumb { margin-bottom: 12px; font-size: 14px; }
.module-page-desc { color: #8a94a6; font-size: 14px; margin-bottom: 18px; }
.link-list { list-style: none; background: #fff; border: 1px solid #e4e8f0; border-radius: 10px; overflow: hidden; }
.link-item + .link-item { border-top: 1px solid #eef1f6; }
.link-main { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; color: #243044; }
.link-main:hover { background: #f7f9fd; }
.link-name { font-weight: 600; }
.link-badge { font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.link-badge-ext { background: #fff4e3; color: #b96a12; }

/* 空状态 / 错误页 */
.empty-state { background: #fff; border: 1px solid #e4e8f0; border-radius: 10px; text-align: center; padding: 60px 20px; color: #5a6478; }
.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-hint { font-size: 13px; color: #8a94a6; margin-top: 6px; }

/* 管理后台 */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 2px solid #e4e8f0; }
.tab-btn { background: none; border: none; padding: 10px 18px; font-size: 15px; color: #5a6478; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: #2b5fd9; font-weight: 700; border-bottom-color: #2b5fd9; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-box { background: #fff; border: 1px solid #e4e8f0; border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; }
.panel-box h3 { font-size: 16px; margin-bottom: 12px; }
.panel-box h4 { font-size: 14px; color: #5a6478; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .field-wide, .field-wide { grid-column: 1 / -1; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 0; }
.check-item { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef1f6; font-size: 14px; }
.data-table th { color: #8a94a6; font-weight: 600; font-size: 13px; }
.actions { display: flex; gap: 8px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.tag-ok { background: #e8f7ef; color: #177a4c; }
.tag-off { background: #fdecec; color: #b33232; }
.tag-admin { background: #eaefff; color: #2b5fd9; }
.perm-row { border-top: 1px solid #eef1f6; padding: 14px 0; }
.perm-row:first-of-type { border-top: none; }
.perm-user { margin-bottom: 4px; }
.module-edit-row { display: grid; grid-template-columns: 1fr 110px 110px 1fr auto; gap: 0 14px; align-items: end; }
.module-edit-row .field-wide { grid-column: 1 / 4; }
.link-edit { margin-bottom: 4px; }
.link-edit-row { display: flex; gap: 8px; align-items: center; }
.link-edit-row input { padding: 7px 10px; border: 1px solid #d4dae5; border-radius: 6px; font-size: 13px; }
.le-name { width: 200px; }
.le-url { flex: 1; }
.le-sort { width: 70px; }
.link-add { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e4e8f0; }

/* toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #243044; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 99; }
.toast.show { opacity: 1; }
.hidden { display: none; }
