@font-face {
    font-family: "IBM Plex Serif";
    src: url(/static/fonts/IBMPlexSerif-Regular.ttf) format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--ui-font);
}

:root {
    --bg: #0a0c10;
    --surface: #14181c;
    --surface-hover: #1a2025;
    --text-primary: #eef2f5;
    --text-secondary: #9aaebf;
    --text-muted: #6c7f8f;
    --border-light: #20262c;
    --border-medium: #2d353d;
    --accent-light: #1e262e;
    --accent-soft: #2a323c;
    --primary-glow: #2e3b4e;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 20px -8px rgba(0, 0, 0, 0.6);
    --radius-card: 16px;
    --radius-small: 10px;
    --transition: all 0.2s ease;
    --ui-font: 'IBM Plex Serif', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    height: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    padding: 16px 16px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1 0 auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 8px 16px 8px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 42px;
    height: 42px;
    background: #f0f4fa;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.logo-text {
    font-weight: 580;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    white-space: nowrap;
}
.logo-text span {
    font-weight: 380;
    color: var(--text-secondary);
    margin-left: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    padding: 4px;
    border-radius: 40px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 7px 18px;
    border-radius: 40px;
    font-weight: 480;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--surface);
    border-color: var(--border-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.nav-item.search {
    background: var(--surface);
    border-color: var(--border-light);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 20px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 28px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.note-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-medium);
    background: var(--surface-hover);
}

.note-cover {
    aspect-ratio: 1 / 1.414;
    background: #1a2128;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.cover-image.loaded {
    opacity: 1;
}

.cover-image.error {
    display: none;
}

.cover-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2128;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.cover-loader.hidden {
    display: none;
}

.cover-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1a2128;
    color: #ff6b6b;
    font-size: 0.75rem;
    text-align: center;
    padding: 16px;
}

.cover-error.hidden {
    display: none;
}

