:root{
  --bg:#0f0f10; --muted:#202226; --line:#2a2c31; --text:#e9eaee; --sub:#a9aeb8;
  --brand:#3b82f6; --ok:#22c55e; --warn:#f59e0b; --critical:#ef4444;
}
.drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);backdrop-filter:saturate(120%) blur(2px);
  opacity:0;transition:.18s ease;pointer-events:none;z-index:998;}
.drawer-overlay.show{opacity:1;pointer-events:auto;}
.drawer{position:fixed;inset:0 auto 0 0;width:min(380px,92vw);background:var(--bg);
  box-shadow:2px 0 20px rgba(0,0,0,.45);transform:translateX(-102%);transition:transform .2s ease-out;
  z-index:999;color:var(--text);display:flex;flex-direction:column;}
.drawer.open{transform:none;}
.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line);}
.drawer-header h2{margin:0;font-size:18px;letter-spacing:.5px;}
.icon-btn{background:transparent;color:var(--sub);border:0;font-size:18px;cursor:pointer;}
.drawer-section{padding:14px 16px;}
.drawer-section.border{border-top:1px solid var(--line);}
.user-row{display:flex;gap:12px;align-items:center;}
.avatar-lg{width:42px;height:42px;border-radius:50%;background:var(--muted);display:grid;place-items:center;font-size:20px;}
.user-email{font-weight:600;}
.user-plan{color:var(--sub);font-size:13px;}
.meter{margin:12px 0;}
.meter .label{display:flex;justify-content:space-between;font-size:13px;color:var(--sub);margin-bottom:6px;}
.meter .bar{height:8px;background:var(--muted);border-radius:999px;overflow:hidden;}
.meter .bar>div{height:100%;width:0;background:linear-gradient(90deg,var(--brand),#7aa5ff);transition:width .3s ease;}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.btn{background:var(--brand);color:#fff;border:0;padding:10px 12px;border-radius:10px;cursor:pointer;font-weight:600;font-size:14px;text-align:center;}
.btn.warn{background:var(--warn);color:#111;}
.btn.outline{background:transparent;border:1px solid var(--line);color:var(--text);}
.btn:disabled{opacity:.5;cursor:not-allowed;}
.drawer-footer{margin-top:auto;padding:12px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--sub);}

/* 強調版按鈕（給升級方案用） */
.btn.highlight{
  background: linear-gradient(90deg, var(--brand), var(--ok));
  color: #111;
  font-weight: 700;
  margin-top: 10px;
}

/* Pro 狀態下改成資訊樣式（JS 會切換 class） */
.btn.ghost{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

/* ============ 功能選單（新） ============ */
.menu-group {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;           /* 讓 <a> 外觀跟 <button> 一致 */
  transition: background-color .16s ease, transform .05s ease;
}

.menu-item .icon {
  font-size: 18px;
  margin-right: 10px;
  line-height: 1;
}

.menu-item .label {
  flex: 1;
}

.menu-item .badge {
  background: var(--critical);
  color: #fff;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 20px;
  height: 20px;
}

.menu-item:hover {
  background: rgba(255,255,255,0.06);
}

.menu-item:active {
  transform: translateY(1px);
}

.menu-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.menu-sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0 12px;
}

/* 讓 data-admin-only 的項目可被 JS 切換顯示用 */
[data-admin-only] {
  display: block;
}

