:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --text: #16202a;
  --muted: #687583;
  --line: #dfe5ea;
  --accent: #0b6bcb;
  --accent-hover: #095cae;
  --danger: #bd2c2c;
  --success-bg: #e8f7ee;
  --success-text: #18723a;
  --error-bg: #fff0f0;
  --error-text: #a12626;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 48px max(24px, calc((100vw - 1180px) / 2)); color: #fff; background: linear-gradient(118deg, #102a43 0%, #123f67 55%, #0b6bcb 100%); }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .16em; opacity: .68; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.04em; }
.subtitle { margin: 10px 0 0; color: rgba(255,255,255,.72); }
.upload { min-width: 360px; display: flex; align-items: end; gap: 10px; }
.hero-side { display: flex; min-width: 420px; flex-direction: column; align-items: flex-end; gap: 18px; }
.account-nav { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.78); font-size: 13px; }
.account-nav a, .account-nav button { border: 1px solid rgba(255,255,255,.25); border-radius: 7px; padding: 6px 10px; color: #fff; background: rgba(255,255,255,.08); text-decoration: none; cursor: pointer; }
.account-nav form { margin: 0; }
.upload label { flex: 1; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: rgba(255,255,255,.75); }
.upload input { width: 100%; padding: 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; color: #fff; background: rgba(255,255,255,.1); }
.upload input::file-selector-button { margin-right: 10px; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.upload button, .action-control { border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 650; cursor: pointer; text-decoration: none; }
.upload button { color: var(--accent); background: #fff; white-space: nowrap; }
main { width: 100%; max-width: 1180px; flex: 1; margin: 0 auto; padding: 36px 24px 64px; }
.site-footer { width: 100%; max-width: 1180px; display: flex; justify-content: space-between; gap: 16px; margin: 0 auto; padding: 18px 24px 24px; color: var(--muted); font-size: 12px; }
.app-version { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.notice { margin-bottom: 18px; border-radius: 10px; padding: 12px 15px; font-size: 14px; }
.notice.success { color: var(--success-text); background: var(--success-bg); }
.notice.error { color: var(--error-text); background: var(--error-bg); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 24px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.plugin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.plugin-card { display: flex; flex-direction: column; gap: 17px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(20, 39, 55, .04); }
.card-top { display: flex; gap: 12px; align-items: center; }
.plugin-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--accent); background: #eaf3fc; font-size: 20px; font-weight: 750; }
.identity { min-width: 0; flex: 1; }
.name-line { display: flex; align-items: center; gap: 8px; }
.name-line h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version { flex: 0 0 auto; border-radius: 999px; padding: 3px 7px; color: var(--accent); background: #eaf3fc; font-size: 11px; font-weight: 700; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.status-badge.published { color: var(--success-text); background: var(--success-bg); }
.status-badge.unpublished { color: var(--muted); background: #edf0f3; }
.plugin-id { margin: 3px 0 0; color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.description { min-height: 42px; margin: 0; color: #44515e; font-size: 14px; line-height: 1.5; }
.capabilities { display: flex; flex-wrap: wrap; gap: 6px; }
.capabilities span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
dl div { min-width: 0; }
dt { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.actions .action-control { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; white-space: nowrap; }
.actions .primary-action { flex: 1 1 130px; text-align: center; color: #fff; background: var(--accent); }
.actions .primary-action:hover { background: var(--accent-hover); }
.actions form { margin: 0; }
.actions .update-form { display: flex; flex: 1 1 100px; }
.actions .delete-form { display: flex; flex: 1 1 100px; }
.actions .update-action { width: 100%; color: #0d6754; background: #e4f7f1; }
.actions .version-action { flex: 1 1 100px; color: var(--accent); background: #eaf3fc; }
.actions .detail-action { flex: 1 1 100px; color: var(--text); background: #edf0f3; }
.actions .delete-action { flex: 1 1 100px; color: var(--danger); background: #fff0f0; }
.actions .status-action { color: #76510a; background: #fff4d6; }
.pricing-form { display: flex; flex-direction: column; gap: 11px; padding: 14px; border: 1px solid #d8e5f0; border-radius: 12px; background: #f7fbff; }
.pricing-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pricing-heading strong { font-size: 13px; }
.pricing-heading span { color: var(--muted); font-size: 10px; text-align: right; }
.pricing-fields { display: grid; grid-template-columns: .75fr 1.15fr 1fr auto; align-items: end; gap: 8px; }
.pricing-fields label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.pricing-fields select, .pricing-fields input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 8px; color: var(--text); background: var(--surface); }
.pricing-fields button { border: 0; border-radius: 7px; padding: 9px 10px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.version-dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 18px; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 28px 80px rgba(14, 35, 54, .3); }
.version-dialog::backdrop { background: rgba(10, 26, 40, .58); backdrop-filter: blur(2px); }
.dialog-header { display: flex; justify-content: space-between; gap: 24px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); }
.dialog-header h3 { margin: 3px 0 0; font-size: 22px; }
.dialog-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.dialog-close { width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 24px; line-height: 1; cursor: pointer; }
.detail-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.detail-dialog[open] > .dialog-header { flex: 0 0 auto; }
.version-table-wrap { max-height: calc(100vh - 190px); overflow: auto; padding: 0 26px 26px; }
.version-table { width: 100%; border-collapse: collapse; }
.version-table th, .version-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
.version-table th { position: sticky; top: 0; color: var(--muted); background: var(--surface); font-size: 12px; }
.version-table td:first-child, .version-table th:first-child { padding-left: 0; }
.version-table td:last-child, .version-table th:last-child { padding-right: 0; text-align: right; }
.version-table td small { display: block; margin-top: 3px; color: var(--muted); }
.version-state { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.version-state.published { color: var(--success-text); background: var(--success-bg); }
.version-state.selected { color: #76510a; background: #fff4d6; }
.version-state.history { color: var(--muted); background: #edf0f3; }
.publish-version { border: 1px solid #bdd8f1; border-radius: 7px; padding: 7px 10px; color: var(--accent); background: #f5faff; font-weight: 650; cursor: pointer; white-space: nowrap; }
.version-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.version-actions form { margin: 0; }
.delete-version { border: 1px solid #efb8b8; border-radius: 7px; padding: 7px 10px; color: var(--danger); background: #fff6f6; font-weight: 650; cursor: pointer; white-space: nowrap; }
.current-version-label { color: var(--success-text); font-size: 12px; font-weight: 700; }
.detail-dialog { width: min(920px, calc(100vw - 32px)); }
.dialog-plugin-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.detail-dialog-body { display: flex; min-height: 0; flex: 1 1 auto; max-height: none; flex-direction: column; gap: 22px; overflow: auto; padding: 24px 26px 28px; }
.detail-overview { display: flex; flex-direction: column; gap: 12px; }
.detail-title-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.detail-title-line > div { display: flex; align-items: center; gap: 8px; }
.detail-download-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.detail-description { margin: 0; color: #44515e; font-size: 14px; line-height: 1.65; }
.detail-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.detail-meta dd { white-space: normal; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-actions form { margin: 0; }
.detail-actions .action-control { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; }
.detail-primary-action { color: #fff; background: var(--accent); }
.detail-primary-action:hover { background: var(--accent-hover); }
.detail-status-action { color: #fff; background: var(--danger); }
.detail-publish-action { color: var(--success-text); background: var(--success-bg); }
.detail-record-action { color: var(--accent); background: #eaf3fc; }
.manifest-section, .review-section { display: flex; flex-direction: column; gap: 14px; }
.detail-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.detail-section-heading h4 { margin: 0; font-size: 17px; }
.detail-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.manifest-json { max-height: 300px; margin: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: #2c3b48; background: #f7f9fb; font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-summary { display: flex; align-items: baseline; gap: 8px; }
.review-summary strong { color: var(--accent); font-size: 20px; }
.review-summary span { color: var(--muted); font-size: 12px; }
.review-list { display: grid; gap: 10px; }
.review-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.review-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-rating { border-radius: 999px; padding: 3px 8px; color: #76510a; background: #fff4d6; font-size: 11px; font-weight: 700; }
.review-item p { margin: 9px 0; color: #44515e; font-size: 13px; line-height: 1.6; }
.review-item time { color: var(--muted); font-size: 11px; }
.detail-empty-state { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 30px 18px; border: 1px dashed #cbd4dc; border-radius: 12px; color: var(--muted); background: var(--surface-soft); text-align: center; }
.detail-empty-state strong { color: var(--text); }
.detail-empty-state span { font-size: 12px; }
.download-dialog { width: min(940px, calc(100vw - 32px)); }
.download-table { min-width: 720px; }
.download-table td:nth-child(4) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-empty-state { margin-top: 24px; }
.empty { padding: 72px 24px; border: 1px dashed #cbd4dc; border-radius: 18px; text-align: center; background: rgba(255,255,255,.55); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: var(--accent); background: #eaf3fc; font-size: 27px; }
.empty h3 { margin: 0; }
.empty p { margin: 7px 0 0; color: var(--muted); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(125deg, #102a43 0%, #123f67 48%, #eef4f9 48%, #f7f9fb 100%); }
.auth-page .site-footer { position: fixed; right: 0; bottom: 0; left: 0; color: rgba(255,255,255,.72); }
.login-shell { width: min(930px, 100%); display: grid; grid-template-columns: 1fr 1fr; padding: 0; border-radius: 24px; overflow: hidden; background: var(--surface); box-shadow: 0 30px 80px rgba(15, 35, 55, .22); }
.login-brand { display: flex; min-height: 560px; flex-direction: column; justify-content: flex-end; padding: 52px; color: #fff; background: linear-gradient(150deg, #102a43, #0b6bcb); }
.login-brand p:last-child { color: rgba(255,255,255,.72); line-height: 1.6; }
.login-card { display: flex; min-height: 560px; flex-direction: column; justify-content: center; gap: 20px; padding: 44px 52px; }
.login-card h2 { margin: 0; font-size: 26px; }
.login-heading { text-align: center; }
.eyebrow.dark { color: var(--accent); opacity: 1; }
.login-hint { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.login-form, .user-form { display: flex; flex-direction: column; gap: 15px; }
.login-form label, .user-form label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.login-form input, .user-form input, .user-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--text); background: var(--surface); outline: none; }
.login-form input:focus, .user-form input:focus, .user-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,107,203,.1); }
.captcha-row { display: grid; grid-template-columns: 1fr 150px; gap: 10px; }
.captcha-refresh { height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-soft); cursor: pointer; }
.captcha-refresh img { display: block; width: 150px; height: 52px; }
.primary-button { border: 0; border-radius: 9px; padding: 12px 16px; color: #fff; background: var(--accent); font-weight: 700; cursor: pointer; }
.primary-button:hover { background: var(--accent-hover); }
.login-method-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-soft); }
.login-method-tab { border: 0; border-radius: 8px; padding: 10px 12px; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.login-method-tab.active { color: var(--accent); background: var(--surface); box-shadow: 0 2px 8px rgba(15,35,55,.1); }
.login-method-panel[hidden] { display: none; }
.login-method-panel { min-height: 338px; }
#account-panel { padding-top: 7px; }
.qr-stage { position: relative; width: 236px; height: 236px; display: grid; place-items: center; margin: 0 auto; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 10px 28px rgba(15,35,55,.1); }
.qr-stage::after { content: ''; position: absolute; top: -2px; right: 18px; left: 18px; height: 2px; opacity: .65; background: linear-gradient(90deg, transparent, #18a87a, transparent); animation: qr-scan 2.2s ease-in-out infinite; }
.qr-stage img { width: 220px; height: 220px; }
.qr-loading { display: grid; place-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.qr-loading[hidden] { display: none; }
.qr-loading span { width: 34px; height: 34px; border: 3px solid #dce9e5; border-top-color: #18a87a; border-radius: 50%; animation: qr-spin .8s linear infinite; }
.qr-loading p, .qr-message, .qr-security-tip { margin: 0; }
.qr-message { margin-top: 14px; color: var(--text); text-align: center; font-size: 14px; font-weight: 600; }
.qr-refresh { display: block; margin: 10px auto 0; padding: 4px 8px; border: 0; color: var(--accent); background: transparent; cursor: pointer; }
.qr-security-tip { margin-top: 10px; color: var(--muted); text-align: center; font-size: 12px; }
@keyframes qr-spin { to { transform: rotate(360deg); } }
@keyframes qr-scan { 0%, 100% { top: 10px; opacity: 0; } 20%, 80% { opacity: .7; } 50% { top: 224px; opacity: .45; } }
.compact-header { display: flex; align-items: center; justify-content: space-between; padding: 28px max(24px, calc((100vw - 1180px) / 2)); color: #fff; background: #123f67; }
.compact-header h1 { font-size: 30px; }
.users-layout { display: grid; gap: 28px; }
.user-create-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.user-create-card h2 { margin-top: 0; }
.user-form { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: end; }
.user-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th, .user-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.user-table th { color: var(--muted); background: var(--surface-soft); }
.user-table tr:last-child td { border-bottom: 0; }
.table-action { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: var(--surface); cursor: pointer; }
.muted { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .hero { align-items: stretch; flex-direction: column; padding-top: 34px; }
  .hero-side { min-width: 0; align-items: stretch; }
  .upload { min-width: 0; align-items: stretch; flex-direction: column; }
  .section-heading { align-items: start; flex-direction: column; }
  .auth-page { background: #f4f6f8; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 210px; padding: 30px; }
  .login-card { padding: 30px; }
  .user-form { grid-template-columns: 1fr; }
  .version-table-wrap { padding: 0 18px 20px; }
  .dialog-header { padding: 20px 18px 16px; }
  .version-table:not(.download-table) th:nth-child(2),
  .version-table:not(.download-table) td:nth-child(2),
  .version-table:not(.download-table) th:nth-child(3),
  .version-table:not(.download-table) td:nth-child(3) { display: none; }
  .pricing-fields { grid-template-columns: 1fr; }
  .pricing-heading { align-items: flex-start; flex-direction: column; }
  .pricing-heading span { text-align: left; }
  .detail-dialog-body { padding: 20px 18px 22px; }
  .detail-title-line, .detail-section-heading { align-items: flex-start; flex-direction: column; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
}
