:root {
    --card-size: 80px;
    --radius: 18px;
    --gap: 30px;
    --row-count: 8;
    --page-width: calc(var(--row-count) * (var(--card-size) + var(--gap)) - var(--gap));
}

body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    box-sizing: border-box;
    visibility: hidden;
    transition: color 0.3s ease;
    color: #333;
}

body.dark-mode {
    color: #fff !important;
}
body.dark-mode .page-title,
body.dark-mode .bookmark-title {
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
body.dark-mode .user-icon-svg {
    fill: #fff;
}

.background-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background-color: #e4d0e5;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M0,0L48,26.7C96,53,192,107,288,122.7C384,139,480,117,576,106.7C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z'%3E%3C/path%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='rgba(255,255,255,0.2)' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E"),
        linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
    background-position: top center, bottom center, center;
    background-repeat: no-repeat;
    background-size: 100% 50%, 100% 50%, cover;
    transition: background-color 0.5s ease;
}

.background-layer.bg-pattern-aurora {
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.5) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 255, 255, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.3) 0px, transparent 50%),
        linear-gradient(120deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.4) 100%) !important;
    background-size: cover !important;
}

.background-layer.bg-pattern-flow {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(255,255,255,0.6) 0%, transparent 70%) !important;
    background-size: 40px 40px, 40px 40px, 100% 100% !important;
}

.background-layer.bg-pattern-lines-d {
    background-image:
        linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%),
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.03) 0, rgba(0, 0, 0, 0.03) 1px, transparent 0, transparent 15px) !important;
    background-size: cover, auto !important;
}

.container {
    width: 100%; height: 100vh;
    display: flex; flex-direction: column; justify-content: flex-start;
    padding-top: 6vh; padding-bottom: 0; box-sizing: border-box;
}

.hidden { display: none !important; }

.toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
    pointer-events: none; width: 90%; max-width: 400px;
}
.toast {
    background: rgba(0, 0, 0, 0.85); color: white; padding: 12px 24px;
    border-radius: 30px; font-size: 14px; font-weight: 500;
    backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center; opacity: 0; transform: translateY(-20px) scale(0.9);
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}
.toast.visible { opacity: 1; transform: translateY(0) scale(1); }
.toast.success { background: rgba(52, 199, 89, 0.9); }
.toast.error { background: rgba(255, 59, 48, 0.9); }

.sync-status {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sync-status.visible { opacity: 1; transform: translateY(0); }
.sync-status.saving { color: #007AFF; }
.sync-status.saved { color: #34C759; }
.sync-status.error { color: #FF3B30; }
body.dark-mode .sync-status { background: rgba(30, 30, 30, 0.9); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