.cover-error svg {
    fill: #ff6b6b;
    opacity: 0.7;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.note-info {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-title {
    font-weight: 630;
    font-size: 1.05rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.note-author {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 7px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-comment {
    background-color: var(--accent-light);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #b8c9e0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    background: var(--accent-soft);
    color: #cbdbe0;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 30px;
    font-weight: 460;
    border: 1px solid var(--border-light);
    transition: background 0.1s;
    white-space: nowrap;
}

.tag:hover {
    background: var(--border-medium);
}

.no-notes,
.no-results {
    text-align: center;
    padding: 30px 15px;
    background: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-light);
    margin-top: 30px;
}

.no-notes p,
.no-results p {
    color: var(--text-muted);
    font-size: 1rem;
}

.no-notes p:first-child,
.no-results h3 {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 0px;
}

.search-suggestions {
    background: var(--accent-light);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    border-left: 3px solid #5e7a9a;
}

.footer {
    margin-top: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    padding: 36px 24px 28px;
    border-radius: 40px 40px 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 32px 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.footer-col a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.75;
    transition: opacity 0.15s;
    width: fit-content;
}

.footer-col a:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 32px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 28px;
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.social-icons a {
    font-size: 1.3rem;
    opacity: 0.7;
}

.catalog-page {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 30px;
}

.catalog-header h1 {
    font-size: 1.6rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.catalog-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.letters-panel {
    margin-bottom: 28px;
    padding: 12px 0;
    border-bottom: 2px solid var(--border-light);
}

.letters-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.letters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.letter-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    font-size: 1.1rem;
    font-weight: 550;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.letter-btn:hover {
    background: var(--accent-light);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.letter-btn.active {
    background: #2e3b4e;
    border-color: #3e4d62;
    color: white;
}

.letter-btn.empty {
    opacity: 0.3;
    cursor: not-allowed;
}

.letter-btn.empty:hover {
    transform: none;
    background: var(--bg);
}

.author-group {
    margin-bottom: 28px;
    border-left: 3px solid #3e4d62;
    padding-left: 18px;
}

.author-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.works-list {
    list-style: none;
    margin-left: 10px;
}

.work-item {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-small);
    transition: var(--transition);
}

.work-item:hover {
    background: var(--accent-light);
    transform: translateX(4px);
}

.work-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-width: 24px;
}

.work-title {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.work-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.note-page {
    background: var(--surface);
    border-radius: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 32px;
    margin-bottom: 40px;
}

.note-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.note-title-section h1 {
    font-size: 2.2rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.note-title-section .author {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 380;
}

.note-title-section .author a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.note-title-section .author a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.note-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag-large {
    font-size: 0.9rem;
    padding: 6px 16px;
}

.note-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    margin-bottom: 36px;
}

.note-image-container {
    background: #1a2128;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    aspect-ratio: 1 / 1.414;
    box-shadow: var(--shadow-sm);
}

.note-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.note-details {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.comment-block {
    background: var(--accent-light);
    border-radius: 20px;
    padding: 22px 24px;
    border-left: 5px solid #5e7a9a;
}

.comment-block h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.comment-block p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #cad4e2;
}

.audio-section {
    background: var(--bg);
    border-radius: 20px;
    padding: 18px 20px;
    border: 1px solid var(--border-light);
}

.audio-section h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

audio {
    width: 100%;
    height: 44px;
    border-radius: 30px;
}

.download-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 540;
    font-size: 1.05rem;
    border: 1px solid var(--border-light);
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
    flex: 1 1 200px;
    cursor: pointer;
    font-family: inherit;
}

.download-btn:hover {
    background: var(--accent-light);
    border-color: var(--border-medium);
}

.download-btn.primary {
    background: #2e3b4e;
    border-color: #4a5c74;
}

.extra-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.extra-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-page {
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 30px;
}

.search-header h1 {
    font-size: 1.6rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 40px;
    padding: 2px 2px 2px 16px;
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    border-color: #5e7a9a;
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(94, 122, 154, 0.3);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 6px 10px 0;
    font-size: 1rem;
    outline: none;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    background: #2e3b4e;
    border: none;
    color: white;
    padding: 8px 24px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #3e4d62;
}

.search-button:hover {
    background: #3e516a;
}

.results-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.results-count strong {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-right: 4px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.sort-select {
    padding: 6px 24px 6px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-medium);
    background: var(--surface);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aaebf' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: var(--text-primary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-medium);
    background: var(--surface-hover);
}

.result-cover {
    aspect-ratio: 1 / 1.414;
    background: #1a2128;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.result-image.loaded {
    opacity: 1;
}

.result-image.error {
    display: none;
}

.result-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2128;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.result-loader.hidden {
    display: none;
}

.result-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1a2128;
    color: #ff6b6b;
    font-size: 0.75rem;
    text-align: center;
    padding: 16px;
}

.result-error.hidden {
    display: none;
}

.result-error svg {
    fill: #ff6b6b;
    opacity: 0.7;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-info {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.result-author {
    color: var(--text-secondary);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-author a {
    color: var(--text-secondary);
    text-decoration: none;
}

.result-author a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.result-tag {
    background: var(--accent-soft);
    color: #cbdbe0;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-item {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 450;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 0 6px;
}

.page-item:hover {
    background: var(--accent-light);
    border-color: var(--border-medium);
}

.page-item.active {
    background: #2e3b4e;
    border-color: #4a5c74;
    color: white;
}

.page-dots {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.link-a-nodecor {
    color: inherit;
    text-decoration: none;
}

.link-a-author {
    color: var(--text-secondary);
    font-weight: 300;
    text-decoration: none;
}

.link-a-author:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    width: fit-content;
}

.back-link:hover {
    background: var(--accent-light);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.back-link::before {
    content: "←";
    font-size: 1.2rem;
    line-height: 1;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) and (min-width: 701px) {
    .notes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1100px) {
    .notes-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 800px) {
    .note-content-grid {
        grid-template-columns: 1fr;
    }
    .note-image-container {
        max-width: 400px;
        margin: 0 auto;
    }
    .note-page {
        padding: 24px;
    }
    .note-title-section h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 700px) {
    .header {
        border-radius: 40px;
        padding: 8px 16px;
    }
    .logo-text {
        font-size: 1.25rem;
    }
    .nav-item {
        padding: 6px 14px;
        font-size: 0.9rem;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .letter-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    .catalog-page {
        padding: 16px;
    }
    .author-name {
        font-size: 1.1rem;
    }
    .work-item {
        flex-direction: column;
        gap: 4px;
    }
    .work-meta {
        margin-left: 34px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 10px 10px 0;
    }
    .header {
        border-radius: 30px;
        justify-content: center;
    }
    .logo-area {
        width: 100%;
        justify-content: center;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
    }
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    .note-info {
        padding: 12px 12px 14px;
    }
    .footer {
        padding: 30px 16px 20px;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .note-page {
        padding: 18px;
    }
    .download-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    .comment-block p {
        font-size: 1rem;
    }
    .extra-info {
        flex-direction: column;
        gap: 10px;
    }
    .search-page {
        padding: 16px;
    }
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .search-input-wrapper {
        flex-wrap: wrap;
        background: transparent;
        border: none;
        padding: 0;
    }
    .search-input {
        background: var(--bg);
        border: 1px solid var(--border-light);
        border-radius: 40px;
        padding: 10px 16px;
        width: 100%;
        margin-bottom: 8px;
    }
    .search-button {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .notes-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col a {
        width: 100%;
    }
    .social-icons {
        justify-content: center;
    }
    .pagination {
        gap: 2px;
    }
    .page-item,
    .page-dots {
        min-width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    .note-header {
        flex-direction: column;
    }
}

.error-simple {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
        
.error-simple-content {
    background: var(--surface);
    border-radius: 32px;
    padding: 48px 32px;
    border: 1px solid var(--border-light);
    max-width: 500px;
    width: 100%;
}
        
.error-simple-code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
        
.error-simple-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}
        
.error-simple-message {
    color: var(--text-muted);
    margin-bottom: 28px;
}
        
.error-simple-link {
    display: inline-block;
    padding: 10px 24px;
    background: #2e3b4e;
    border-radius: 40px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}
        
.error-simple-link:hover {
    background: #3e516a;
    transform: translateY(-2px);
}
        
@media (max-width: 500px) {
    .error-simple-content {
        padding: 32px 24px;
    }
    .error-simple-code {
        font-size: 3rem;
    }
}

.feedback-page {
    background: var(--surface);
    border-radius: 32px;
    padding: 32px;
    margin-bottom: 40px;
    border: 1px solid var(--border-light);
}

.feedback-header {
    text-align: center;
    margin-bottom: 32px;
}

.feedback-header h1 {
    font-size: 1.8rem;
    font-weight: 550;
    margin-bottom: 8px;
}

.feedback-header p {
    color: var(--text-secondary);
}

.feedback-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label .optional {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-label .required {
    color: #e06c75;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #5e7a9a;
    box-shadow: 0 0 0 2px rgba(94, 122, 154, 0.3);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.file-input-custom:hover {
    border-color: var(--border-medium);
    background: var(--accent-light);
}

.file-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 12px;
}

.file-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(224, 108, 117, 0.15);
    border-left: 4px solid #e06c75;
    color: #e06c75;
}

.alert-success {
    background: rgba(152, 195, 121, 0.15);
    border-left: 4px solid #98c379;
    color: #98c379;
}

.cloud-link-field {
    margin-top: 12px;
    display: block;
}

.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0;
    padding: 12px;
    background: var(--bg);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.submit-btn {
    background: #2e3b4e;
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.submit-btn:hover {
    background: #3e516a;
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 600px) {
    .feedback-page {
        padding: 24px;
    }
    .feedback-header h1 {
        font-size: 1.5rem;
    }
}