:root {
  --bg-primary: #fdfbf7;
  --bg-secondary: #fef0f0;
  --text-main: #4a4a4a;
  --text-muted: #8c8c8c;
  --accent-color: #ff9a9e;
  --accent-hover: #fecfef;
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 154, 158, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(254, 207, 239, 0.15) 0%, transparent 50%);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shell-header {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--header-shadow);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(255, 154, 158, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--accent-color);
}

.content-frame {
  flex-grow: 1;
  width: 100%;
  border: none;
  background-color: transparent;
}

/* Sidebar and Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 900;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -350px;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.active {
  transform: translateX(350px);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.5rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--accent-color);
}

/* Main Category Split */
.sidebar-tabs {
  display: flex;
  padding: 1rem;
  gap: 0.5rem;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: var(--bg-primary);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
  font-size: 0.95rem;
}

.tab-btn.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 154, 158, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Accordion */
.accordion {
  padding: 1rem;
}

.acc-section {
  margin-bottom: 0.5rem;
}

.acc-header {
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid rgba(255, 154, 158, 0.15);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  user-select: none;
}

.acc-header:hover {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
}

.acc-header svg {
  transition: transform 0.3s ease;
  color: var(--accent-color);
}

.acc-header.active {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.acc-header.active svg {
  transform: rotate(180deg);
}

.acc-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: white;
  border: 1px solid rgba(255, 154, 158, 0.15);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.acc-header.active + .acc-content {
  transition: max-height 0.5s ease-in-out;
}

.acc-content ul {
  list-style: none;
  padding: 0.5rem;
}

.acc-content li a {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
  line-height: 1.4;
}

.acc-content li a:hover, .acc-content li a.active {
  background: var(--bg-secondary);
  color: var(--text-main);
  font-weight: 600;
}

.menu-toggle {
  background: white;
  border: 1px solid rgba(255, 154, 158, 0.3);
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-main);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.menu-toggle:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(255, 154, 158, 0.15);
}

@media (max-width: 600px) {
  .shell-header {
    padding: 0.75rem 1rem;
  }
  
  .brand-title {
    font-size: 1.1rem;
  }
  
  .menu-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .sidebar {
    width: 300px;
  }
}
