:root {
  color-scheme: light;
  --ink: #1b233a;
  --muted: #5f6883;
  --border: #e2e6f1;
  --primary: #4e49c8;
  --primary-dark: #403bab;
  --surface: #fff;
  --bg: #f7f8fc;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #665ce5; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { width: 1.15em; height: 1.15em; display: block; }
[data-icon] { display: inline-grid; place-items: center; flex-shrink: 0; }
.shell { width: min(1140px, calc(100% - 72px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.bar-inner { min-height: 74px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.brand { display: flex; gap: 11px; align-items: center; font-size: 1.06rem; font-weight: 750; white-space: nowrap; }
.brand-icon { width: 37px; height: 37px; border-radius: 11px; color: #fff; background: linear-gradient(140deg, #7469ee, #4d47c8); }
.header-actions { display: flex; gap: 11px; align-items: center; }
.button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; font-weight: 675; white-space: nowrap; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 2px 5px #312e8133; }
.button-primary:hover { background: var(--primary-dark); }
.button-plain { color: var(--muted); background: transparent; }
.button-plain:hover, .button-plain[aria-pressed="true"] { color: var(--primary); background: #eeeefd; }
.button-secondary { background: #fff; border-color: var(--border); color: var(--ink); }
.button-secondary:hover { color: var(--primary); border-color: #bcb6f0; }
.button-danger { color: #fff; background: #b32436; }
.button-danger:hover { background: #981b2c; }
.button:disabled { opacity: .6; cursor: wait; }
.hero { position: relative; margin-top: 34px; min-height: 270px; overflow: hidden; isolation: isolate; border: 1px solid #e1defa; border-radius: 24px; background: linear-gradient(111deg, #eeedff 0%, #eef0ff 55%, #e9eaff 100%); display: flex; align-items: center; }
.hero-copy { padding: 34px 44px; position: relative; width: min(100%, 580px); }
.hero h1 { margin: 0; color: #20234b; font-size: clamp(2rem, 4vw, 2.95rem); letter-spacing: -.05em; line-height: 1.2; }
.hero p { margin: 14px 0 25px; color: #555c7d; line-height: 1.55; }
.searchbox { display: flex; gap: 12px; align-items: center; border: 1px solid #dfdff3; padding: 0 13px; max-width: 437px; border-radius: 11px; color: #5f6390; background: #fff; box-shadow: 0 4px 15px #322a6b0c; }
.searchbox:focus-within { border-color: #7067d6; box-shadow: 0 0 0 3px #7067d623; }
.searchbox input { width: 100%; min-width: 0; min-height: 47px; background: transparent; color: var(--ink); border: 0; outline: none; }
.searchbox input::placeholder { color: #656e8c; font-size: .875rem; }
kbd { border: 1px solid #e5e6f1; border-radius: 5px; min-width: 23px; text-align: center; background: #f6f7fc; font: .8125rem/23px ui-monospace, monospace; }
.hero-art { position: absolute; z-index: -1; right: 0; inset-block: 0; width: 48%; overflow: hidden; background-image: radial-gradient(#8278d928 1px, transparent 1px), radial-gradient(ellipse at 53% 52%, #bfc0ff7a, transparent 70%); background-size: 16px 16px, 100% 100%; mask-image: linear-gradient(90deg, transparent, #000 19%); }
.orbit { position: absolute; border: 1px solid #948bea59; width: 72%; aspect-ratio: 2.35; top: 50%; left: 53%; border-radius: 50%; transform: translate(-50%, -50%) rotate(-23deg); }
.orbit-two { width: 88%; }
.orbit-three { width: 58%; }
.tile { position: absolute; display: grid; place-items: center; aspect-ratio: 1; border-radius: 25%; box-shadow: 0 11px 20px #5042ac36, inset 0 1px 1px #fff9; border: 1px solid #ffffffab; color: #5751c6; transform: rotate(-12deg); }
.tile svg { width: 49%; height: 49%; }
.tile-grid { width: 98px; top: 30%; left: 45%; transform: rotate(-13deg); color: #fff; background: linear-gradient(140deg, #a398ff, #5c51e1 80%); }
.tile-globe { width: 65px; top: 22%; left: 23%; background: linear-gradient(145deg,#fff,#d7defd); }
.tile-link { width: 61px; top: 62%; left: 70%; transform: rotate(12deg); background: linear-gradient(145deg,#fff,#e6d9ff); }
.tile-spark { width: 48px; top: 14%; left: 75%; transform: rotate(12deg); color: #765bc3; background: linear-gradient(145deg,#fff,#eeebff); }
.orbital-star { position: absolute; color: #7169d3; }
.star-one { left: 37%; top: 69%; font-size: 1.4rem; }
.star-two { left: 87%; top: 46%; font-size: 1.35rem; }
.star-three { left: 66%; top: 18%; font-size: .8rem; }
.directory { padding-top: 34px; }
.section-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
h2 { margin: 0; font-size: 1.35rem; font-weight: 750; letter-spacing: -.025em; }
.count { font-size: .8125rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter { border: 1px solid var(--border); background: #fff; color: var(--muted); min-height: 35px; border-radius: 8px; padding: 5px 14px; max-width: 100%; overflow-wrap: anywhere; font-size: .875rem; }
.filter:hover, .filter[aria-pressed="true"] { color: var(--primary-dark); background: #eeedff; border-color: #dedafa; }
.filter[aria-pressed="true"] { font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; min-width: 0; position: relative; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.card:hover { border-color: #beb9ef; box-shadow: 0 5px 16px #3330670b; }
.card-body { display: flex; align-items: center; gap: 13px; min-height: 88px; padding: 15px; border-radius: inherit; }
a.card-body:hover .card-title { color: var(--primary-dark); }
.site-icon { height: 44px; width: 44px; flex: 0 0 44px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #eeedff; color: var(--primary-dark); font-size: 1.1rem; font-weight: 750; }
.site-icon img { width: 29px; height: 29px; object-fit: contain; }
.site-icon[data-tone="blue"] { background: #eaf2ff; color: #255ab0; }
.site-icon[data-tone="green"] { background: #e4f5ee; color: #197758; }
.site-icon[data-tone="pink"] { background: #f9eafe; color: #8b39a5; }
.site-icon[data-tone="orange"] { background: #fff0e3; color: #a95316; }
.site-icon[data-tone="slate"] { background: #edf0f5; color: #333d53; }
.card-copy { display: grid; gap: 5px; flex: 1; min-width: 0; }
.card-title { font-weight: 740; line-height: 1.2; }
.card-desc { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.card-title, .card-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-external { color: #6a7390; font-size: .9rem; }
.card-actions { display: flex; padding: 0 12px 9px; gap: 6px; flex-wrap: wrap; }
.card-actions button, .category-actions button { font-size: .8125rem; min-height: 31px; padding: 4px 8px; }
.card-actions button:disabled { cursor: default; }
.card-add { min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--primary-dark); font-weight: 675; font-size: .875rem; background: #f9f9ff; border: 1px dashed #bcb8e5; border-radius: 14px; }
.card-add:hover { border-color: var(--primary); background: #eeedff; }
.empty { display: grid; justify-items: center; padding: 38px 0; color: var(--muted); }
.empty > span { font-size: 1.4rem; }
.manage-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.manage-help { flex: 1 1 180px; padding-inline: 5px; color: var(--muted); font-size: .875rem; }
footer { border-top: 1px solid var(--border); margin-top: 34px; padding: 18px 0 25px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .8125rem; }
footer > span:first-child { display: flex; align-items: center; gap: 6px; }
dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 23px; border: 1px solid var(--border); border-radius: 18px; color: var(--ink); box-shadow: 0 14px 60px #20234b3b; }
dialog::backdrop { background: #191c3d75; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.icon-button { display: grid; place-items: center; width: 33px; height: 33px; border: 0; border-radius: 8px; color: var(--muted); background: #f1f2f8; }
.icon-button:hover { color: var(--primary-dark); background: #edebff; }
.field { display: grid; gap: 6px; margin-bottom: 13px; min-width: 0; }
label, legend { font-size: .875rem; font-weight: 680; }
label span, small { font-size: .8125rem; color: var(--muted); font-weight: 400; }
.field input, .field select { min-width: 0; width: 100%; min-height: 40px; border: 1px solid #dfe2ee; border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); }
.field select { appearance: none; padding-right: 30px; background: linear-gradient(45deg, transparent 49%, #5f6883 50%) right 15px center / 5px 5px no-repeat, linear-gradient(135deg, #5f6883 49%, transparent 50%) right 10px center / 5px 5px no-repeat, #fff; }
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px 10px; margin: 0; min-width: 0; }
legend { padding: 0 4px; }
.icon-controls { display: flex; align-items: center; gap: 10px; }
.icon-controls .field { flex: 1; margin: 0; }
fieldset > .field { margin: 10px 0 0; }
.builtin-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.builtin-options .icon-button[aria-pressed="true"] { color: var(--primary-dark); background: #e6e2ff; box-shadow: inset 0 0 0 1px #9f94ee; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.form-status { color: #a61f32; font-size: .875rem; margin-bottom: 0; }
.category-form { display: flex; align-items: end; gap: 9px; }
.category-form .field { flex: 1; margin: 0; }
.category-list { margin-top: 12px; }
.category-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 8px 0; gap: 10px; overflow-wrap: anywhere; }
.category-actions { display: flex; gap: 6px; flex-shrink: 0; }
.toast { position: fixed; z-index: 1; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 10px 17px; width: max-content; max-width: calc(100% - 30px); border-radius: 10px; background: #242649; color: #fff; box-shadow: 0 5px 14px #20234b40; font-size: .875rem; }
@media (max-width: 850px) {
  .shell { width: calc(100% - 42px); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy { width: min(100%, 480px); padding-inline: 30px; }
  .hero-art { opacity: .82; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .bar-inner { min-height: 63px; }
  .brand { font-size: .92rem; gap: 6px; }
  .brand-icon { width: 31px; height: 31px; }
  .header-actions { gap: 3px; }
  .header-actions .button { padding-inline: 7px; gap: 4px; }
  .hero { margin-top: 17px; border-radius: 17px; min-height: 220px; }
  .hero-copy { padding: 24px 16px; }
  .hero-art { opacity: .36; width: 69%; }
  .tile-grid { width: 67px; }
  .tile-globe, .tile-link { width: 43px; }
  .tile-spark { width: 35px; }
  .directory { padding-top: 24px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .card-body, .card-add { min-height: 70px; }
  .card-body { padding: 10px 12px; }
  dialog { padding: 16px; }
}
@media (max-width: 340px) { .header-actions .button [data-icon], kbd { display: none; } }
