:root {
  --tifo-ink: #1a1b25;
  --tifo-gray: #6e7280;
  --tifo-red: #f5333f;
  --tifo-orange: #ff7a18;
  --tifo-pink: #e8406b;
  --tifo-brand-grad: linear-gradient(135deg, #ff7a18 0%, #f5333f 55%, #e8406b 100%);
  --tifo-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header,
.practice-panel-wrap,
.workspace-panel-wrap {
  font-family: Manrope, "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 88px;
  flex: 0 0 auto;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(26, 27, 37, 0.08), transparent) 1;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(26, 27, 37, 0.06);
  opacity: 0;
  transform: translateY(-24px);
}

.tifo-app.is-ready .site-header {
  animation: tifoHeaderIn 0.5s var(--tifo-ease-out) forwards;
}

@keyframes tifoHeaderIn {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}

.logo {
  display: block;
  flex-shrink: 0;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.2s var(--tifo-ease-out);
}

.logo:hover { transform: scale(1.02); }

.logo img {
  display: block;
  width: auto;
  height: 36px;
  user-select: none;
  -webkit-user-drag: none;
}

.glass-capsule {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 24px rgba(26, 27, 37, 0.08),
    0 1px 4px rgba(255, 122, 24, 0.06);
}

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 6px 10px;
  border-radius: 9999px;
}

.tab-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 90px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 16px rgba(255, 122, 24, 0.18),
    0 2px 8px rgba(26, 27, 37, 0.06);
  opacity: 0;
  pointer-events: none;
  will-change: transform, width;
}

.tifo-app.is-ready .tab-pill {
  opacity: 1;
  transition: width 0.42s var(--tifo-ease-out), transform 0.42s var(--tifo-ease-out), opacity 0.25s ease;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 28px;
  border-radius: 9999px;
  color: rgba(26, 27, 37, 0.7);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(8px);
  transition: color 0.2s, background-color 0.2s;
}

.tifo-app.is-ready .nav-item {
  animation: tifoNavIn 0.4s var(--tifo-ease-out) forwards;
}

.tifo-app.is-ready .nav-item:nth-of-type(1) { animation-delay: 0.1s; }
.tifo-app.is-ready .nav-item:nth-of-type(2) { animation-delay: 0.16s; }
.tifo-app.is-ready .nav-item:nth-of-type(3) { animation-delay: 0.22s; }
.tifo-app.is-ready .nav-item:nth-of-type(4) { animation-delay: 0.28s; }
.tifo-app.is-ready .nav-item:nth-of-type(5) { animation-delay: 0.34s; }

@keyframes tifoNavIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-item-motion {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s var(--tifo-ease-out);
}

.nav-item:hover:not(.is-active) {
  color: var(--tifo-red);
  background: rgba(255, 122, 24, 0.08);
}

.nav-item:active .nav-item-motion { transform: scale(0.97); }

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}

.nav-item.is-active { color: var(--tifo-ink); }

.nav-item.is-active .nav-label {
  color: transparent;
  background-image: var(--tifo-brand-grad);
  background-clip: text;
  -webkit-background-clip: text;
}

.nav-item.is-active .nav-icon {
  color: var(--tifo-red);
  fill: none;
  stroke: currentColor;
}

.nav-item[hidden] { display: none !important; }

.site-header button:focus-visible,
.site-header a:focus-visible,
.practice-panel-wrap button:focus-visible {
  outline: 3px solid rgba(245, 51, 63, 0.22);
  outline-offset: 3px;
}

.site-header .user-pill {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: box-shadow 250ms, transform 0.25s var(--tifo-ease-out);
}

.site-header .user-pill:hover {
  transform: scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 32px rgba(255, 122, 24, 0.12);
}

