:root {
  --ink: #17202a;
  --muted: #687582;
  --line: #e4e8ec;
  --paper: #f7f9fb;
  --white: #fff;
  --blue: #2764e7;
  --blue-dark: #1748b8;
  --green: #0b8f65;
  --shadow: 0 18px 45px rgba(30, 50, 75, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.65 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.market-header { height: 72px; padding: 0 clamp(20px, 5vw, 80px); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; }
.brand > a { color: var(--muted); font-size: 23px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 9px; font-size: 20px; font-weight: 800; }
.header-actions { color: var(--muted); }
.header-actions a:hover { color: var(--blue); }
.market-shell, .detail-shell, .admin-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 250px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }
h1, h2, p { margin-top: 0; }
.hero h1, .admin-intro h1 { max-width: 620px; margin: 10px 0 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: 0; }
.hero p, .admin-intro p { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.hero-stat { min-width: 140px; padding-left: 28px; border-left: 1px solid var(--line); }
.hero-stat strong { display: block; font-size: 38px; line-height: 1.1; }
.hero-stat span { color: var(--muted); }
.market-toolbar { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.search-box { position: relative; width: min(380px, 100%); }
.market-toolbar input { width: 100%; padding: 11px 40px 11px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; outline: none; }
.clear-search { position: absolute; top: 50%; right: 9px; width: 24px; height: 24px; transform: translateY(-50%); border: 0; border-radius: 50%; color: var(--muted); background: #eef1f5; cursor: pointer; line-height: 20px; }
.clear-search:hover { color: var(--ink); background: #e2e7ee; }
.market-toolbar input:focus, input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 100, 231, .1); }
.filters { display: flex; gap: 7px; }
.filter { border: 0; background: transparent; padding: 8px 13px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.filter.active { color: var(--blue); background: #eaf0ff; font-weight: 700; }
.filter-summary { padding-top: 13px; color: var(--muted); font-size: 12px; text-align: right; }
.plugin-grid { padding: 30px 0 60px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.plugin-card { min-height: 284px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plugin-card.is-hidden, .empty.is-hidden { display: none !important; }
.plugin-card:hover { border-color: #b9c9ef; transform: translateY(-2px); transition: .18s ease; }
.plugin-top, .meta, .card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plugin-icon { width: 58px; height: 58px; overflow: hidden; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: #edf2ff; font-size: 26px; font-weight: 800; }
.plugin-icon img { width: 70%; height: 70%; object-fit: contain; }
.plugin-icon.large { width: 86px; height: 86px; border-radius: 18px; flex: 0 0 86px; }
.tag { padding: 4px 9px; border-radius: 999px; color: var(--green); background: #e4f7f0; font-size: 12px; }
.plugin-card h2 { margin: 21px 0 6px; font-size: 19px; }
.plugin-card p { min-height: 52px; margin-bottom: 16px; color: var(--muted); }
.plugin-card p a,
.detail-heading p a,
.detail-content a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.plugin-card p a:hover,
.detail-heading p a:hover,
.detail-content a:hover {
  color: var(--blue-dark);
  text-decoration-thickness: 2px;
}
.meta { margin-top: auto; padding: 12px 0 18px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.button { border: 0; border-radius: 6px; padding: 9px 15px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.subtle { color: var(--ink); background: #f0f3f6; }
.button.subtle:hover { background: #e5eaf0; }
.empty { padding: 60px; text-align: center; color: var(--muted); }
.detail-shell { padding: 62px 0; }
.detail-heading { display: flex; align-items: center; gap: 24px; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.detail-heading h1 { margin: 5px 0; font-size: 34px; }
.detail-heading p { margin: 0; color: var(--muted); }
.detail-cta { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.detail-cta strong { font-size: 20px; }
.detail-columns { display: grid; grid-template-columns: 1fr 300px; gap: 55px; padding-top: 36px; }
.detail-content h2, .detail-side h2 { font-size: 20px; }
.detail-content p { color: #4f5d69; }
.detail-side { height: fit-content; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.detail-side div { padding: 13px 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.detail-side div:last-child { border-bottom: 0; }
.detail-side span { color: var(--muted); }
.admin-shell { padding: 48px 0 70px; }
.admin-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.admin-intro h1 { font-size: 34px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 22px; }
.admin-form, .admin-list, .auth-card { padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.admin-form h2, .admin-list h2 { margin-bottom: 22px; }
.admin-list h2 span { color: var(--muted); font-size: 13px; font-weight: 400; }
label { display: block; margin-bottom: 14px; color: #4d5a66; font-weight: 600; }
label input, label select, label textarea { width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; color: var(--ink); }
label textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .button { width: 100%; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row input { width: 16px; height: 16px; margin: 0; }
.license-panel { margin-top: 24px; padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.license-panel-head { margin-bottom: 20px; }
.license-panel-head h2 { margin: 6px 0; }
.license-panel-head p { margin: 0; color: var(--muted); }
.license-form { padding: 0; border: 0; box-shadow: none; }
.license-form small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.license-action { display: flex; align-items: end; }
.license-action .button { margin: 0; }
.license-table { margin-top: 10px; border-top: 1px solid var(--line); }
.license-table-head, .license-row { display: grid; grid-template-columns: 1fr 1.2fr 1.4fr 1.4fr 45px; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.license-table-head { color: var(--muted); font-size: 12px; }
.license-row { font-size: 13px; }
.license-key { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.status-on { color: var(--green); }
.status-pending { color: #a36a00; }
.status-off { color: #b24747; }
.license-time { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.license-actions, .inline-license-form { display: flex; align-items: center; gap: 6px; }
.inline-license-form input { width: 132px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); font-size: 11px; }
.license-empty { padding: 24px 0; color: var(--muted); text-align: center; }
.admin-plugin { min-height: 60px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.admin-plugin small { display: block; margin-top: 2px; color: var(--muted); }
.icon-button { border: 0; background: transparent; color: #d64c4c; font-size: 23px; cursor: pointer; }
.notice { width: min(700px, calc(100% - 40px)); margin: 24px auto; padding: 13px 16px; border-radius: 7px; background: #eaf0ff; color: var(--blue-dark); }
.notice.error { color: #a52a2a; background: #ffeded; }
.notice.success { width: 100%; color: var(--green); background: #e4f7f0; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(390px, 100%); }
.auth-card h1 { margin: 15px 0 3px; font-size: 25px; }
.auth-card p { color: var(--muted); }
.auth-card .button { width: 100%; }
.admin-page { background: #f4f6f9; }
.admin-topbar { height: 68px; padding: 0 28px; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.admin-top-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.admin-top-actions a:hover { color: var(--blue); }
.admin-host { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue-dark); background: #f6f8ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.admin-app { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.admin-sidebar { padding: 28px 14px 20px; background: #1d2633; color: #d7e0eb; display: flex; flex-direction: column; }
.sidebar-caption { padding: 0 13px 12px; color: #8292a6; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a { min-height: 43px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border-radius: 6px; color: #b9c5d3; }
.admin-nav a:hover { color: #fff; background: #273444; }
.admin-nav a.active { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(39, 100, 231, .2); }
.admin-nav b { margin-left: auto; color: #9eacbc; font-size: 12px; font-weight: 600; }
.admin-nav a.active b { color: #fff; }
.nav-icon { width: 20px; color: currentColor; font-size: 18px; line-height: 1; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid #303c4b; color: #aebaca; }
.sidebar-footer small { display: block; margin-top: 5px; color: #7f8d9e; line-height: 1.5; }
.sidebar-status { font-size: 12px; }
.sidebar-status span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #31c58d; }
.admin-main { min-width: 0; padding: 38px clamp(22px, 4vw, 52px) 64px; }
.workspace-heading { min-height: 78px; margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.workspace-heading h1 { margin: 6px 0 5px; font-size: 31px; line-height: 1.2; }
.workspace-heading p { margin: 0; color: var(--muted); }
.stat-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card, .workspace-panel { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(30, 50, 75, .05); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 7px 0 2px; color: var(--ink); font-size: 30px; line-height: 1.15; }
.stat-card small { font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; }
.panel-heading { min-height: 44px; margin-bottom: 15px; display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.text-link { color: var(--blue); font-size: 13px; font-weight: 700; white-space: nowrap; }
.recent-plugin { min-height: 63px; padding: 10px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.recent-plugin-main, .admin-plugin-info { min-width: 0; flex: 1; }
.recent-plugin-main strong, .admin-plugin-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-plugin-main small, .admin-plugin-info small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.plugin-icon.small { width: 38px; height: 38px; border-radius: 9px; font-size: 16px; flex: 0 0 38px; }
.plugin-icon.mini { width: 34px; height: 34px; border-radius: 8px; font-size: 14px; flex: 0 0 34px; }
.status-pill { padding: 3px 7px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.status-pill.on { color: var(--green); background: #e4f7f0; }
.status-pill.off { color: #9a5c27; background: #fff2df; }
.icon-link { width: 28px; color: var(--muted); font-size: 18px; text-align: center; }
.icon-link:hover { color: var(--blue); }
.quick-panel { display: flex; flex-direction: column; }
.quick-action { min-height: 59px; padding: 10px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.quick-action > span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--blue); background: #edf2ff; border-radius: 7px; font-size: 18px; }
.quick-action strong, .quick-action small { display: block; }
.quick-action small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.plugin-admin-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(350px, .95fr); gap: 18px; align-items: start; }
.plugin-editor { min-width: 0; }
.catalog-panel { min-width: 0; }
.clean-form { padding: 0; border: 0; box-shadow: none; }
.clean-form .button { width: auto; margin-top: 0; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.count-badge { display: inline-grid; min-width: 21px; height: 21px; margin-left: 4px; padding: 0 5px; place-items: center; border-radius: 5px; color: var(--blue); background: #edf2ff; font-size: 11px; vertical-align: 2px; }
.catalog-tools { margin-bottom: 12px; }
.catalog-tools input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; outline: none; }
.admin-plugin-list { max-height: 620px; overflow: auto; }
.admin-plugin-row { min-height: 59px; padding: 10px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.admin-plugin-row[hidden] { display: none; }
.tiny-button { padding: 6px 9px; font-size: 12px; }
.admin-plugin-row .icon-button { width: 20px; padding: 0; font-size: 20px; }
.license-workspace { max-width: 1080px; }
.license-form { max-width: 820px; }
.license-form .license-action { display: flex; align-items: end; }
.license-form .license-action .button { margin: 0; }
.table-heading { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.table-scroll { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
.admin-data-table { width: 100%; min-width: 820px; border-collapse: collapse; color: var(--ink); font-size: 13px; }
.admin-data-table th { padding: 12px 10px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.admin-data-table td { min-height: 58px; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.admin-data-table tbody tr:hover { background: #fbfcff; }
.admin-data-table td:first-child, .admin-data-table th:first-child { padding-left: 0; }
.admin-data-table td:last-child, .admin-data-table th:last-child { padding-right: 0; }
.admin-data-table .license-empty { padding: 28px 10px; color: var(--muted); text-align: center; }
.admin-data-table .license-actions { min-width: 180px; white-space: normal; }
.admin-data-table .inline-license-form { justify-content: flex-start; flex-wrap: wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1080px; }
.settings-panel h2 { margin: 0 0 14px; font-size: 18px; }
.setting-row { min-height: 47px; padding: 11px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.setting-row span { color: var(--muted); }
.setting-row strong, .setting-row a { color: var(--ink); font-size: 13px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.setting-row a { color: var(--blue); }
.admin-main > .notice { width: 100%; margin: 0 0 20px; }
@media (max-width: 760px) {
  .hero, .market-toolbar, .detail-heading, .admin-intro { align-items: flex-start; flex-direction: column; }
  .hero { padding: 42px 0; }
  .hero-stat { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); width: 100%; }
  .plugin-grid, .detail-columns, .admin-layout { grid-template-columns: 1fr; }
  .detail-cta { margin-left: 0; }
  .market-toolbar input { width: 100%; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .license-table-head { display: none; }
  .license-row { grid-template-columns: 1fr 1fr 30px; }
  .license-row span:nth-child(3), .license-row span:nth-child(4) { grid-column: span 1; }
  .admin-topbar { height: auto; min-height: 64px; padding: 13px 18px; gap: 12px; }
  .admin-top-actions { gap: 10px; font-size: 12px; }
  .admin-host { display: none; }
  .admin-app { display: block; }
  .admin-sidebar { padding: 10px; }
  .sidebar-caption, .sidebar-footer { display: none; }
  .admin-nav { display: flex; overflow-x: auto; gap: 5px; }
  .admin-nav a { min-width: max-content; padding: 0 11px; }
  .admin-nav b { display: none; }
  .admin-main { padding: 26px 16px 45px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .workspace-heading .button { width: 100%; }
  .stat-grid, .dashboard-grid, .plugin-admin-layout, .settings-grid { grid-template-columns: 1fr; }
  .stat-card strong { font-size: 26px; }
  .admin-plugin-row { gap: 7px; }
  .admin-plugin-row .status-pill { display: none; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .setting-row strong, .setting-row a { text-align: left; }
}
