/* ============ CiaoGo 管理系统 ============ */
@font-face {
  font-family: 'Quicksand';
  font-weight: 500;
  font-display: swap;
  src: url('assets/Quicksand-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Quicksand';
  font-weight: 700;
  font-display: swap;
  src: url('assets/Quicksand-Bold.ttf') format('truetype');
}
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1B7A44;        /* CiaoGo 招牌绿 Signature Green */
  --primary-dark: #145C33;
  --primary-soft: #e8f3ed;
  --sky: #A8D6F3;            /* 闪电浅蓝 Lightning Blue */
  --sky-soft: #eaf4fc;
  --blue: #3d8fc7;           /* 浅蓝加深，用于正文可读的蓝 */
  --green: #1B7A44;
  --red: #e03131;
  --bg: #f4f6f5;
  --card: #ffffff;
  --border: #e7ece9;
  --text: #23231F;           /* 墨色 Ink */
  --muted: #8a908c;
  --sidebar: #23231F;        /* 墨色侧边栏，白蓝标记专用底色 */
  --radius: 12px;
  --shadow: 0 1px 3px rgba(35,35,31,.06);
}
.brand-font { font-family: "Quicksand", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 700; letter-spacing: .5px; }
.o-green { color: #1B7A44; }
.o-green-l { color: #35b06a; }   /* 深色底上的绿，提亮保证可读 */
.o-blue { color: #A8D6F3; }
h1 .o-blue { color: #7cbfe9; }   /* 白底上的浅蓝稍加深 */
[v-cloak] { display: none; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
#app { display: flex; min-height: 100vh; }
.muted { color: var(--muted); }
.green { color: var(--green); }
.orange { color: #d9480f; }   /* 支出/警示用暖橙，与品牌绿区分 */
.blue { color: var(--blue); }
.link { color: var(--blue); cursor: pointer; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #23231F 0%, #145C33 55%, #1B7A44 100%); width: 100%;
}
.login-card {
  background: #fff; border-radius: 22px; padding: 44px 48px; width: 420px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-logo { width: 84px; height: auto; }
.login-card h1 { font-size: 32px; margin: 10px 0 4px; color: var(--text); }
.login-card h1 .cn { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 22px; color: var(--text); font-weight: 600; margin-left: 4px; }
.login-sub { color: var(--muted); margin-bottom: 26px; }
.login-users { display: flex; flex-direction: column; gap: 12px; }
.login-user {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; cursor: pointer; text-align: left; font-size: 14px;
  transition: all .15s;
}
.login-user:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,122,68,.15); }
.lu-info b { display: block; font-size: 15px; }
.lu-info small { color: var(--muted); }

/* ---------- 头像 ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; font-size: 16px;
}
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.xs { width: 24px; height: 24px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 216px; background: var(--sidebar); color: #cfcfc8; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand-logo { width: 34px; height: auto; }
.brand-text b { color: #fff; font-size: 18px; display: block; line-height: 1.1; }
.brand-text small { font-size: 11px; color: #9a9a92; }
.sidebar nav { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
  cursor: pointer; font-size: 14px; transition: background .15s; position: relative;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-ico { width: 20px; text-align: center; font-style: normal; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 9px;
  padding: 1px 7px; font-weight: 600;
}
.sidebar nav a.active .nav-badge { background: rgba(255,255,255,.3); }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.me-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.me-chip:hover { background: rgba(255,255,255,.07); }
.me-chip b { color: #fff; font-size: 13px; display: block; }
.me-chip small { font-size: 11px; color: #9a9a92; }
.switch-ico { margin-left: auto; color: #9a9a92; }

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 28px 32px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.page-head h2 { font-size: 22px; margin-bottom: 4px; }
.head-btns { display: flex; gap: 10px; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card small { color: var(--muted); }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-card .muted { font-size: 12px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.empty.small { padding: 14px 0; font-size: 13px; }

/* ---------- 工作台列表 ---------- */
.dash-task, .dash-tx { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.dash-task { cursor: pointer; }
.dash-task:hover { background: #fafbfc; }
.dash-task:last-child, .dash-tx:last-child { border-bottom: none; }
.dt-main { flex: 1; min-width: 0; }
.dt-main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-main small { font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.todo { background: #adb5bd; }
.dot.doing { background: var(--blue); }
.dot.done { background: var(--green); }
.tx-ico {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.tx-ico.income { background: var(--primary-soft); color: var(--green); }
.tx-ico.expense { background: #fdece3; color: #d9480f; }

/* ---------- 标签 ---------- */
.tag { font-size: 12px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.tag.tiny { font-size: 11px; padding: 1px 7px; }
.st-todo { background: #f1f3f2; color: #55584f; }
.st-doing { background: var(--sky-soft); color: #2d7fb8; }
.st-done { background: var(--primary-soft); color: var(--green); }
.pr-high { background: #fdeaea; color: var(--red); }
.pr-mid { background: #fff3e0; color: #e8590c; }
.pr-low { background: #f1f3f5; color: #868e96; }
.tag.gray { background: #f1f3f5; color: #666; }

/* ---------- 预算条 ---------- */
.budget-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px 22px; }
.budget-item { margin-bottom: 10px; }
.bi-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.bi-top .muted { font-size: 12px; }
.bar { height: 8px; background: #f1f3f5; border-radius: 4px; overflow: hidden; }
.bar.slim { height: 6px; flex: 1; }
.bar-in { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.bar-in.over { background: var(--red); }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.cat-name { width: 90px; font-size: 13px; flex-shrink: 0; }
.cat-row b { width: 80px; text-align: right; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 14px; font-family: inherit; text-decoration: none; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px; transition: all .15s;
}
.btn:hover { border-color: #ced4da; background: #f8f9fa; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; margin-top: 6px; }
.btn.danger-outline { border-color: #ffc9c9; color: var(--red); background: #fff; }
.btn.danger-outline:hover { background: #fff5f5; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.icon-btn {
  border: none; background: none; cursor: pointer; color: var(--muted); font-size: 14px;
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
}
.icon-btn:hover { background: #f1f3f5; color: var(--text); }
.icon-btn.danger:hover { background: #fff5f5; color: var(--red); }

/* ---------- 团队 ---------- */
.org-chart { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-bottom: 18px; text-align: center; }
.org-root {
  display: inline-block; background: var(--sidebar); color: #fff; padding: 12px 34px; border-radius: 10px;
  font-weight: 700; font-size: 16px;
}
.org-root small { display: block; font-weight: 400; font-size: 11px; color: #aab2c0; margin-top: 2px; }
.org-line { width: 2px; height: 22px; background: var(--border); margin: 0 auto; }
.org-depts { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.org-dept { background: #fafbfc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; min-width: 128px; }
.od-name { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--primary); }
.od-member { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; justify-content: center; }
.empty-slot { font-size: 12px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.member-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.mc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mc-top b { font-size: 17px; display: block; margin-bottom: 4px; }
.mc-top .icon-btn { margin-left: auto; }
.mc-rows div { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; }
.mc-rows small { color: var(--muted); width: 34px; flex-shrink: 0; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid #f4f5f7; font-size: 13px; vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table .num { text-align: right; }
.td-note { max-width: 260px; color: #495057; }
.filters { display: flex; gap: 8px; }
.filters select, .form select, .form input, .form textarea, .td-row select, .td-row input, .reply-input input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  font-family: inherit; background: #fff; color: var(--text); outline: none;
}
.filters select:focus, .form input:focus, .form textarea:focus, .reply-input input:focus { border-color: var(--primary); }
.file-ico { font-size: 16px; margin-right: 2px; }
.file-ops { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ---------- 看板 ---------- */
.task-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 13px; font-family: inherit; display: inline-flex; align-items: center; gap: 5px;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-n { font-size: 11px; opacity: .7; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kb-col { background: #eef0f2; border-radius: 12px; padding: 12px; }
.kb-head { font-weight: 700; font-size: 14px; padding: 4px 6px 12px; display: flex; align-items: center; gap: 8px; }
.kb-head::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.kb-todo::before { background: #adb5bd; }
.kb-doing::before { background: var(--blue); }
.kb-done::before { background: var(--green); }
.kb-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.task-card {
  background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.tc-top { display: flex; gap: 6px; margin-bottom: 8px; }
.tc-title { font-size: 14px; display: block; margin-bottom: 10px; line-height: 1.45; }
.tc-title.strike { text-decoration: line-through; color: var(--muted); }
.tc-foot { display: flex; align-items: center; gap: 8px; }
.tc-foot small { font-size: 12px; }

/* ---------- 讨论区 ---------- */
.topic-list { max-width: 800px; }
.topic-card { padding: 18px 22px; }
.topic-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.topic-content { font-size: 14px; line-height: 1.7; color: #37404a; white-space: pre-wrap; margin-bottom: 12px; }
.replies { display: flex; flex-direction: column; gap: 10px; background: #f8f9fa; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.reply { display: flex; gap: 10px; }
.reply-body { flex: 1; }
.reply-body small { display: block; margin-bottom: 2px; }
.reply-body small .muted { font-weight: 400; margin-left: 6px; font-size: 11px; }
.reply-body p { font-size: 13px; line-height: 1.6; color: #37404a; white-space: pre-wrap; }
.reply-input { display: flex; gap: 8px; }
.reply-input input { flex: 1; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,22,28,.5); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 20px;
}
.modal { background: #fff; border-radius: 14px; width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto; padding: 22px 26px; }
.modal.wide { width: 600px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 17px; }
.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #495057; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-preview { background: #f8f9fa; border-radius: 10px; padding: 14px; font-size: 14px; word-break: break-all; }

/* ---------- 任务详情 ---------- */
.task-detail { display: flex; flex-direction: column; gap: 14px; }
.td-row { display: flex; align-items: center; gap: 14px; }
.td-row > label { width: 64px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.td-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.td-row.col > label { width: auto; }
.td-row.right { justify-content: flex-end; }
.td-row p { line-height: 1.7; }
.seg { display: inline-flex; background: #f1f3f5; border-radius: 8px; padding: 3px; gap: 2px; }
.seg.block { width: 100%; }
.seg.block button { flex: 1; }
.seg button {
  border: none; background: none; padding: 6px 16px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-family: inherit; color: var(--muted);
}
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #23231F; color: #fff;
  padding: 10px 22px; border-radius: 30px; font-size: 14px; z-index: 200; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  animation: toastIn .25s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dash-cols { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .budget-grid { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 50px; }
}