.site-header .user-team {
  max-width: 140px;
  overflow: hidden;
  color: var(--tifo-ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header .user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 8px;
  overflow: hidden;
  border-radius: 10px;
  color: #fff;
  background: var(--tifo-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.site-header .user-avatar.has-photo {
  background: transparent;
  box-shadow: none;
}

.site-header .user-avatar.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.28);
}

.site-header .user-avatar.is-uploading {
  opacity: 0.6;
  pointer-events: none;
}

.site-header .user-avatar input[type="file"] { display: none; }

.practice-panel-wrap {
  position: fixed;
  top: 100px;
  left: 50%;
  z-index: 60;
  width: 920px;
  max-width: calc(100vw - 48px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  transform-origin: 50% 50%;
  transition: opacity 0.2s ease, transform 0.28s var(--tifo-ease-out), visibility 0.2s;
  will-change: transform, opacity;
}

.practice-panel-wrap::before {
  content: "";
  position: absolute;
  top: -24px;
  right: 0;
  left: 0;
  height: 24px;
}

.practice-panel-wrap.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.96));
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 24px 64px rgba(26, 27, 37, 0.12),
    0 4px 16px rgba(26, 27, 37, 0.06),
    0 2px 24px rgba(255, 122, 24, 0.1);
}

.practice-panel {
  position: relative;
  padding: 36px 40px;
  overflow: visible;
  border-radius: 28px;
}

.panel-glow-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 120px;
  height: 3px;
  border-radius: 999px;
  background: var(--tifo-brand-grad);
  opacity: 0.8;
  filter: blur(1px);
  transform: translateX(-50%);
  pointer-events: none;
}

.panel-sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 160px;
  border-radius: 28px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 60%);
  pointer-events: none;
}

.panel-grid-top {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.panel-col { opacity: 1; }

.practice-panel-wrap.is-open .panel-col {
  animation: tifoPanelIn 0.3s var(--tifo-ease-out) both;
}

.practice-panel-wrap.is-open .panel-grid-top .panel-col:nth-child(2) { animation-delay: 0.04s; }
.practice-panel-wrap.is-open .panel-grid-top .panel-col:nth-child(3) { animation-delay: 0.08s; }
.practice-panel-wrap.is-open .panel-grid-bottom .panel-col:nth-child(1) { animation-delay: 0.12s; }
.practice-panel-wrap.is-open .panel-grid-bottom .panel-col:nth-child(2) { animation-delay: 0.16s; }

@keyframes tifoPanelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--tifo-ink);
  font-size: 19px;
  font-weight: 700;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: var(--tifo-brand-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 12px rgba(255, 90, 40, 0.35);
}

.brand-icon.is-lg { width: 48px; height: 48px; border-radius: 16px; }
.brand-icon.is-md { width: 40px; height: 40px; border-radius: 13px; }

.sub-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-btn,
.wide-btn {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(26, 27, 37, 0.06);
  color: var(--tifo-ink);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s var(--tifo-ease-out);
}

.sub-btn {
  height: 54px;
  gap: 12px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
}

.wide-btn {
  height: 72px;
  gap: 16px;
  padding: 0 24px;
  border-radius: 18px;
  font-size: 19px;
  font-weight: 700;
}

.sub-btn:hover,
.wide-btn:hover {
  border-color: rgba(255, 90, 40, 0.25);
  background: rgba(255, 122, 24, 0.08);
  transform: translateY(-1px);
}

.wide-btn:hover { box-shadow: 0 12px 32px rgba(255, 122, 24, 0.15); }

.sub-btn svg,
.sub-btn > i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: rgba(26, 27, 37, 0.6);
  font-size: 20px;
  line-height: 20px;
  transition: color 0.2s;
}

.sub-btn .is-accent,
.sub-btn:hover svg,
.sub-btn:hover > i { color: var(--tifo-red); }

.brand-icon > i {
  font-size: 22px;
  line-height: 1;
}

.panel-divider {
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(90deg, rgba(26, 27, 37, 0.07), rgba(26, 27, 37, 0.07) 60%, transparent);
}

