   :root {
      --bg: #f5f5f3;
      --bg2: #eeeeec;
      --title: #141414;
      --text: #1a1a1a;
      --sub: #707070;
      --sub-light: #9a9a9a;
      --card: #ffffff;
      --brand: #d4714e;
      --brand-light: rgba(212,113,78,0.12);
      --dot-inactive: #e0e0dd;
      --btn-main: #1c1c1e;
      --border: #d8d8d5;
      --color-red: #c94f4f;
      --color-green: #52825c;

      --font-body: system-ui, -apple-system, Inter, Roboto, "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", sans-serif;
      --font-title: Georgia, "Times New Roman", serif;
      --font-cn-title: "Noto Serif SC", Georgia, serif;
      --font-brand: Georgia, "Times New Roman", serif;

      --shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
      --shadow-lg: 0 16px 48px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
      --ui-radius: 20px;
      --panel-w: 360px;
    }

    body.intense-mode {
      --bg: #0f0a0a;
      --bg2: #150d0d;
      --card: #1a1111;
      --text: #fdf5f5;
      --sub: #8b8b8b;
      --border: #2e1c1c;
      --title: #ffffff;
      --color-red: #d94848;
      --color-green: #c9813a;
      --brand: #d6833c;
      --shadow: 0 8px 30px rgba(255,60,0,0.18);
    }

    body[data-lang="zh-CN"] { --font-cn-title: "Noto Serif SC", Georgia, serif; }
    body[data-lang="ja"] { --font-cn-title: "Noto Serif SC", Georgia, serif; }
    body[data-lang="ko"] { --font-cn-title: "Noto Serif SC", Georgia, serif; }

    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: var(--font-body);
      background-color: var(--bg);
      color: var(--text);
      min-height: 100vh;
      width: 100vw;
      display: flex;
      justify-content: center;
      align-items: center;
      overflow: hidden;
      position: relative;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns=''%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
      opacity: 0.025;
      pointer-events: none;
      z-index: 0;
    }

    body::after {
      content: '';
      position: fixed;
      top: 30%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 600px;
      height: 400px;
      background: radial-gradient(ellipse, rgba(212,113,78,0.06) 0%, transparent 70%);
      pointer-events: none;
      z-index: 0;
    }

    body.intense-mode::after {
      background: radial-gradient(ellipse, rgba(214,131,60,0.12) 0%, transparent 70%);
    }

    ::-webkit-scrollbar { width: 0px; }

    #panel-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0);
      backdrop-filter: blur(0px);
      z-index: 1500;
      pointer-events: none;
      transition: background 0.35s, backdrop-filter 0.35s;
    }
    #panel-backdrop.active {
      background: rgba(0,0,0,0.22);
      backdrop-filter: blur(2px);
      pointer-events: auto;
    }

    .container {
      width: 100%;
      max-width: 480px;
      display: flex;
      flex-direction: column;
      gap: 22px;
      padding: 40px 20px;
      position: relative;
      z-index: 10;
      max-height: 100vh;
      overflow-y: auto;
    }

    .main-card {
      width: 95%;
      max-width: 460px;
      max-height: 95vh;
      background: var(--card);
      border-radius: var(--ui-radius);
      box-shadow: var(--shadow-lg);
      overflow: hidden;
      position: relative;
      z-index: 10;
      display: none;
      flex-direction: column;
      border: 1px solid var(--border);
    }

    .claude-star {
      width: 34px;
      height: 34px;
      color: var(--brand);
      animation: star-breathe 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
      transform-origin: center;
      transition: color 0.3s;
      display: block;
      flex-shrink: 0;
      shape-rendering: geometricPrecision;
    }
    .claude-star.large { width: 48px; height: 48px; }
    .claude-star.small { width: 22px; height: 22px; }

    @keyframes star-breathe {
      0%, 100% { opacity: 0.85; transform: scale(1) rotate(0deg); }
      50% { opacity: 1; transform: scale(1.07) rotate(2deg); }
    }
    @keyframes star-think {
      0% { transform: rotate(0deg) scale(1); }
      25% { transform: rotate(15deg) scale(1.05); }
      50% { transform: rotate(0deg) scale(0.95); }
      75% { transform: rotate(-15deg) scale(1.05); }
      100% { transform: rotate(0deg) scale(1); }
    }
    @keyframes star-burst {
      0% { transform: scale(1); filter: brightness(1); }
      30% { transform: scale(1.4); filter: brightness(1.5); }
      60% { transform: scale(0.9); filter: brightness(1.2); }
      100% { transform: scale(1); filter: brightness(1); }
    }
    @keyframes star-spin-in {
      0% { opacity: 0; transform: scale(0.3) rotate(-180deg); }
      100% { opacity: 1; transform: scale(1) rotate(0deg); }
    }
    .claude-star.thinking { animation: star-think 1.5s ease-in-out infinite; }
    .claude-star.celebrating { animation: star-burst 0.6s ease-out; }

    .header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 6px;
    }
    .title {
      font-family: var(--font-brand);
      font-size: 26px;
      font-weight: 400;
      color: var(--title);
      letter-spacing: 0.02em;
    }

    .welcome { text-align: center; }
    .welcome h2 {
      font-family: var(--font-cn-title);
      font-size: 30px;
      font-weight: 400;
      margin-bottom: 6px;
      color: var(--title);
    }
    .welcome p { font-size: 14px; color: var(--sub); }

    .stats-card {
      background: var(--card);
      border-radius: 18px;
      padding: 18px;
      display: flex;
      justify-content: space-around;
      text-align: center;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      position: relative;
      overflow: hidden;
    }
    .stats-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, transparent, var(--brand), transparent);
      opacity: 0.5;
    }
    .stat-item .num {
      font-size: 22px;
      font-weight: 600;
      color: var(--title);
      font-family: var(--font-cn-title);
    }
    .stat-item .label { font-size: 11px; color: var(--sub-light); margin-top: 3px; }

    .chart-card {
      background: var(--card);
      border-radius: 18px;
      padding: 18px 18px 14px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
    }
    .chart-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
    }
    .chart-title { font-size: 13px; font-weight: 500; color: var(--sub); }
    .chart-legend {
      display: flex;
      gap: 12px;
      font-size: 11px;
      color: var(--sub-light);
    }
    .legend-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 4px;
      vertical-align: middle;
    }
    #accuracy-chart-svg {
      width: 100%;
      height: 70px;
      overflow: visible;
    }

    .btn-group { display: flex; flex-direction: column; gap: 10px; }
    .btn {
      padding: 15px;
      border-radius: 14px;
      font-size: 15px;
      font-weight: 500;
      border: none;
      cursor: pointer;
      transition: all 0.18s;
      text-align: center;
      font-family: var(--font-body);
      position: relative;
      overflow: hidden;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1.2;
    }
    .btn:active { transform: scale(0.97); }
    .btn-primary {
      background: var(--btn-main);
      color: #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    }
    .btn-primary:hover {
      background: #2c2c2e;
      box-shadow: 0 4px 12px rgba(0,0,0,0.24);
    }
    .btn-outline {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
    }
    .btn-outline:hover { background: var(--bg2); }

    .section { display: flex; flex-direction: column; gap: 10px; }
    .section-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--sub);
      letter-spacing: 0.03em;
    }
    .recent-item {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 13px;
      padding: 14px 16px;
      font-size: 14px;
      color: var(--text);
      cursor: pointer;
      transition: all 0.18s;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .recent-item:hover {
      background: var(--bg2);
      border-color: var(--brand);
      transform: translateX(2px);
    }
    .recent-item::before {
      content: '→';
      font-size: 12px;
      color: var(--brand);
      opacity: 0.7;
    }

    .calendar { text-align: center; }
    .calendar-title {
      font-size: 12px;
      color: var(--sub-light);
      margin-bottom: 12px;
    }
    .calendar-dots {
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--dot-inactive);
      transition: all 0.3s;
    }
    .dot.active {
      background: var(--brand);
      box-shadow: 0 0 0 2px var(--brand-light);
    }

    #toast-container {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 999999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
    }
    .toast {
      background: var(--color-red);
      color: white;
      padding: 12px 20px;
      border-radius: 12px;
      font-size: 14px;
      font-weight: 500;
      box-shadow: 0 8px 24px rgba(0,0,0,0.18);
      animation: toastIn 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
      opacity: 0;
      transform: translateX(120%);
      font-family: var(--font-body);
    }
    .toast.success { background: var(--color-green); }
    .toast.info { background: var(--btn-main); }
    @keyframes toastIn { to { opacity: 1; transform: translateX(0); } }
    .toast.fade-out { animation: toastOut 0.3s forwards; }
    @keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

    #global-loader {
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 99999;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: opacity 0.3s;
    }
    .loader-logo-wrap {
      position: relative;
      margin-bottom: 24px;
      transform: translateY(1px);
    }
    .loader-star {
      width: 52px;
      height: 52px;
      color: var(--brand);
      animation: star-think 1.8s ease-in-out infinite;
    }
    .loader-ring {
      position: absolute;
      inset: -10px;
      border-radius: 50%;
      border: 2px solid transparent;
      border-top-color: var(--brand);
      border-right-color: rgba(212,113,78,0.3);
      animation: loaderSpin 1.2s linear infinite;
    }
    @keyframes loaderSpin { 100% { transform: rotate(360deg); } }
    .loader-text {
      font-size: 13px;
      color: var(--sub);
      letter-spacing: 3px;
    }

    #auth-view {
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 10000;
      gap: 24px;
    }
    .auth-logo-wrap {
      display: flex;
      align-items: center;
      gap: 14px;
      animation: star-spin-in 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
      transform: translateY(1px);
    }
    .auth-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 36px 28px;
      text-align: center;
      width: 90%;
      max-width: 380px;
      box-shadow: var(--shadow-lg);
      animation: authCardIn 0.5s 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
    }
    @keyframes authCardIn {
      0% { opacity: 0; transform: translateY(20px) scale(0.97); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    .auth-tabs {
      display: flex;
      background: var(--bg);
      border-radius: 11px;
      margin-bottom: 20px;
      overflow: hidden;
      border: 1px solid var(--border);
    }
    .auth-tab {
      flex: 1;
      padding: 11px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      color: var(--sub);
      transition: all 0.2s;
      font-family: var(--font-body);
    }
    .auth-tab.active {
      background: var(--btn-main);
      color: #fff;
    }
    .auth-toggle {
      background: none;
      border: none;
      color: var(--sub-light);
      font-size: 13px;
      margin-top: 16px;
      cursor: pointer;
      text-decoration: underline;
      font-family: var(--font-body);
    }

    .lang-selector {
      display: flex;
      gap: 6px;
      justify-content: center;
      flex-wrap: wrap;
      margin-top: 4px;
    }
    .lang-btn {
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 12px;
      cursor: pointer;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--sub);
      transition: all 0.2s;
      font-family: var(--font-body);
    }
    .lang-btn.active {
      background: var(--brand);
      border-color: var(--brand);
      color: #fff;
      font-weight: 500;
    }
    .lang-btn:hover:not(.active) {
      border-color: var(--brand);
      color: var(--brand);
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea {
      width: 100%;
      padding: 14px 16px;
      border-radius: 11px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      margin-bottom: 12px;
      font-size: 15px;
      font-family: var(--font-body);
      outline: none;
      transition: all 0.2s;
    }
    input:focus,
    textarea:focus {
      border-color: var(--brand);
      background: var(--card);
      box-shadow: 0 0 0 3px rgba(212,113,78,0.1);
    }
    .set-label {
      display: block;
      font-size: 12px;
      font-weight: 500;
      color: var(--sub);
      margin-bottom: 7px;
      text-align: left;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
    }
    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background-color: var(--border);
      border-radius: 34px;
      transition: .3s;
    }
    .slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      border-radius: 50%;
      transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }
    input:checked + .slider { background-color: var(--brand); }
    input:checked + .slider:before { transform: translateX(20px); }

    .side-panel {
      position: fixed;
      top: 0;
      right: 0;
      width: 100%;
      max-width: var(--panel-w);
      height: 100%;
      background: var(--bg);
      border-left: 1px solid var(--border);
      z-index: 2000;
      padding: 32px 22px;
      transform: translateX(110%);
      transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      box-shadow: -4px 0 24px rgba(0,0,0,0.06);
    }
    .side-panel.open { transform: translateX(0); }
    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 22px;
      flex-shrink: 0;
    }
    .panel-header h2 {
      margin: 0;
      font-size: 19px;
      color: var(--title);
      font-family: var(--font-cn-title);
      font-weight: 400;
    }
    .close-btn {
      background: var(--bg2);
      border: none;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      color: var(--sub);
      cursor: pointer;
      font-weight: 300;
      transition: all 0.2s;
      font-family: var(--font-body);
    }
    .close-btn:hover { background: var(--border); color: var(--title); }

    .side-panel.left-side {
      right: auto;
      left: 0;
      border-left: none;
      border-right: 1px solid var(--border);
      transform: translateX(-110%);
      box-shadow: 4px 0 24px rgba(0,0,0,0.06);
    }
    .side-panel.left-side.open { transform: translateX(0); }

    .custom-select-wrapper { position: relative; width: 100%; margin-bottom: 12px; }
    .custom-select-display {
      width: 100%;
      padding: 14px 16px;
      border-radius: 11px;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid var(--border);
      user-select: none;
      transition: all 0.2s;
      font-family: var(--font-body);
    }
    .custom-select-display.open {
      border-color: var(--brand);
      background: var(--card);
      box-shadow: 0 0 0 3px rgba(212,113,78,0.1);
    }
    .custom-select-display::after {
      content: '▾';
      font-size: 12px;
      transition: transform 0.3s;
      color: var(--sub);
    }
    .custom-select-display.open::after { transform: rotate(180deg); }
    .custom-select-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      max-height: 220px;
      overflow-y: auto;
      z-index: 5000;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-8px);
      transition: all 0.2s;
      box-shadow: var(--shadow-lg);
    }
    .custom-select-dropdown.open {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    .custom-option {
      padding: 13px 16px;
      font-size: 14px;
      color: var(--text);
      cursor: pointer;
      border-bottom: 1px solid var(--bg);
      transition: all 0.15s;
      font-family: var(--font-body);
    }
    .custom-option:last-child { border-bottom: none; }
    .custom-option:hover { background: var(--bg2); color: var(--brand); }
    .custom-option.selected { color: var(--brand); font-weight: 500; background: var(--brand-light); }

    .cb-group-container {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 6px;
      margin-bottom: 12px;
      max-height: 200px;
      overflow-y: auto;
    }
    .cb-item {
      display: flex;
      align-items: center;
      padding: 10px;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.15s;
    }
    .cb-item:hover { background: var(--card); }
    .cb-item input { display: none; }
    .cb-checkmark {
      width: 18px;
      height: 18px;
      border: 1.5px solid var(--border);
      border-radius: 5px;
      margin-right: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: all 0.2s;
    }
    .cb-item input:checked + .cb-checkmark {
      background: var(--brand);
      border-color: var(--brand);
    }
    .cb-item input:checked + .cb-checkmark::after {
      content: '';
      width: 4px;
      height: 8px;
      border: solid white;
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
      margin-bottom: 2px;
    }
    .cb-label {
      font-size: 14px;
      color: var(--text);
      flex: 1;
      font-family: var(--font-body);
    }

    .progress-wrap {
      width: 100%;
      height: 3px;
      background: var(--bg);
      position: relative;
      flex-shrink: 0;
    }
    #progress-bar {
      height: 100%;
      width: 0%;
      background: var(--brand);
      transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
    }
    #mastery-bar {
      height: 100%;
      width: 0%;
      background: rgba(212,113,78,0.25);
      position: absolute;
      top: 0;
      left: 0;
      transition: width 0.6s;
    }

    .learn-nav {
      padding: 13px 18px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border);
      font-size: 12px;
      color: var(--sub);
      flex-shrink: 0;
      gap: 4px;
      font-family: var(--font-body);
    }
    .learn-nav span {
      cursor: pointer;
      padding: 5px 9px;
      border-radius: 8px;
      transition: all 0.15s;
      white-space: nowrap;
    }
    .learn-nav span:hover { background: var(--bg); color: var(--title); }
    #mode-toggle-btn { font-weight: 500; background: var(--bg); color: var(--title); }
    #home-return-btn { color: var(--title); font-weight: 500; }

    #streak-badge {
      font-weight: bold;
      background: transparent;
      color: var(--sub);
      transition: all 0.3s;
    }
    #streak-badge.hot {
      background: var(--brand);
      color: white;
      animation: streakPop 0.4s cubic-bezier(0.18,0.89,0.32,1.28);
    }
    @keyframes streakPop { 0%{transform:scale(0.6)} 100%{transform:scale(1)} }

    .quiz-box {
      padding: 28px 24px;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-height: 120px;
      flex-shrink: 0;
      position: relative;
    }
    .quiz-logo-mark {
      position: absolute;
      top: 10px;
      right: 14px;
      width: 16px;
      height: 16px;
      color: var(--brand);
      opacity: 0.2;
      pointer-events: none;
    }
    #q-cat {
      font-size: 11px;
      color: var(--brand);
      margin-bottom: 10px;
      font-weight: 500;
      letter-spacing: 1.5px;
      display: flex;
      justify-content: center;
      gap: 8px;
      align-items: center;
      font-family: var(--font-body);
    }
    #q-text {
      font-size: 28px;
      font-family: var(--font-cn-title);
      font-weight: 400;
      color: var(--title);
      line-height: 1.45;
      word-break: break-all;
      margin: 0;
      transition: opacity 0.2s;
    }
    #q-text.long { font-size: 20px; }

    .diff-badge {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 8px;
      font-weight: 500;
      letter-spacing: 0;
      border: 1px solid var(--border);
      color: var(--sub);
      font-family: var(--font-body);
    }

    .canvas-area {
      position: relative;
      width: 100%;
      height: 35vh;
      min-height: 250px;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      border-top: 1px solid var(--border);
      flex: 1;
    }
    .grid-bg {
      position: absolute;
      inset: 0;
      opacity: 0.25;
      background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
      background-size: 33.33% 33.33%;
      background-position: center;
      pointer-events: none;
    }
    .canvas-logo-mark {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      z-index: 2;
    }
    .canvas-logo-mark svg {
      width: 80px;
      height: 40px;
      color: var(--title);
      opacity: 0.04;
      transform: translateY(1px);
    }
    #board {
      position: relative;
      z-index: 5;
      touch-action: none;
      cursor: crosshair;
      display: block;
    }

    #intense-timer {
      position: absolute;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      font-size: 96px;
      font-family: var(--font-body);
      font-weight: 400;
      color: rgba(212,113,78,0.09);
      z-index: 1;
      pointer-events: none;
      font-variant-numeric: tabular-nums;
    }
    body.intense-mode #intense-timer { display: flex; }

    #ghost-hint {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-cn-title);
      color: var(--title);
      opacity: 0;
      pointer-events: none;
      z-index: 4;
      font-size: 42px;
    }
    #ghost-hint.show { opacity: 0.14; }

    .learn-footer {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1.6fr 1fr;
      gap: 7px;
      padding: 13px;
      flex-shrink: 0;
    }
    .learn-footer button {
      padding: 13px 0;
      background: var(--bg);
      border-radius: 13px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
      border: 1px solid transparent;
      cursor: pointer;
      transition: all 0.15s;
      outline: none;
      font-family: var(--font-body);
    }
    .learn-footer button:active { background: var(--border); transform: scale(0.95); }
    .learn-footer .btn-main {
      background: var(--btn-main) !important;
      color: #fff !important;
      box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    #ans-pop {
      position: fixed;
      right: 0;
      top: 50%;
      transform: translateY(-50%) translateX(110%);
      width: 285px;
      background: var(--card);
      border: 1px solid var(--border);
      padding: 24px;
      border-radius: 22px;
      text-align: center;
      opacity: 0;
      pointer-events: none;
      z-index: 200;
      box-shadow: -8px 0 40px rgba(0,0,0,0.1);
      transition: all 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }
    #ans-pop.active {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(-50%) translateX(-18px);
    }
    #ans-text {
      font-size: 34px;
      font-family: var(--font-cn-title);
      color: var(--title);
      display: block;
      margin-bottom: 10px;
      line-height: 1.2;
    }
    .ans-btn-group {
      display: flex;
      gap: 10px;
      margin-top: 18px;
    }
    .judge-btn {
      flex: 1;
      padding: 13px;
      border-radius: 12px;
      font-weight: 500;
      font-size: 14px;
      color: #fff;
      cursor: pointer;
      border: none;
      transition: transform 0.2s, box-shadow 0.2s;
      font-family: var(--font-body);
    }
    .judge-btn:active { transform: scale(0.95); }
    .btn-yes { background: var(--color-green); box-shadow: 0 2px 8px rgba(82,130,92,0.3); }
    .btn-no { background: var(--color-red); box-shadow: 0 2px 8px rgba(201,79,79,0.3); }
    #ans-pop.timeout-state .ans-btn-group { display: none; }
    #item-sr-stats {
      font-size: 11px;
      color: var(--sub);
      display: flex;
      justify-content: center;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 10px;
      font-family: var(--font-body);
    }
    .sr-stat-chip {
      border: 1px solid var(--border);
      padding: 3px 8px;
      border-radius: 6px;
    }

    @media (max-width: 1000px) {
      #ans-pop {
        right: 50%;
        transform: translate(50%, -50%) scale(0.96);
        width: 88%;
        box-shadow: 0 20px 60px rgba(0,0,0,0.14);
      }
      #ans-pop.active { transform: translate(50%, -50%) scale(1); }
    }

    #finish-overlay {
      position: absolute;
      inset: 0;
      background: var(--bg);
      z-index: 100;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 24px;
    }
    .finish-star-wrap {
      position: relative;
      margin-bottom: 8px;
      transform: translateY(1px);
    }
    .finish-star-wrap svg {
      animation: star-burst 0.8s 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
    }
    #finish-overlay h2 {
      font-family: var(--font-cn-title);
      font-size: 26px;
      font-weight: 400;
      color: var(--title);
      margin: 10px 0 4px;
    }
    .mastery-breakdown {
      width: 100%;
      max-width: 240px;
      margin: 10px auto 18px;
    }
    .mb-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
      font-size: 11px;
      font-family: var(--font-body);
    }
    .mb-label { width: 28px; text-align: right; color: var(--sub); }
    .mb-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
    .mb-fill { height: 100%; border-radius: 3px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
    .mb-count { width: 22px; font-weight: 500; color: var(--text); }
    #confetti-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 99; }

    #wrong-list {
      flex: 1;
      margin: 16px 0;
      font-size: 14px;
      overflow-y: auto;
      font-family: var(--font-body);
    }
    .wrong-item {
      padding: 14px 0;
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .w-ans {
      font-weight: 600;
      color: var(--title);
      font-size: 18px;
      font-family: var(--font-cn-title);
    }
    .w-q { color: var(--sub); font-size: 13px; }

    .rc-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 12px;
      margin-top: 16px;
    }
    .rc-item {
      background: var(--card);
      border-radius: 14px;
      border: 1px solid var(--border);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: box-shadow 0.2s;
    }
    .rc-item:hover { box-shadow: var(--shadow); }
    .rc-cover {
      width: 100%;
      height: 90px;
      object-fit: cover;
      border-bottom: 1px solid var(--bg);
    }
    .rc-cover-emoji {
      width: 100%;
      height: 90px;
      background: var(--bg2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      letter-spacing: 0.08em;
      color: var(--sub);
      border-bottom: 1px solid var(--border);
      font-family: var(--font-body);
    }
    .rc-info { padding: 13px; flex: 1; }
    .rc-title {
      font-weight: 500;
      font-size: 14px;
      margin: 0 0 4px 0;
      color: var(--title);
      font-family: var(--font-cn-title);
    }
    .rc-desc {
      font-size: 12px;
      color: var(--sub);
      margin: 0 0 8px 0;
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      font-family: var(--font-body);
    }
    .rc-author {
      font-size: 11px;
      color: var(--sub-light);
      margin-bottom: 12px;
      font-family: var(--font-body);
    }
    .rc-actions { display: flex; gap: 8px; padding: 0 13px 13px 13px; }

    .file-upload-wrapper {
      position: relative;
      overflow: hidden;
      width: 100%;
      margin-bottom: 12px;
    }
    .file-upload-wrapper input[type=file] {
      position: absolute;
      left: 0;
      top: 0;
      opacity: 0;
      cursor: pointer;
      height: 100%;
      width: 100%;
    }
    .file-upload-btn {
      width: 100%;
      padding: 13px;
      background: var(--bg);
      border: 1px dashed var(--border);
      border-radius: 11px;
      color: var(--sub);
      font-size: 13px;
      text-align: center;
      pointer-events: none;
      transition: all 0.2s;
      font-family: var(--font-body);
    }
    .file-upload-wrapper:hover .file-upload-btn {
      border-color: var(--brand);
      color: var(--brand);
    }

    .sr-module {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 15px;
      padding: 16px;
      margin-bottom: 16px;
    }
    .sr-module-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .sr-module-title {
      font-weight: 500;
      font-size: 14px;
      color: var(--title);
      font-family: var(--font-cn-title);
    }
    .sr-module-desc {
      font-size: 12px;
      color: var(--sub);
      margin: 0 0 12px 0;
      line-height: 1.5;
      font-family: var(--font-body);
    }

    .kbd-hints {
      display: flex;
      gap: 12px;
      justify-content: center;
      flex-wrap: wrap;
      padding: 8px 0;
      font-size: 11px;
      color: var(--sub-light);
      font-family: var(--font-body);
    }
    .kbd {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 2px 7px;
      font-family: monospace;
      font-size: 11px;
      color: var(--sub);
    }

    .divider { height: 1px; background: var(--border); margin: 20px 0; }

    #admin-panel {
      background: rgba(212,113,78,0.05);
      border: 1px dashed var(--brand);
      border-radius: 14px;
      padding: 18px;
      margin-bottom: 20px;
      display: none;
    }

    @keyframes viewFadeIn {
      from { opacity: 0; transform: scale(0.98); }
      to { opacity: 1; transform: scale(1); }
    }
    .view-enter { animation: viewFadeIn 0.3s ease-out both; }

    #fullscreen-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 48px;
      padding: 12px 18px;
      line-height: 1.2;
      min-width: 0;
      box-sizing: border-box;
      white-space: nowrap;
    }

    .auth-logo-wrap,
    .header,
    .loader-logo-wrap,
    .finish-star-wrap {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .auth-logo-wrap .claude-star,
    .header .claude-star,
    .loader-logo-wrap .claude-star,
    .finish-star-wrap .claude-star,
    .quiz-logo-mark,
    .canvas-logo-mark svg {
      transform: translateY(1px);
    }
