:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1d2129;
  background: #e8edf4;
  font-synthesis: none;
  --blue: #165dff;
  --line: #e5e8ef;
  --muted: #86909c;
  --panel: #fff;
  --canvas: #f5f7fa;
}

* { box-sizing: border-box; }
html, body, #root { width: 100%; min-width: 320px; height: 100%; margin: 0; }
body { overflow: hidden; background: #e8edf4; }
button, input, textarea { font: inherit; }
button { color: inherit; }

.mini-shell {
  width: min(100%, 440px);
  height: 100vh;
  display: grid;
  grid-template-rows: 44px 50px 58px minmax(0, 1fr) 28px;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid rgba(78, 89, 105, 0.18);
  box-shadow: 0 20px 60px rgba(29, 33, 41, 0.18);
}

html[data-dock="right"] .mini-shell { margin-left: auto; }
html[data-dock="left"] .mini-shell { margin-right: auto; }

.mini-header,
.project-switcher,
.mini-nav,
.mini-footer {
  background: rgba(255, 255, 255, 0.96);
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
  user-select: none;
}

.mini-brand,
.window-actions,
.project-trigger,
.mini-footer,
.section-title,
.page-title,
.selected-expert,
.session-list > div,
.settings-card > div,
.version-card {
  display: flex;
  align-items: center;
}

.mini-brand { gap: 7px; font-weight: 800; }
.mini-brand img { width: 25px; height: 25px; }
.mini-brand .arco-tag { margin-left: 2px; }
.window-actions { gap: 2px; }
.window-actions .arco-btn { color: #6b778c; }
.window-actions .active { color: var(--blue); background: #edf3ff; }

.project-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.project-switcher > .arco-select { width: 100%; }
.project-trigger {
  width: 100%;
  min-width: 0;
  height: 36px;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 3px 6px;
  text-align: left;
  cursor: pointer;
}
.project-trigger:hover { background: #f2f5fa; }
.project-trigger > span:nth-of-type(1) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.project-trigger small { margin-left: auto; color: var(--muted); font-size: 10px; }

.mini-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.mini-nav button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #6b778c;
  cursor: pointer;
  font-size: 11px;
}
.mini-nav button::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2px; border-radius: 99px; background: transparent; }
.mini-nav svg { font-size: 18px; }
.mini-nav button:hover,
.mini-nav button.active { color: var(--blue); background: linear-gradient(180deg, transparent, #f3f7ff); }
.mini-nav button.active::after { background: var(--blue); }

.mini-alert { position: fixed; z-index: 30; top: 102px; left: 50%; width: min(388px, calc(100% - 24px)); transform: translateX(-50%); }
.mini-content { min-height: 0; overflow: hidden; }
.mini-content > .arco-spin { width: 100%; height: 100%; }
.mini-content > .arco-spin > .arco-spin-children { height: 100%; }
.mini-page { height: 100%; overflow-x: hidden; overflow-y: auto; padding: 14px 14px 24px; scrollbar-width: thin; scrollbar-color: #c9cdd4 transparent; }

.mini-footer { justify-content: space-between; padding: 0 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.mini-footer span { display: inline-flex; align-items: center; gap: 5px; }
.mini-footer i { width: 6px; height: 6px; border-radius: 50%; background: #00b42a; box-shadow: 0 0 0 2px #e8ffea; }
.mini-footer button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }

.page-intro {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #165dff, #6aa1ff);
  color: white;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(22, 93, 255, 0.2);
}
.page-intro::after { content: ""; position: absolute; width: 130px; height: 130px; right: -45px; top: -52px; border: 24px solid rgba(255,255,255,.1); border-radius: 50%; }
.page-intro .arco-typography { color: rgba(255,255,255,.78); }
.page-intro h4 { margin: 4px 0 5px; color: white; }
.page-intro p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.86); font-size: 12px; line-height: 1.6; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.metric { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 12px; }
.metric strong { font-size: 22px; }
.metric span { color: var(--muted); font-size: 11px; }
.metric.blue strong { color: #165dff; }.metric.green strong { color: #00b42a; }.metric.purple strong { color: #722ed1; }.metric.orange strong { color: #ff7d00; }

.section-title { justify-content: space-between; gap: 8px; margin: 18px 2px 9px; font-size: 13px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-actions button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 12px; text-align: left; cursor: pointer; }
.quick-actions button:hover { border-color: #94bfff; box-shadow: 0 5px 16px rgba(22,93,255,.1); }
.quick-actions svg { color: var(--blue); font-size: 20px; }
.quick-actions span, .compact-list span, .session-list span, .settings-card span { min-width: 0; display: grid; gap: 2px; }
.quick-actions small, .compact-list small, .session-list small, .settings-card small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.compact-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.compact-list > div { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 9px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f0f1f4; }
.compact-list > div:last-child { border-bottom: 0; }
.compact-list svg { color: var(--blue); }

.page-title { justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.page-title h5 { margin: 0 0 2px; }
.page-title .arco-typography { font-size: 11px; }
.filter-strip { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 12px; padding-bottom: 2px; scrollbar-width: none; }
.filter-strip button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); padding: 4px 10px; cursor: pointer; font-size: 11px; }
.filter-strip button.active { border-color: #8eb7ff; background: #edf3ff; color: var(--blue); }

.sticky-list, .note-grid { display: grid; gap: 9px; }
.task-note { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 9px; border: 1px solid #eadfac; border-radius: 4px 13px 13px 13px; background: #fffbea; padding: 13px 12px 12px 9px; box-shadow: 0 4px 14px rgba(78, 89, 105, .08); }
.task-note:nth-child(3n+2) { border-color: #cde5d7; background: #f0fff5; }
.task-note:nth-child(3n+3) { border-color: #d7def4; background: #f2f5ff; }
.task-note.completed { opacity: .64; }
.task-note.completed strong { text-decoration: line-through; }
.task-check { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.8); color: #8b9aab; cursor: pointer; }
.task-note:not(.completed) .task-check:hover, .task-note.completed .task-check { color: #00b42a; }
.task-note strong { font-size: 13px; }
.task-note p { margin: 5px 0; color: #4e5969; font-size: 11px; line-height: 1.5; }
.task-note span { color: var(--muted); font-size: 10px; }

.hidden-file { display: none; }
.note-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.source-note { min-height: 135px; display: flex; flex-direction: column; border: 1px solid #eadfac; border-radius: 4px 14px 14px 14px; background: #fff9d8; padding: 13px; }
.source-note.tone-1 { background: #eaf8ff; border-color: #c7e6f5; }.source-note.tone-2 { background: #f3edff; border-color: #ded0f7; }.source-note.tone-3 { background: #edfff3; border-color: #caead4; }
.source-note svg { color: #ff9a2e; font-size: 18px; }
.source-note strong { margin-top: 9px; font-size: 12px; }
.source-note p { flex: 1; margin: 5px 0; color: #4e5969; font-size: 10px; }
.source-note span { color: var(--muted); font-size: 9px; }

.ai-view > .arco-input-wrapper { border-radius: 10px; }
.expert-strip { max-height: 210px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; overflow-y: auto; padding: 1px; }
.expert-strip button { min-width: 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 8px; text-align: left; cursor: pointer; }
.expert-strip button.active { border-color: #75a8ff; background: #f2f6ff; box-shadow: 0 0 0 1px #c8dcff; }
.expert-strip i, .selected-expert i, .session-list i { display: grid; place-items: center; border-radius: 9px; color: white; font-style: normal; }
.expert-strip i { width: 34px; height: 34px; font-size: 17px; }
.expert-strip span { min-width: 0; display: grid; }
.expert-strip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.expert-strip small { color: var(--muted); font-size: 9px; }

.mini-composer { display: grid; gap: 8px; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 11px; box-shadow: 0 7px 22px rgba(29,33,41,.08); }
.selected-expert { min-height: 38px; gap: 9px; }
.selected-expert i { width: 36px; height: 36px; flex: 0 0 36px; }
.selected-expert span { min-width: 0; display: grid; }
.selected-expert b { font-size: 12px; }
.selected-expert small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mini-composer .arco-textarea-wrapper { border-radius: 9px; background: #f6f7f9; }
.session-list { display: grid; gap: 7px; }
.session-list > div { gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 9px; }
.session-list i { width: 31px; height: 31px; }

.settings-card { display: grid; gap: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 13px; }
.settings-card > strong { font-size: 13px; }
.settings-card > div { gap: 9px; border-top: 1px solid #f0f1f4; padding-top: 9px; }
.settings-card svg { color: var(--blue); }
.settings-card p { margin: 0; color: #4e5969; font-size: 11px; line-height: 1.65; }
.version-card { grid-template-columns: 34px minmax(0,1fr); }
.version-card img { width: 34px; }

.mini-login { width: 100%; height: 100%; display: grid; place-items: center; overflow: auto; padding: 22px; background: linear-gradient(160deg, #edf4ff 0%, #e6ebf2 52%, #dce4ef 100%); }
.login-note { width: min(360px, 100%); display: grid; justify-items: stretch; gap: 13px; border: 1px solid rgba(255,255,255,.85); border-radius: 4px 22px 22px 22px; background: #fffbea; padding: 26px 22px 20px; box-shadow: 0 24px 60px rgba(29,33,41,.16); }
.login-note > img { width: 52px; }
.login-note h3 { margin: 0; }
.login-note label, .mini-form label { display: grid; gap: 5px; color: #4e5969; font-size: 11px; }
.login-note .arco-input-wrapper, .mini-form .arco-input-wrapper { border-radius: 9px; background: rgba(255,255,255,.82); }
.login-note > small { color: var(--muted); text-align: center; }
.mini-connection { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; margin-top: -5px; border: 1px solid #bedaff; border-radius: 9px; background: #f2f8ff; padding: 8px 10px; color: #165dff; font-size: 11px; }
.mini-connection > i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mini-connection > strong { font-weight: 600; }
.mini-connection > button { border: 0; background: transparent; padding: 0; color: inherit; cursor: pointer; font-size: 11px; }
.mini-connection.online { border-color: #7be188; background: #f0fff4; color: #168a2f; }
.mini-connection.offline { border-color: #f53f3f; background: #fff2f0; color: #d91d35; }

.mini-modal .arco-modal { width: min(380px, calc(100vw - 24px)); }
.mini-modal .arco-modal-content { border-radius: 15px; }
.mini-form { display: grid; gap: 13px; }
.mini-form .arco-select { width: 100%; }

@media (min-width: 700px) {
  body { display: flex; }
  html[data-dock="right"] body { justify-content: flex-end; }
  html[data-dock="left"] body { justify-content: flex-start; }
}

@media (max-width: 359px) {
  .mini-shell { border: 0; }
  .mini-brand .arco-tag { display: none; }
  .note-grid, .expert-strip { grid-template-columns: 1fr; }
}