.panel-grid-bottom {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.workspace-panel-wrap {
  position: fixed;
  top: 100px;
  left: 50%;
  z-index: 61;
  width: 460px;
  max-width: calc(100vw - 48px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
  transform-origin: 50% 0;
  transition: opacity 0.18s ease, transform 0.26s var(--tifo-ease-out), visibility 0.18s;
}

.workspace-panel-wrap::before {
  content: "";
  position: absolute;
  top: -24px;
  right: 0;
  left: 0;
  height: 24px;
}

.workspace-panel-wrap.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.workspace-panel {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border-radius: 24px;
}

.workspace-panel-options {
  position: relative;
  display: grid;
  gap: 10px;
}

.workspace-panel-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid rgba(26, 27, 37, 0.06);
  border-radius: 18px;
  color: var(--tifo-ink);
  background: #fff;
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s var(--tifo-ease-out);
}

.workspace-panel-option:hover {
  border-color: rgba(255, 90, 40, 0.24);
  background: rgba(255, 122, 24, 0.07);
  box-shadow: 0 10px 28px rgba(255, 122, 24, 0.1);
  transform: translateY(-1px);
}

.workspace-panel-option.is-active {
  border-color: rgba(245, 51, 63, 0.2);
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.09), rgba(232, 64, 107, 0.05));
}

.workspace-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fff;
  background: var(--tifo-brand-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 5px 14px rgba(255, 90, 40, 0.24);
}

.workspace-option-icon i { font-size: 21px; }

.workspace-option-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.workspace-option-copy strong {
  font-size: 15px;
  font-weight: 800;
}

.workspace-option-copy small {
  overflow: hidden;
  color: var(--tifo-gray);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-option-arrow {
  color: rgba(26, 27, 37, 0.3);
  font-size: 17px;
  transition: color 0.2s, transform 0.2s var(--tifo-ease-out);
}

.workspace-panel-option:hover .workspace-option-arrow,
.workspace-panel-option.is-active .workspace-option-arrow {
  color: var(--tifo-red);
  transform: translateX(2px);
}

.workspace-panel-option:focus-visible {
  outline: 3px solid rgba(245, 51, 63, 0.22);
  outline-offset: 2px;
}

.sticky-subnav { top: 88px; }

@media (max-width: 1100px) {
  .header-inner { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 900px) {
  .panel-grid-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .site-header .user-team { display: none; }
  .nav-item { padding-right: 14px; padding-left: 14px; font-size: 15px; }
  .nav-item .nav-label { display: none; }
}

@media (max-width: 520px) {
  .header-inner { padding-right: 12px; padding-left: 12px; }
  .logo img { height: 28px; }
  .main-nav { height: 50px; padding: 4px 6px; }
  .nav-item { height: 42px; padding-right: 6px; padding-left: 6px; }
  .site-header .user-pill { height: 42px; padding: 4px 6px; }
  .site-header .user-avatar { width: 30px; height: 30px; margin-left: 0; }
  .workspace-panel-wrap {
    top: 100px;
    width: calc(100vw - 24px);
    max-width: none;
  }
  .workspace-panel { padding: 16px; border-radius: 20px; }
  .workspace-panel-option { min-height: 70px; padding: 10px 12px; }
  .practice-panel-wrap {
    top: 100px;
    width: calc(100vw - 24px);
    max-width: none;
  }
  .practice-panel {
    max-height: calc(100dvh - 112px);
    padding: 22px 20px;
    overflow-y: auto;
    border-radius: 22px;
  }
  .panel-grid-top,
  .panel-grid-bottom { grid-template-columns: 1fr; gap: 20px; }
  .panel-divider { margin: 20px 0; }
  .panel-head { margin-bottom: 12px; }
  .brand-icon.is-lg { width: 42px; height: 42px; border-radius: 14px; }
  .sub-btn { height: 48px; border-radius: 14px; }
  .wide-btn { height: 58px; border-radius: 15px; font-size: 17px; }
  .sticky-subnav { top: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .tifo-app.is-ready .site-header,
  .nav-item,
  .tifo-app.is-ready .nav-item,
  .tab-pill,
  .practice-panel-wrap,
  .workspace-panel-wrap,
  .practice-panel-wrap.is-open .panel-col {
    animation: none !important;
    transition: none !important;
  }

  .site-header,
  .nav-item,
  .tab-pill { opacity: 1; transform: none; }
}
