:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --bg-gradient-start: #f0f4ff;
    --bg-gradient-end: #fdf4ff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --shadow-color: rgba(99, 102, 241, 0.15);
    --item-bg: rgba(255, 255, 255, 0.5);
    --item-bg-hover: rgba(255, 255, 255, 0.8);
    --hover-bg: white;
    --code-bg: rgba(0, 0, 0, 0.05);
    --success-color: #166534;
    --error-color: #991b1b;
    --focus-shadow: rgba(99, 102, 241, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient-start: #0f172a;
        --bg-gradient-end: #1e3a5f;
        --glass-bg: rgba(30, 41, 59, 0.7);
        --glass-border: rgba(100, 116, 139, 0.3);
        --text-primary: #e2e8f0;
        --text-secondary: #94a3b8;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --item-bg: rgba(30, 41, 59, 0.5);
        --item-bg-hover: rgba(30, 41, 59, 0.8);
        --hover-bg: rgba(30, 41, 59, 0.9);
        --code-bg: rgba(0, 0, 0, 0.3);
        --success-color: #86efac;
        --error-color: #fca5a5;
        --focus-shadow: rgba(99, 102, 241, 0.2);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.admin-entry {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-color);
    z-index: 100;
}

.admin-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
    background: var(--hover-bg);
}

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

.profile-section {
    text-align: center;
    padding: 50px 30px;
    margin-bottom: 30px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 24px var(--shadow-color);
    margin-bottom: 20px;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
    background: var(--hover-bg);
}

.link-btn .icon {
    font-size: 1.2rem;
}

.section {
    padding: 30px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    padding: 20px;
    background: var(--item-bg);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.article-item:hover {
    background: var(--item-bg-hover);
    transform: translateX(4px);
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}

.article-title:hover {
    color: var(--primary-color);
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.more-btn {
    display: block;
    text-align: center;
    padding: 14px 28px;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    flex: 1;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--item-bg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--item-bg-hover);
    box-shadow: 0 0 0 4px var(--focus-shadow);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-item {
    padding: 20px;
    background: var(--item-bg);
    border-radius: 16px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.message-name {
    font-weight: 600;
    color: var(--primary-color);
}

.message-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.message-content {
    color: var(--text-primary);
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.admin-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.admin-nav a {
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.article-content {
    padding: 30px;
    margin-bottom: 30px;
}

.article-content h1, .article-content h2, .article-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.article-content p {
    margin-bottom: 1em;
}

.article-content pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
}

.article-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

.avatar-upload {
    text-align: center;
}

.current-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 24px var(--shadow-color);
    margin-bottom: 24px;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

@media (max-width: 640px) {
    .container {
        padding: 20px 16px;
    }
    
    .profile-section {
        padding: 30px 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .admin-entry {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.pagination-btn {
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: var(--item-bg);
    border-radius: 16px;
    margin-bottom: 16px;
}

.upload-preview {
    flex-shrink: 0;
}

.upload-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.upload-favicon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 8px;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.upload-actions {
    flex: 1;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 4px 16px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background: #ef4444;
}

.admin-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--item-bg);
    border-radius: 16px;
}

.admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.admin-empty-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.admin-empty-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .upload-item {
        flex-direction: column;
        text-align: center;
    }
    
    .upload-buttons {
        justify-content: center;
    }
}
