#star-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
#star-atmosphere span {
    position: absolute;
    color: #b8eaff;
    opacity: .32;
    animation: star-shimmer 6s ease-in-out infinite alternate;
}
@keyframes star-shimmer {
    from { opacity: .15; transform: translateY(0); }
    to { opacity: .65; transform: translateY(-5px); }
}
body.star-modern .book-card {
    border-color: #aaa2e34a;
    background: linear-gradient(145deg,#302b58,#1a1b40);
}
body.star-modern .book-cover {
    background: radial-gradient(ellipse at 50% 20%,#55508b,#25244c);
}
body.star-modern .book-cover img { filter: drop-shadow(0 6px 10px #100d2855); }
body.star-modern .book-title { white-space: normal; overflow-wrap: anywhere; }
body.star-modern .book-actions { flex-wrap: wrap; }
body.star-modern .book-actions > * { min-width: 75px; }
body.star-modern :is(button,a,input,select,textarea):focus-visible {
    outline: 2px solid #a5e6ff;
    outline-offset: 3px;
}
#star-dialog {
    width: min(460px,calc(100% - 32px));
    color: #f3eeff;
    background: linear-gradient(145deg,#353064,#211e46);
    border: 1px solid #9187d4;
    border-radius: 23px;
    padding: 28px;
    box-shadow: 0 24px 80px #08071eaa;
    font: 15px/1.7 "Microsoft YaHei",sans-serif;
}
#star-dialog::backdrop { background: #0b0924b8; }
#star-dialog h2 { margin: 0 0 12px; color: #a5e6ff; font-size: 21px; }
#star-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; color: #eee9ff; }
#star-dialog form { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
#star-dialog button { font: inherit; padding: 10px 20px; border: 1px solid #aaa2e366; border-radius: 12px; background: #403966; color: #f3eeff; cursor: pointer; }
#star-dialog button[value="yes"] { background: linear-gradient(115deg,#a5e6ff,#b7a2f8); color: #151532; font-weight: 700; }
@media(max-width:600px) {
    body.star-modern .book-actions > * { min-height: 44px; }
    body.star-modern .book-card { padding: 14px; }
    body.star-modern .book-cover { height: clamp(140px,48vw,220px); }
}
@media(prefers-reduced-motion:reduce) {
    #star-atmosphere span { animation: none !important; }
}

#star-atmosphere .star-butterfly {
    position: absolute;
    width: 38px;
    height: 38px;
    opacity: .65;
    animation: star-flight 19s ease-in-out infinite;
}
.star-butterfly svg { width: 100%; height: 100%; overflow: visible; }
.star-butterfly .wing-left, .star-butterfly .wing-right {
    transform-origin: 32px 32px;
    animation: star-wing 1.2s ease-in-out infinite alternate;
}
@keyframes star-wing {
    from { transform: scaleX(1); }
    to { transform: scaleX(.38); }
}
@keyframes star-flight {
    0%,100% { transform: translate(0,0) rotate(-12deg); }
    25% { transform: translate(24px,-36px) rotate(8deg); }
    50% { transform: translate(-10px,-65px) rotate(-8deg); }
    75% { transform: translate(-28px,-24px) rotate(10deg); }
}
#star-atmosphere .star-nebula {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 15% 35%, #a69aff13, transparent 40%),
                radial-gradient(ellipse at 85% 75%, #83e3ff10, transparent 38%);
    animation: star-nebula 18s ease-in-out infinite alternate;
}
@keyframes star-nebula {
    from { opacity: .3; }
    to { opacity: 1; }
}
#star-controls {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
#star-controls button {
    font: 13px/1.5 "Microsoft YaHei", sans-serif;
    min-height: 42px;
    border: 1px solid #9187d4;
    border-radius: 22px;
    background: #252148;
    color: #c6edff;
    padding: 9px 15px;
    cursor: pointer;
    box-shadow: 0 5px 18px #09082055;
}
#star-controls button[hidden] { display: none !important; }
#star-toasts {
    position: fixed;
    top: 18px;
    right: 18px;
    width: min(350px,calc(100vw - 36px));
    z-index: 1600;
    pointer-events: none;
    display: grid;
    gap: 10px;
}
.star-toast {
    padding: 15px 18px;
    border: 1px solid #a5e6ff88;
    border-radius: 15px;
    background: #292553;
    color: #f3eeff;
    box-shadow: 0 8px 24px #09082066;
    overflow-wrap: anywhere;
    font: 14px/1.6 "Microsoft YaHei", sans-serif;
}
.star-toast[data-kind="error"] { border-color: #eab0c8; }
.star-toast[data-kind="warning"] { border-color: #e9cf96; }
.star-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 12px;
    color: #bceaff;
    grid-column: 1/-1;
}
.star-loading::before {
    content: "";
    width: 22px;
    height: 22px;
    border: 2px solid #a99aeb55;
    border-top-color: #a5e6ff;
    border-radius: 50%;
    animation: star-spin .9s linear infinite;
}
@keyframes star-spin { to { transform: rotate(360deg); } }
html.star-motion-off #star-atmosphere { display: none; }
html.star-motion-off .star-loading::before { animation: none; }
html.star-motion-off body.star-modern *,
html.star-motion-off body.star-modern *::before,
html.star-motion-off body.star-modern *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
    #star-atmosphere { display: none; }
    .star-loading::before { animation: none; }
}
@media (max-width: 600px) {
    #star-controls { right: 10px; bottom: 12px; }
    #star-controls button { min-height: 44px; }
    #star-atmosphere .star-butterfly:nth-of-type(n+3) { display: none; }
}

body.star-refined-home .navbar {
    gap: 12px 22px;
    padding-block: 14px;
}
body.star-refined-home.star-modern .star-home-links > a:not([id]) {
    display: none;
}
body.star-refined-home #star-navigation {
    border-top: 1px solid #a9b2ea30;
    border-bottom: 0;
}
body.star-refined-home #star-navigation .star-name {
    font-size: 12px;
    color: #b9c4ec;
}
body.star-refined-home .hero {
    min-height: clamp(480px, 65vh, 650px);
}
body.star-refined-profile .star-profile-shortcuts {
    position: relative;
    padding: 25px;
    margin: 22px 0;
    border: 1px solid #a9b2ea40;
    border-radius: 22px;
    background: linear-gradient(125deg, #302b60, #211e46);
}
.star-profile-shortcuts h2 {
    margin: 0 0 16px;
    font-size: 21px;
}
.star-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
    gap: 10px;
}
.star-shortcut-grid a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid #a9b2ea40;
    border-radius: 12px;
    color: #e7e0ff;
    text-decoration: none;
    background: #1b193b;
}
.star-shortcut-grid a:hover {
    background: #403b70;
    border-color: #a5e6ff88;
}
.star-shortcut-grid a span { color: #a5e6ff; }
body.star-refined-profile section[id] { scroll-margin-top: 25px; }
body.star-refined-detail #detail-card {
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: clamp(22px, 4vw, 48px);
    padding: clamp(20px, 4vw, 42px);
}
body.star-refined-detail .info-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #a9b2ea26;
    border-radius: 12px;
    background: #19173555;
}
body.star-refined-detail .info-value,
body.star-refined-detail .book-title { overflow-wrap: anywhere; }
body.star-refined-detail #embedded-review-list article {
    padding: 16px !important;
    margin: 12px 0;
    border: 1px solid #a9b2ea40 !important;
    border-radius: 14px;
    background: #19173588;
}
@media (max-width: 760px) {
    body.star-refined-home .hero { min-height: 480px; }
    body.star-refined-home .navbar { padding: 12px 16px; }
    body.star-refined-profile .star-profile-shortcuts { padding: 18px; }
    body.star-refined-detail #detail-card { grid-template-columns: 1fr; }
    body.star-refined-detail .cover-box { min-height: 250px; }
}
@media (max-width: 420px) {
    body.star-refined-detail .info-grid { grid-template-columns: 1fr; }
}
