/* Studio 2.1 — shared visual system, no external fonts or assets. */
:root {
  --primary: #5855db;
  --primary-dark: #4340b8;
  --bg: #f4f5fa;
  --text: #202436;
  --text-secondary: #697187;
  --border: #e6e8f1;
  --danger: #ba3957;
  --warning: #b67a18;
  --shadow: 0 6px 28px #25284f06;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  color-scheme: light;
}
body {
  background:
    radial-gradient(ellipse at 85% 0, #e9e8ff85, transparent 40%), var(--bg);
}
button {
  min-height: 40px;
  border-radius: 11px;
  font-weight: 550;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
button:hover {
  background: #f0f0fb;
  border-color: #d4d2ef;
}
button:active {
  transform: translateY(1px);
}
button.primary {
  background: var(--primary);
  box-shadow: 0 4px 12px #5855db20;
  color: #fff;
  border-color: transparent;
}
button.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 18px #5855db30;
}
input,
textarea,
select {
  border-color: var(--border);
  border-radius: 11px;
  min-height: 44px;
  background: #fbfbfe;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #9b98ea;
  box-shadow: 0 0 0 3px #5855db0d;
  outline: none;
}
input[type="checkbox"] {
  min-height: initial;
  accent-color: var(--primary);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline-color: #9893f3;
}
h1 {
  font-size: clamp(26px, 2.7vw, 38px);
  font-weight: 750;
  letter-spacing: -1.3px;
}
h2 {
  font-weight: 650;
  letter-spacing: -0.3px;
}
.eyebrow {
  color: #777394;
  letter-spacing: 2.2px;
  font-size: 10px;
}
.workspace {
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  background: #202338;
  color: #dce0f3;
  border: 0;
  padding: 30px 18px 18px;
  box-shadow: 5px 0 30px #1d203308;
}
.brand {
  color: #fff;
  margin-bottom: 30px;
  font-size: 22px;
}
.brand i {
  background: #c6f3c0;
  color: #223c31;
  border-radius: 12px;
  box-shadow: 0 4px 16px #0002;
}
.brand small {
  color: #939bb8;
  font-size: 9px;
  letter-spacing: 2px;
}
.nav-search input {
  background: #ffffff09;
  border: 1px solid #ffffff0c;
  color: #edf0ff;
  min-height: 40px;
  margin-bottom: 16px;
}
.nav-search input::placeholder {
  color: #9ba3bf;
}
.sidebar nav {
  scrollbar-color: #555b76 transparent;
}
.sidebar nav > a,
.sidebar details > a {
  color: #b9c0d7;
  font-size: 13px;
  padding-block: 10px;
  border-radius: 10px;
  margin-block: 3px;
}
.sidebar a:hover {
  background: #ffffff09;
  color: #fff;
}
.sidebar a.active {
  background: #c6f3c0;
  color: #243d31;
  box-shadow: 0 4px 12px #0001;
  font-weight: 650;
}
.sidebar details > a {
  padding-left: 24px;
}
.sidebar summary {
  color: #808ba9;
  font-size: 10px;
  letter-spacing: 1.6px;
  padding-top: 22px;
}
.sidebar footer {
  border-color: #ffffff13;
}
.profile > span {
  background: #3a3c58;
  color: #d9d5ff;
}
.profile small {
  color: #9ba3bf;
}
.profile strong {
  color: #e9ecf9;
}
.profile button {
  color: #b4bdd7;
}
.sidebar #syncBadge {
  color: #b7e9b2;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sidebar #syncBadge:before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.sidebar #syncBadge[data-status="error"],
.sidebar #syncBadge[data-status="offline"],
.sidebar #syncBadge[data-status="unauth"] {
  color: #ffb4b4;
}
.sidebar .r6-console-open {
  background: #ffffff07;
  border-color: #ffffff16;
  color: #c0c7df;
  font-size: 11px;
}
.topbar {
  background: #f7f8fbcf;
  border-bottom: 1px solid #e7e8f099;
  min-height: 78px;
  padding-inline: 40px;
  backdrop-filter: blur(20px);
}
.topbar strong {
  font-size: 13px;
  font-weight: 600;
}
.topbar .eyebrow {
  color: #9298ac;
}
.scope {
  color: #74708e;
  background: #eae9f5;
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 11px;
}
main#mainContent {
  padding: 38px 40px 64px;
  max-width: 1640px;
}
.page-heading {
  margin-bottom: 30px;
}
.page-heading p:last-child {
  font-size: 13px;
  line-height: 1.8;
  color: #7b8195;
}
.actions {
  flex-wrap: wrap;
}
.date-chip {
  border-radius: 30px;
  color: #72768d;
  font-variant-numeric: tabular-nums;
}
.stats {
  gap: 18px;
  margin-bottom: 24px;
}
.stats article {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid #fff;
  border-radius: 19px;
  box-shadow: var(--shadow);
}
.stats article:after {
  content: "";
  position: absolute;
  right: 22px;
  top: 25px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: #b6b2f3;
}
.stats article:nth-child(2):after {
  background: #9ed3ba;
}
.stats article:nth-child(3):after {
  background: #f0c08d;
}
.stats article:nth-child(4):after {
  background: #a2bbed;
}
.stats article:first-child {
  background: #eeedff;
  border-color: #e2dffd;
}
.stats span {
  font-size: 12px;
  color: #71758e;
}
.stats strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.4px;
  margin: 13px 0 7px;
  font-variant-numeric: tabular-nums;
}
.stats small {
  font-size: 11px;
  color: #85899d;
}
.panel,
.learning-progress article {
  border-radius: 19px;
  box-shadow: var(--shadow);
  border-color: #e9eaf2;
  padding: 25px;
}
.dashboard-grid {
  gap: 22px;
}
.panel-title {
  margin-bottom: 9px;
}
.panel-title a {
  font-size: 12px;
}
.task-row {
  padding: 19px 0;
  border-color: #eef0f5;
}
.task-row small {
  font-size: 11px;
  line-height: 1.6;
}
.task-row strong {
  font-weight: 600;
  font-size: 13px;
}
.complete {
  min-height: 26px;
  width: 26px;
  min-width: 26px;
  border-color: #dcddea;
  color: #8782cc;
}
.complete:hover {
  background: #eeedff;
  color: var(--primary);
}
.shortcuts {
  gap: 12px;
}
.shortcuts a {
  background: #f6f6fc;
  border-color: #ececf6;
  border-radius: 14px;
  padding: 20px 17px;
  transition:
    background 0.18s,
    transform 0.18s;
}
.shortcuts a:hover {
  background: #eeedfc;
  transform: translateY(-2px);
}
.shortcuts strong {
  color: #4d4b75;
  font-size: 13px;
}
.shortcuts span {
  color: #86859f;
  font-size: 11px;
}
.hint {
  background: #f6f7fb;
  border-color: #e9eaf3;
  color: #7b8096;
  border-radius: 12px;
  font-size: 12px;
}
.toolbar {
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar input,
.toolbar select {
  background: #fff;
  font-size: 13px;
}
.toolbar .search {
  max-width: 440px;
  min-width: 150px;
}
.toolbar > span {
  font-size: 12px;
}
.table-scroll {
  border-radius: 12px;
  overscroll-behavior-inline: contain;
}
table {
  font-size: 13px;
}
th {
  background: #f5f5fb;
  color: #7d829a;
  font-size: 11px;
  font-weight: 600;
  padding: 14px;
}
td {
  padding: 18px 14px;
  border-color: #eef0f6;
}
tbody tr:hover {
  background: #fafaff;
}
.row-actions button {
  border-radius: 7px;
  min-height: 34px;
  font-size: 12px;
}
.row-actions button:hover {
  background: #eeedfc;
}
.row-actions button.danger-text {
  color: #b6596e;
}
.pagination {
  font-size: 12px;
  flex-wrap: wrap;
}
.empty {
  padding: 70px 20px;
}
.empty > span {
  color: #b4b0dd;
}
.empty p {
  color: #81879b;
}
.empty h2 {
  color: #5f6480;
}
.board {
  gap: 18px;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
}
.board > section {
  background: #eceef6;
  border: 1px solid #e2e5ef;
  border-radius: 17px;
  padding: 18px;
  scroll-snap-align: start;
}
.board h2 {
  color: #606781;
  letter-spacing: 0.2px;
}
.board article {
  border-radius: 13px;
  border-color: #e6e7f1;
  box-shadow: 0 3px 10px #27284104;
}
.board article h3 {
  line-height: 1.7;
}
.board article p,
.board article small {
  font-size: 11px;
  color: #81879c;
}
.month-grid {
  border-radius: 14px;
  overflow: hidden;
}
.month-grid > b {
  background: #f4f4fc;
  color: #7c7b97;
}
.month-day.today {
  background: #f0efff;
}
.month-day.today > span {
  background: var(--primary);
  color: #fff;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  width: 23px;
  height: 23px;
}
.month-day button {
  background: #eeedfb;
  color: #5b5689;
  font-size: 11px;
  border-radius: 6px;
}
.gantt-bar {
  background: #8983dc;
  border-radius: 7px;
}
.gantt-bar.done {
  background: #82baa6;
}
.gantt-track {
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 25px,
    #eeedf5 26px
  );
}
.reminders p {
  background: #fff7e9;
  color: #966b34;
  border: 1px solid #f7e9ce;
  border-radius: 13px;
}
.finance-summary strong {
  font-variant-numeric: tabular-nums;
}
.learning-progress article {
  background: linear-gradient(135deg, #fff, #f8f8ff);
}
progress {
  height: 7px;
  border-radius: 10px;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: #ececf6;
  border-radius: 10px;
}
progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 10px;
}
.skill-tree li > div {
  background: #f5f5fc;
  border: 1px solid #eae9f6;
  border-radius: 13px;
}
.focus-panel {
  padding-block: 40px;
  background:
    radial-gradient(ellipse at 50% 30%, #efedff, transparent 70%), #fff;
}
.focus-panel #focusClock {
  font-size: clamp(64px, 8vw, 100px);
  font-weight: 650;
  letter-spacing: -5px;
}
.focus-panel .actions {
  gap: 12px;
}
#aiResult {
  background: #f5f4fe;
  border: 1px solid #e9e6fb;
  border-radius: 14px;
}
.editor-dialog,
.r6-console {
  border-radius: 22px;
  box-shadow: 0 30px 100px #25244530;
  border-color: #e7e6f2;
}
dialog::backdrop,
.r6-console::backdrop {
  background: #20233866;
  backdrop-filter: blur(7px);
}
.editor-dialog header {
  padding: 25px 28px;
}
.editor-dialog section {
  padding: 26px 28px;
  gap: 20px;
}
.editor-dialog footer {
  background: #fafaff;
  border-color: #eeedf6;
  padding: 18px 28px;
}
.editor-dialog header button {
  border-radius: 50%;
  width: 40px;
}
.field > span {
  font-size: 13px;
}
.r6-stat {
  border-radius: 14px;
  background: #f9f9fe;
}
.r6-notice {
  background: #fffaf0;
}
.r6-session {
  gap: 12px;
}
.document-preview {
  background: #f5f5fb;
}
.login {
  background: #f8f9fe;
  grid-template-columns: 1fr 1.05fr;
}
.login > section {
  max-width: 500px;
  padding: 10vh 50px;
}
.brand-symbol {
  background: #5855db;
  border-radius: 17px;
  box-shadow: 0 8px 24px #5855db26;
  width: 52px;
  height: 52px;
  margin-bottom: 35px;
}
.login h1 {
  font-size: 43px;
  font-weight: 750;
  letter-spacing: -1.6px;
}
.login label {
  font-size: 13px;
  color: #60667e;
}
.login input {
  min-height: 49px;
}
.login small {
  font-size: 11px;
  color: #8a90a5;
}
.login > aside {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  justify-content: flex-end;
  margin: 22px 22px 22px 0;
  min-height: calc(100dvh - 44px);
  border-radius: 26px;
  padding: 8vh 6vw;
  background: #24263e;
  color: #f1f0ff;
}
.login > aside:before {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  border: 65px solid #a29aea;
  border-radius: 50%;
  top: 10%;
  right: -75px;
  transform: rotate(-25deg);
  z-index: -1;
  box-shadow:
    0 0 100px #a29aea20,
    inset 0 0 70px #a29aea20;
}
.login > aside:after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  background: #c6f3c0;
  border-radius: 40px;
  top: 25%;
  left: 12%;
  transform: rotate(-18deg);
  z-index: -1;
  box-shadow: 0 25px 60px #0002;
}
.login > aside span {
  font-size: clamp(35px, 4.3vw, 72px);
  letter-spacing: -2.5px;
  line-height: 1.06;
}
.login > aside p {
  color: #acb0d0;
  font-size: 13px;
}
.setup {
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
#toast {
  background: #292c45;
  border: 1px solid #ffffff20;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  bottom: max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 10px 40px #25244522;
}
.nav-scrim {
  display: none;
}
.mobile-nav {
  display: none;
}
.topbar > div {
  min-width: 0;
}
.topbar strong {
  overflow-wrap: anywhere;
}
.page-heading > div {
  min-width: 0;
}
.panel-title {
  flex-wrap: wrap;
}
.stats article,
.shortcuts a,
.learning-progress article {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 1600px) {
  main#mainContent {
    padding: 44px 56px 70px;
  }
  .topbar {
    padding-inline: 56px;
  }
}
@media (min-width: 721px) and (max-width: 1150px) {
  .workspace {
    grid-template-columns: 212px minmax(0, 1fr);
  }
  .sidebar {
    padding: 26px 13px 16px;
  }
  .brand {
    font-size: 20px;
  }
  .topbar {
    padding-inline: 25px;
  }
  main#mainContent {
    padding: 30px 25px 50px;
  }
  .panel {
    padding: 22px;
  }
  .stats {
    gap: 14px;
  }
  .stats article {
    padding: 20px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .login > aside:after {
    width: 125px;
    height: 125px;
    left: 10%;
  }
}
@media (max-width: 720px) {
  .workspace {
    display: block;
  }
  .sidebar {
    width: min(300px, 86vw);
    padding: 27px 19px max(20px, env(safe-area-inset-bottom));
    z-index: 40;
    box-shadow: none;
  }
  .nav-open {
    overflow: hidden;
  }
  .nav-open .sidebar {
    box-shadow: 20px 0 80px #10102455;
  }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #181b354f;
    border: 0;
    border-radius: 0;
    backdrop-filter: blur(3px);
  }
  .nav-open .nav-scrim {
    display: block;
  }
  .topbar {
    padding: 12px 18px;
    min-height: 70px;
    gap: 10px;
  }
  .topbar .primary {
    min-height: 40px;
    font-size: 12px;
  }
  .topbar strong {
    font-size: 12px;
  }
  #menuToggle {
    min-height: 40px;
    width: 40px;
    background: #fff;
    border-color: var(--border);
    border-radius: 11px;
  }
  main#mainContent {
    padding: 26px 18px calc(102px + env(safe-area-inset-bottom));
  }
  .page-heading {
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .page-heading .eyebrow {
    font-size: 9px;
  }
  .page-heading p:last-child {
    font-size: 12px;
  }
  .page-heading .actions {
    gap: 8px;
    max-width: 100%;
  }
  .page-heading .actions button {
    font-size: 12px;
    min-height: 40px;
  }
  .stats {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
  }
  .stats article {
    padding: 19px 17px;
    border-radius: 16px;
  }
  .stats article:after {
    right: 16px;
    top: 22px;
    width: 7px;
    height: 7px;
  }
  .stats span {
    font-size: 11px;
    padding-right: 9px;
  }
  .stats strong {
    font-size: 28px;
    margin: 12px 0 6px;
  }
  .stats small {
    font-size: 10px;
  }
  .panel {
    padding: 20px 17px;
    border-radius: 17px;
  }
  .dashboard-grid {
    gap: 18px;
  }
  .shortcuts a {
    padding: 18px 13px;
  }
  .task-row strong {
    font-size: 13px;
  }
  .task-row > button:last-child {
    min-height: 40px;
  }
  .task-row {
    gap: 10px;
  }
  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
  }
  .toolbar select {
    width: auto;
    flex: 1;
  }
  .toolbar input,
  .toolbar select {
    font-size: 16px;
    min-height: 44px;
  }
  .toolbar > span {
    font-size: 11px;
  }
  .table-scroll {
    margin-inline: -3px;
  }
  td,
  th {
    padding-inline: 12px;
  }
  .row-actions button {
    min-height: 40px;
  }
  .board {
    grid-template-columns: repeat(4, minmax(265px, 80vw));
    gap: 14px;
  }
  .board > section {
    padding: 16px;
  }
  .board article button {
    min-height: 36px;
  }
  .editor-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }
  .editor-dialog section {
    padding: 22px 20px;
    grid-template-columns: 1fr;
  }
  .editor-dialog header {
    padding: 21px 20px;
  }
  .editor-dialog footer {
    padding: 16px 20px max(16px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .editor-dialog footer button {
    flex: 1;
    min-height: 46px;
  }
  .editor-dialog input,
  .editor-dialog select,
  .editor-dialog textarea,
  .login input,
  .profile-form input,
  #aiForm textarea,
  #aiForm select,
  #aiConfig input,
  .setup input {
    font-size: 16px;
  }
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .permission-grid label {
    min-height: 40px;
  }
  .inline-form {
    display: flex;
  }
  .inline-form label {
    min-width: min(180px, 100%);
  }
  .inline-form button {
    min-height: 44px;
  }
  .calendar-controls {
    flex-wrap: wrap;
  }
  .calendar-controls button {
    min-height: 40px;
    font-size: 11px;
  }
  .month-day button {
    font-size: 10px;
    padding: 6px 3px;
    min-height: 30px;
  }
  .month-day,
  .calendar-blank {
    min-height: 105px;
  }
  .focus-panel #focusClock {
    font-size: 76px;
  }
  .focus-panel .actions button {
    flex: 1;
    min-height: 44px;
  }
  .finance-summary > div {
    grid-template-columns: 50px minmax(0, 1fr) 95px;
    font-size: 11px;
  }
  .learning-progress {
    grid-template-columns: 1fr;
  }
  .skill-tree strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .skill-tree li > div {
    gap: 9px;
  }
  .skill-tree button {
    min-height: 36px;
  }
  .r6-session {
    flex-wrap: wrap;
  }
  .r6-session button {
    min-height: 40px;
  }
  .login {
    display: block;
  }
  .login > section {
    padding: 9vh 28px;
    max-width: 470px;
  }
  .login > aside {
    display: none;
  }
  .login h1 {
    font-size: 39px;
  }
  .login small {
    line-height: 1.8;
  }
  .setup {
    margin: 24px 14px;
    padding: 25px;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    background: #ffffffef;
    backdrop-filter: blur(20px);
    border-top: 1px solid #e9e9f4;
    box-shadow: 0 -4px 24px #20233805;
    justify-content: space-around;
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    min-width: 58px;
    color: #8b8ba3;
    font-size: 10px;
    border-radius: 12px;
    padding: 5px 12px;
  }
  .mobile-nav a span {
    font-size: 19px;
    line-height: 1.2;
  }
  .mobile-nav a.active {
    color: #5855db;
    background: #f0efff;
    font-weight: 650;
  }
  #toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 360px) {
  main#mainContent {
    padding-inline: 13px;
  }
  .topbar {
    padding-inline: 13px;
  }
  .stats article {
    padding: 16px 13px;
  }
  .stats strong {
    font-size: 25px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .panel {
    padding: 18px 14px;
  }
  .mobile-nav a {
    min-width: 50px;
    padding-inline: 8px;
  }
  .topbar .primary {
    font-size: 11px;
    padding-inline: 9px;
  }
  .month-day button {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .nav-scrim {
    left: min(300px, 86vw);
  }
}
/* Original brand mark: smiling 好, shared by sidebar and sign-in. */
.brand i {
  width: 36px;
  height: 36px;
  background: transparent;
  box-shadow: none;
  border-radius: 11px;
  overflow: hidden;
  top: 0;
}
.brand i img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-symbol {
  width: 64px;
  height: 64px;
  background: transparent;
  box-shadow: none;
  border-radius: 19px;
  overflow: hidden;
}
.brand-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
