/* authorization-center.css — 授权中心样式（ac- 前缀隔离） */

.ac-page { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* 指标卡区域 */
.ac-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.ac-metric__card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; text-align: center; transition: box-shadow .2s; }
.ac-metric__card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.ac-metric__value { font-size: 32px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.ac-metric__label { font-size: 13px; color: #64748b; margin-top: 6px; }
.ac-metric__icon { font-size: 24px; margin-bottom: 8px; }

/* 分类统计 */
.ac-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.ac-breakdown__group { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; }
.ac-breakdown__title { font-size: 14px; font-weight: 600; color: #475569; margin-bottom: 12px; }
.ac-breakdown__item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.ac-breakdown__label { font-size: 13px; color: #64748b; }
.ac-breakdown__count { font-size: 14px; font-weight: 600; color: #1e293b; }
.ac-breakdown__bar { height: 4px; border-radius: 2px; background: #e2e8f0; margin-top: 4px; overflow: hidden; }
.ac-breakdown__bar-fill { height: 100%; border-radius: 2px; transition: width .3s; }

/* 筛选器 */
.ac-filter { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ac-filter__select { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; background: #fff; cursor: pointer; }
.ac-filter__search { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }

/* 工具列表 */
.ac-tool-list { margin-bottom: 24px; }
.ac-tool-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: box-shadow .2s; }
.ac-tool-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ac-tool-card__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; }
.ac-tool-card__info { display: flex; align-items: center; gap: 12px; flex: 1; }
.ac-tool-card__name { font-size: 15px; font-weight: 600; color: #1e293b; }
.ac-tool-card__meta { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.ac-tool-card__actions { display: flex; align-items: center; gap: 8px; }
.ac-tool-card__detail { border-top: 1px solid #f1f5f9; padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.ac-tool-card__detail.open { max-height: 2000px; padding: 16px 20px; }

/* 仓库行 */
.ac-repo-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f8fafc; }
.ac-repo-row:last-child { border-bottom: none; }
.ac-repo-row__name { font-size: 13px; font-weight: 500; color: #334155; }
.ac-repo-row__meta { display: flex; align-items: center; gap: 8px; }
.ac-repo-row__time { font-size: 11px; color: #94a3b8; }

/* 徽标 */
.ac-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.ac-badge--read { background: #dbeafe; color: #1e40af; }
.ac-badge--write { background: #fef3c7; color: #92400e; }
.ac-badge--delete { background: #fee2e2; color: #991b1b; }
.ac-badge--export { background: #e0e7ff; color: #4338ca; }
.ac-badge--share { background: #f0fdf4; color: #166534; }
.ac-badge--granted { background: #dcfce7; color: #166534; }
.ac-badge--revoked { background: #fee2e2; color: #991b1b; }
.ac-badge--expired { background: #fef3c7; color: #92400e; }
.ac-badge--script { background: #e0f2fe; color: #0369a1; }
.ac-badge--workflow { background: #faf5ff; color: #7c3aed; }
.ac-badge--skill { background: #fff7ed; color: #c2410c; }
.ac-badge--packaged { background: #f0fdfa; color: #0d9488; }
.ac-badge--long_term { background: #f1f5f9; color: #475569; }
.ac-badge--session { background: #fef9c3; color: #854d0e; }
.ac-badge--single_time { background: #fce7f3; color: #9d174d; }

/* 撤销按钮 */
.ac-btn-revoke { padding: 4px 10px; border: 1px solid #fee2e2; border-radius: 6px; background: #fff; color: #dc2626; font-size: 12px; cursor: pointer; transition: background .2s; }
.ac-btn-revoke:hover { background: #fee2e2; }

/* 变更记录 */
.ac-changelog { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; }
.ac-changelog__title { font-size: 14px; font-weight: 600; color: #475569; margin-bottom: 12px; }
.ac-changelog__item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f8fafc; }
.ac-changelog__item:last-child { border-bottom: none; }
.ac-changelog__time { font-size: 11px; color: #94a3b8; min-width: 140px; }
.ac-changelog__desc { font-size: 13px; color: #334155; flex: 1; }

/* 平台开关 */
.ac-switches { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; }
.ac-switches__title { font-size: 14px; font-weight: 600; color: #475569; margin-bottom: 12px; }
.ac-switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f8fafc; }
.ac-switch-row:last-child { border-bottom: none; }
.ac-switch-row__info { flex: 1; }
.ac-switch-row__name { font-size: 14px; font-weight: 500; color: #1e293b; }
.ac-switch-row__desc { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.ac-switch-row__hint { font-size: 11px; color: #f59e0b; margin-top: 4px; }

/* 拨动开关 */
.ac-switch { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #cbd5e1; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.ac-switch.on { background: #22c55e; }
.ac-switch.disabled { opacity: .5; cursor: not-allowed; }
.ac-switch__thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ac-switch.on .ac-switch__thumb { transform: translateX(20px); }

/* 模态框 */
.ac-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.ac-modal { background: #fff; border-radius: 16px; padding: 24px; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.ac-modal__title { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 12px; }
.ac-modal__body { font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 20px; }
.ac-modal__warning { font-size: 12px; color: #dc2626; margin-top: 8px; }
.ac-modal__actions { display: flex; gap: 12px; justify-content: flex-end; }
.ac-modal__btn { padding: 8px 20px; border-radius: 8px; font-size: 13px; cursor: pointer; border: none; }
.ac-modal__btn--cancel { background: #f1f5f9; color: #475569; }
.ac-modal__btn--confirm { background: #dc2626; color: #fff; }
.ac-modal__btn--confirm:hover { background: #b91c1c; }

/* 空态/错误态 */
.ac-empty { text-align: center; padding: 40px 20px; color: #94a3b8; }
.ac-empty__icon { font-size: 40px; margin-bottom: 8px; }
.ac-empty__text { font-size: 14px; }
.ac-error { text-align: center; padding: 20px; color: #dc2626; }
.ac-error__retry { margin-top: 8px; padding: 6px 16px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }

/* 区域标题 */
.ac-section__title { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 12px; }

/* 响应式 */
@media (max-width: 768px) {
  .ac-metrics { grid-template-columns: repeat(2, 1fr); }
  .ac-breakdown { grid-template-columns: 1fr; }
  .ac-filter { flex-direction: column; align-items: stretch; }
}