* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: #f39c12;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #f39c12;
}

.navbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: none;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.search-form {
    display: flex;
    gap: 5px;
}

.search-form input {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 200px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: background 0.2s;
}

.search-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-form input:focus {
    background: rgba(255,255,255,0.25);
    outline: none;
}

.search-form button,
.search-form-large button {
    padding: 8px 14px;
    background: #f39c12;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.search-form button:hover,
.search-form-large button:hover {
    background: #e67e22;
}

main.container {
    min-height: 60vh;
    padding: 2rem 20px 2rem;
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    color: #2c3e50;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
}

blockquote {
    background: #fff;
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

blockquote p {
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.7;
}

blockquote footer {
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: bold;
    color: #555;
}

.qotd {
    margin: 0;
}

.qotd blockquote {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 3rem 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    position: relative;
    border-left: none;
    text-align: center;
    margin: 0 0 1rem;
}

.qotd-label {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

.qotd blockquote::before {
    content: '\201C';
    font-size: 8rem;
    position: absolute;
    top: 6px;
    left: 30px;
    color: rgb(255 239 212 / 20%);
    font-family: Georgia, serif;
    line-height: 1;
}

.qotd blockquote p {
    font-size: 1.6rem;
    line-height: 1.8;
    color: #fff;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.qotd blockquote footer {
    font-size: 1.05rem;
    color: #f39c12;
    font-weight: 500;
}

/* Quote Grid - Masonry */
.quote-grid {
    column-count: 3;
    column-gap: 1rem;
    padding: 0;
}

@media (max-width: 900px) {
    .quote-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .quote-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

.quote-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.quote-img-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.quote-img-wrapper a {
    display: block;
    text-decoration: none;
}

.quote-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
    border-radius: 12px;
}

.pin-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: #e60023 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 0C5.4 0 0 5.4 0 12c0 5.1 3.2 9.4 7.6 11.2-.1-.9-.2-2.4 0-3.4.2-.9 1.4-5.9 1.4-5.9s-.4-.7-.4-1.8c0-1.7 1-3 2.2-3 .9 0 1.5.7 1.5 1.6 0 1-.6 2.4-1 3.7-.3 1.1.6 2 1.6 2 1.9 0 3.5-2.5 3.5-5.4 0-2.4-1.6-4.2-4.5-4.2C7.6 5.7 6 8.1 6 10c0 1 .3 1.8.8 2.3.2.3.3.4.2.7-.1.3-.3 1-.4 1.3-.1.4-.5.6-.9.4-1.3-.5-2.2-2.3-2.2-4.1 0-3.1 2.6-6.7 7.7-6.7 4.1 0 6.8 3 6.8 6.2 0 4.2-2.4 7.4-5.8 7.4-1.2 0-2.3-.6-2.7-1.4 0 0-.7 2.7-.8 3.2-.3 1-.9 2.1-1.4 2.9 1 .3 2.1.5 3.2.5 6.6 0 12-5.4 12-12S18.6 0 12 0z'/%3E%3C/svg%3E") no-repeat center / 20px;
    border-radius: 50%;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px rgba(230,0,35,0.4);
    z-index: 2;
}

.quote-img-wrapper:hover .pin-btn {
    opacity: 1;
    transform: translateY(0);
}

.pin-btn:hover {
    background-color: #c7001f;
    box-shadow: 0 4px 14px rgba(230,0,35,0.5);
    transform: scale(1.08);
}

.quote-card-fallback {
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quote-card-fallback p {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-weight: 400;
}

.quote-card-fallback span {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.85;
}

.author-link {
    text-decoration: none;
    font-weight: 500;
}

.author-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.total-count {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Sidebar layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.top-authors, .top-topics {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f2f5;
}

.widget-icon {
    font-size: 1.2rem;
}

.widget-header h3 {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
}

.author-rank-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.author-rank-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
    overflow: hidden;
}

.author-rank-item:hover {
    background: #f8f9fa;
}

.rank-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.rank-name {
    display: block;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-rank-item:hover .rank-name {
    color: #3498db;
}

.rank-count {
    font-size: 0.8rem;
    color: #525151;
    font-weight: 600;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    color: #2c3e50;
    background: #e8edf2;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.tag-cloud .tag {
    background: #fff;
    border: 1px solid #d0d5dd;
    color: #2c3e50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tag-cloud .tag:hover {
    background: #f7f8fa;
    border-color: #2c3e50;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.tag-count {
    font-size: 0.7rem;
    font-weight: 400;
}

/* Alphabet navigation */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1.5rem;
}

.alphabet-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    font-weight: 500;
}

.alphabet-nav a.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.alphabet-nav a:hover:not(.active) {
    background: #ecf0f1;
}

/* Author list */
.author-list {
    list-style: none;
}

.author-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-list a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.author-list a:hover {
    color: #3498db;
}

.author-list .count {
    color: #3D4444;
    font-size: 0.85rem;
}

/* Topic list */
.topic-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.topic-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #fff;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: background 0.2s;
}

.topic-item a:hover {
    background: #3498db;
    color: #fff;
}

.topic-item .count {
    font-size: 0.8rem;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
}

.topic-item a:hover .count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Quote item */
.quote-item {
    margin-bottom: 1rem;
}

.quote-categories {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.permalink {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
}

.permalink:hover {
    color: #3498db;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination a {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination span {
    color: #3D4444;
}

/* Quote detail */
.quote-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.quote-detail-main {
    min-width: 0;
    background: #fff;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

.author-page .quote-detail-main {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.author-header {
    margin-bottom: 1rem;
}

.author-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.author-description {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
}

.topic-page .quote-detail-main {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.topic-header {
    margin-bottom: 1rem;
}

.topic-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.topic-description {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
}

.quote-detail-text {
    padding-bottom: 1.5rem;
    border-top: 1px solid #f0f2f5;
}

.quote-detail-text h1 {
    font-size: 1.5rem;
    line-height: 1.7;
    color: #2c3e50;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.quote-detail-text .quote-author {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 500;
}

.quote-detail-text .quote-author a {
    color: #065c84;
    text-decoration: none;
}

.quote-detail-text .quote-author a:hover {
    text-decoration: underline;
}

.quote-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.quote-carousel-inner {
    flex: 1;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.quote-carousel-slide {
    display: none;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    min-height: 400px;
    border-radius: 14px;
}

.quote-carousel-slide.active {
    display: block;
}

.quote-carousel-slide img {
    position: relative;
    z-index: 1;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.quote-carousel-inner:hover .pin-btn {
    opacity: 1;
    transform: translateY(0);
}

.quote-detail-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.quote-detail-fallback {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 3rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
}

.quote-detail-fallback p {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.quote-detail-fallback footer {
    font-size: 1rem;
    opacity: 0.85;
}

.carousel-arrow {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #fff;
    color: #2c3e50;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.carousel-arrow:hover {
    background: #fff;
    color: #1a252f;
    border-color: #3498db;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    transform: scale(1.06);
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
}

.carousel-dot {
    pointer-events: auto;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.quote-detail-actions {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 1.25rem;
}

.action-btn {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.3px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.action-btn svg,
.toolbar-btn svg {
    flex-shrink: 0;
}

.quote-detail-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1.25rem 0;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.download-btn {
    background: #2c3e50;
    color: #fff;
}

.download-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,62,80,0.35);
}

.customize-btn {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #fff;
}

.customize-btn:hover {
    background: linear-gradient(135deg, #7C3AED, #4F46E5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.pin-action {
    background: #e60023;
    color: #fff;
}

.pin-action:hover {
    background: #c7001f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230,0,35,0.35);
}

.fb-action {
    background: #0866de;
    color: #fff;
}

.fb-action:hover {
    background: #1664d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24,119,242,0.35);
}

.tw-action {
    background: #000;
    color: #fff;
}

.tw-action:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.wa-action {
    background: #166534;
    color: #fff;
}

.wa-action:hover {
    background: #20bd5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,211,102,0.35);
}

.tg-action {
    background: #026fa6;
    color: #fff;
}

.tg-action:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,136,204,0.35);
}

.copy-action {
    background: #2c3e50;
    color: #fff;
}

.copy-action:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,62,80,0.35);
}

.copy-action.copied {
    background: #1e8449;
}

.copy-action.copied:hover {
    background: #1a6e3a;
}

.quote-detail-tags {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eaed;
}

.tags-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #3D4444;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-top: 5px;
    flex-shrink: 0;
    min-width: 44px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.quote-detail-tags .tag {
    padding: 5px 12px 5px 10px;
    background: #f4f6f8;
    border: 1px solid #e8eaed;
    color: #555;
    font-size: 0.8rem;
    border-radius: 6px;
    gap: 5px;
}

.quote-detail-tags .tag:hover {
    background: #3498db;
    border-color: #3498db;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52,152,219,0.25);
}

.quote-detail-tags .tag svg {
    opacity: 0.6;
}

.quote-detail-tags .tag:hover svg {
    opacity: 1;
}

.related-quotes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8eaed;
}

.related-quotes-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.related-quotes-section .quote-grid {
    column-count: 3;
    column-gap: 14px;
}

@media (max-width: 900px) {
    .related-quotes-section .quote-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .related-quotes-section .quote-grid {
        column-count: 1;
    }
}

.related-quotes-section .masonry-item {
    break-inside: avoid;
    margin-bottom: 14px;
}

.quote-detail-nav-text {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-top: 1px solid #eee;
}

.quote-detail-nav-text a {
    text-decoration: none;
    color: #3498db;
    font-weight: 500;
    transition: color 0.2s;
}

.quote-detail-nav-text a:hover {
    color: #2980b9;
}

.quote-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    overflow: hidden;
}

/* Search */
.search-form-large {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin-bottom: 1.5rem;
}

.search-form-large input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form-large input:focus {
    border-color: #3498db;
    outline: none;
}

.search-info {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.search-page .quote-detail-main {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.search-header h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.search-landing {
    margin-top: 0.5rem;
}

.search-landing p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.search-suggestions h3 {
    font-size: 0.95rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.search-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-grid-item {
    display: block;
    padding: 1.5rem 2rem;
    border-radius: 14px;
    text-decoration: none;
    color: #fff !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.search-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.search-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.sgi-quote-mark {
    display: block;
    font-size: 2.8rem;
    line-height: 1;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.25rem;
    font-family: Georgia, serif;
}

.sgi-text {
    display: block;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #fff;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.sgi-author {
    display: block;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 1rem;
}

.btn:hover {
    background: #2980b9;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 2rem 0;
}
.footer p {
    font-size: 0.875rem;
    color: #bbb;
}
@media (max-width: 1024px) {
    .quote-detail-layout {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .navbar-row {
        width: 100%;
        justify-content: space-between;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.15);
        margin-top: 0.5rem;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links a {
        padding: 0.5rem 0;
    }

    .search-form {
        width: 100%;
        margin-top: 0.5rem;
    }

    .search-form input {
        flex: 1;
        width: auto;
    }

    .qotd blockquote {
        padding: 2rem 1.5rem;
    }

    .qotd blockquote p {
        font-size: 1.2rem;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .quote-grid {
        grid-template-columns: 1fr;
    }

    .alphabet-nav a {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .topic-list {
        grid-template-columns: 1fr;
    }

    blockquote p {
        font-size: 0.95rem;
    }

    .quote-detail-main {
        width: 100%;
        padding: 1.25rem;
    }

    .quote-detail-actions {
        flex-wrap: wrap;
    }

    .quote-detail-text h1 {
        font-size: 1.2rem;
    }

    .action-btn {
        font-size: 0;
        gap: 0;
    }

    .action-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 640px) {


    .carousel-arrow {
        position: absolute;
        bottom: -62px;
        z-index: 10;
        background: rgba(255,255,255,0.92);
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }

    .carousel-arrow:hover {
        border-color: transparent;
        transform: scale(1.05);
    }

    .carousel-prev {
        left: 0;
    }

    .carousel-next {
        right: 0;
    }

    .quote-detail-layout {
        margin-top: 0;
    }

    .container:has(.quote-detail-layout:not(.author-page):not(.topic-page):not(.search-page)) {
        background: #fff;
    }

    .quote-detail-main {
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .author-page .quote-detail-main,
    .topic-page .quote-detail-main,
    .search-page .quote-detail-main {
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
}
@media (max-width: 500px) {
    .sidebar-layout {
        gap: 1rem;
    }

    .top-authors, .top-topics {
        padding: 1rem;
    }

    .author-rank-item {
        padding: 0.3rem 0.4rem;
        gap: 6px;
    }

    .rank-badge {
        width: 22px;
        height: 22px;
    }

    .rank-count {
        padding: 1px 6px;
    }

    .tag {
        padding: 5px 10px;
    }

    .widget-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .qotd blockquote {
        padding: 1.5rem 1rem;
    }

    .qotd blockquote p {
        font-size: 1.05rem;
    }

    
    .quote-detail-text h1 {
        font-size: 1.15rem;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        bottom: -52px;
    }

    .quote-carousel {
        gap: 4px;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 0;
        gap: 0;
    }

    .toolbar-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .quote-detail-actions {
        gap: 6px;
    }

    .cookie-notice {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .quote-grid {
        column-count: 1;
    }

}

@media (max-width: 440px) {
    .container {
        padding: 0 12px;
    }

    .top-authors, .top-topics {
        padding: 0.75rem;
    }

    .author-rank-item {
        padding: 0.25rem 0.3rem;
        gap: 5px;
    }

    .rank-badge {
        width: 20px;
        height: 20px;
    }

    .rank-count {
        padding: 1px 5px;
    }

    .tag {
        padding: 4px 8px;
        gap: 3px;
    }

    .sidebar-layout {
        margin-top: 1.5rem;
    }

    .quote-detail-text h1 {
        font-size: 1.05rem;
    }

    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .quote-carousel {
        gap: 3px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 0;
        gap: 0;
    }

    .toolbar-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .quote-detail-actions {
        gap: 5px;
    }

}



/* --- Static Pages --- */
.static-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}
.static-page h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}
.static-page h2 {
    font-size: 1.35rem;
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.static-page h3 {
    font-size: 1.1rem;
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.static-page p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #444;
}
.static-page ul {
    margin: 0 0 1rem 1.5rem;
    list-style: disc;
}
.static-page li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #444;
}
.static-page a {
    color: #174c6f;
    text-decoration: underline;
}
.static-page a:hover {
    color: #1a5276;
}
.last-updated {
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.cookie-table th,
.cookie-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}
.cookie-table th {
    background: #f5f6fa;
    font-weight: 600;
    color: #2c3e50;
}
.cookie-table td {
    color: #444;
}

/* --- Footer Links --- */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: #bbb;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* --- Cookie Notice --- */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: #eee;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 9999;
    font-size: 0.9rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
.cookie-notice p {
    margin: 0;
    max-width: 700px;
}
.cookie-notice a {
    color: #85c1e9;
    text-decoration: underline;
}
.cookie-btn {
    background: #1e8449;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}
.cookie-btn:hover {
    background: #1e8449;
}

/* --- Skip Link --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.5rem;
    z-index: 10001;
    text-decoration: none;
    font-size: 1rem;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* --- Coming Soon Tooltip --- */
.coming-soon-tooltip {
    position: fixed;
    background: #2c3e50;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10000;
    white-space: nowrap;
}
.coming-soon-tooltip.visible {
    opacity: 1;
}
.coming-soon-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #2c3e50;
}

.generator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.generator-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.generator-header .generator-subtitle {
    max-width: 680px;
    margin: 0 auto;
    color: #464545;
    font-size: 0.9rem;
    line-height: 1.6;
}

.generator-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.generator-controls {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.generator-controls .control-section {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.generator-controls .control-section:first-child {
    padding-top: 0;
}

.generator-controls .control-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.generator-controls label {
    display: flex;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #2c3e50;
    font-size: 0.85rem;
}

.generator-controls textarea,
.generator-controls input[type="text"],
.generator-controls select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.generator-controls textarea {
    min-height: 80px;
    resize: vertical;
}

.generator-controls input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
    accent-color: #2c3e50;
}

.generator-controls input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.alignment-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alignment-group button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.alignment-group button.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.bg-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px;
}

.bg-gallery img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.bg-gallery img.active {
    border-color: #2c3e50;
}

.generator-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 1rem;
}

.generator-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    cursor: grab;
}

.generator-preview canvas.dragging {
    cursor: grabbing;
}

.generator-preview .hint {
    font-size: 0.8rem;
    color: #464545;
    margin-top: 0.5rem;
}

#bg-upload {
    display: none;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.75rem;
    border: 2px dashed #ccc;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.upload-label svg {
    display: block;
    flex-shrink: 0;
}

.upload-label:hover {
    border-color: #2c3e50;
    color: #2c3e50;
    background: #f8f9fa;
}

#btn-download {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-download:hover {
    background: #34495e;
}

@media (max-width: 900px) {
    .generator-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .generator-preview {
        position: static;
    }
    .bg-gallery {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 600px) {
    .bg-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
    .generator-container {
        margin: 1rem 0;
    }
    .generator-header h1 {
        font-size: 1.4rem;
    }
}
