:root {
    --forum-primary: #2563eb;
    --forum-primary-hover: #1d4ed8;
    --forum-secondary: #64748b;
    --forum-success: #10b981;
    --forum-warning: #f59e0b;
    --forum-danger: #ef4444;
    --forum-bg: #f8fafc;
    --forum-card-bg: #ffffff;
    --forum-border: #e2e8f0;
    --forum-text: #1e293b;
    --forum-text-muted: #64748b;
    --forum-radius: 8px;
    --forum-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --forum-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modernforum {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--forum-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.forum-breadcrumb a {
    color: var(--forum-primary);
    text-decoration: none;
}

.forum-breadcrumb a:hover {
    text-decoration: underline;
}

.forum-breadcrumb .separator {
    color: var(--forum-text-muted);
}

.forum-breadcrumb .current {
    color: var(--forum-text-muted);
}

.forum-header {
    margin-bottom: 32px;
}

.forum-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.forum-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.forum-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}

.welcome-text {
    color: var(--forum-text-muted);
    font-size: 14px;
    margin-right: 8px;
}

.forum-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.forum-description {
    color: var(--forum-text-muted);
    margin: 0;
}

.forum-stats-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    margin-bottom: 24px;
    box-shadow: var(--forum-shadow);
    flex-wrap: wrap;
}

.forum-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.forum-stats-bar .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--forum-text);
}

.forum-stats-bar .stat-label {
    font-size: 12px;
    color: var(--forum-text-muted);
    text-transform: uppercase;
}

.forum-stats-bar .forum-stats-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.new-topic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.new-topic-btn svg {
    flex-shrink: 0;
}

.forum-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.category-card {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    margin-bottom: 24px;
    box-shadow: var(--forum-shadow);
    overflow: hidden;
}

.category-header {
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-primary-hover));
    color: white;
    padding: 16px 20px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.subforum-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.subforum-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--forum-border);
    transition: background-color 0.2s;
}

.subforum-item:last-child {
    border-bottom: none;
}

.subforum-item:hover {
    background-color: var(--forum-bg);
}

.subforum-icon {
    width: 40px;
    height: 40px;
    background: var(--forum-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--forum-primary);
}

.subforum-info {
    flex: 1;
}

.subforum-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--forum-text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

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

.subforum-description {
    font-size: 14px;
    color: var(--forum-text-muted);
    margin: 0;
}

.subforum-stats {
    text-align: right;
    font-size: 13px;
    color: var(--forum-text-muted);
}

.subforum-stats span {
    display: block;
}

.topic-list {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
}

.topic-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--forum-border);
    transition: background-color 0.2s;
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-item:hover {
    background-color: var(--forum-bg);
}

.topic-info {
    flex: 1;
}

.topic-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--forum-text);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

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

.topic-meta {
    font-size: 13px;
    color: var(--forum-text-muted);
}

.topic-stats {
    text-align: right;
    font-size: 13px;
    color: var(--forum-text-muted);
}

.topic-header {
    margin-bottom: 24px;
}

.topic-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
    overflow: hidden;
}

.post-item {
    display: flex;
    background: var(--forum-card-bg);
    border-bottom: 1px solid var(--forum-border);
    transition: background-color 0.15s ease;
}

.post-item:last-child {
    border-bottom: none;
}

.post-author {
    width: 180px;
    flex-shrink: 0;
    padding: 20px;
    background: var(--forum-bg);
    border-right: 1px solid var(--forum-border);
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
}

.author-name {
    font-weight: 600;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: 14px;
    color: var(--forum-text);
}

.author-role {
    font-size: 11px;
    color: var(--forum-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: var(--forum-border);
    border-radius: 4px;
    margin-top: 4px;
}

.post-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-header {
    padding: 12px 20px;
    background: var(--forum-bg);
    border-bottom: 1px solid var(--forum-border);
}

.post-date {
    font-size: 13px;
    color: var(--forum-text-muted);
}

.post-number {
    font-size: 12px;
    color: var(--forum-text-muted);
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--forum-border);
}

.post-content {
    padding: 20px;
    line-height: 1.7;
    flex: 1;
}

.post-content p:first-child {
    margin-top: 0;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.reply-form-container {
    margin-top: 32px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 24px;
    box-shadow: var(--forum-shadow);
}

.reply-form-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--forum-shadow-lg);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 24px 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--forum-border);
    color: var(--forum-text-muted);
}

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

.auth-footer a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--forum-text);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    background: var(--forum-card-bg);
    color: var(--forum-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--forum-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--forum-radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--forum-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--forum-primary-hover);
}

.btn-secondary {
    background: var(--forum-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--forum-radius);
    margin-bottom: 16px;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

.create-topic-container {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 32px;
    box-shadow: var(--forum-shadow);
}

.topic-form {
    max-width: 800px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info {
    font-size: 14px;
    color: var(--forum-text-muted);
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.topic-header-info {
    flex: 1;
}

.topic-header-info .topic-title {
    margin-bottom: 4px;
}

.topic-meta {
    font-size: 14px;
    color: var(--forum-text-muted);
    margin: 0 0 24px 0;
}

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

.topic-actions .btn-secondary {
    background: transparent;
    color: var(--forum-text);
    border: 1px solid var(--forum-border);
}

.topic-actions .btn-secondary:hover {
    background: var(--forum-bg);
    border-color: var(--forum-text-muted);
}

.topic-actions .btn-danger {
    background: transparent;
    color: var(--forum-text);
    border: 1px solid var(--forum-border);
}

.topic-actions .btn-danger:hover {
    background: #fee2e2;
    border-color: var(--forum-danger);
    color: var(--forum-danger);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-header-left {
    display: flex;
    align-items: center;
}

.post-actions {
    display: flex;
    gap: 6px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-tiny {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-danger {
    background: var(--forum-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    color: var(--forum-text);
    border: 1px solid var(--forum-border);
}

.btn-outline:hover {
    background: var(--forum-bg);
    border-color: var(--forum-text-muted);
}

.btn-link {
    background: transparent;
    color: var(--forum-primary);
    padding: 10px 16px;
    border: none;
}

.btn-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--forum-primary-hover);
}

.edit-form-container {
    background: var(--forum-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.edit-post-form {
    padding: 16px 0;
}

.edit-post-form .form-textarea {
    margin-bottom: 12px;
}

.edit-post-form .form-actions {
    margin-top: 12px;
}

.post-modified {
    padding: 8px 20px;
    background: var(--forum-bg);
    border-top: 1px solid var(--forum-border);
    color: var(--forum-text-muted);
    font-style: italic;
}

.author-posts {
    font-size: 12px;
    color: var(--forum-text-muted);
    margin-top: 8px;
}

.login-prompt,
.topic-locked {
    background: var(--forum-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.post-original {
    border-left: none;
    background: var(--forum-bg);
    border-radius: var(--forum-radius);
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.post-original .author-avatar {
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-primary-hover));
}

.post-original .author-role {
    color: white;
    background: var(--forum-primary);
    font-weight: 500;
}

.post-reply {
    border-left: none;
    background: var(--forum-card-bg);
}

.post-reply .author-avatar {
    background: linear-gradient(135deg, var(--forum-secondary), #475569);
}

.post-reply .author-role {
    background: var(--forum-border);
    color: var(--forum-text-muted);
}

.post-reply .post-actions .btn-secondary {
    background: var(--forum-primary);
    color: white;
    border: none;
}

.post-reply .post-actions .btn-secondary:hover {
    background: var(--forum-primary-hover);
}

.post-reply .post-actions .btn-danger {
    background: var(--forum-danger);
    color: white;
}

.replies-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--forum-text);
    margin: 32px 0 16px 0;
    padding: 0 0 0 12px;
    border-left: 3px solid var(--forum-primary);
    display: flex;
    align-items: center;
}

.reply-button-container {
    margin-top: 24px;
    text-align: center;
}

.btn-reply {
    padding: 12px 32px;
    font-size: 16px;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.pagination-info {
    color: var(--forum-text-muted);
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    margin-right: 8px;
}

.badge-pinned {
    background: var(--forum-warning);
    color: white;
}

.badge-locked {
    background: var(--forum-secondary);
    color: white;
}

.topic-subforum {
    color: var(--forum-primary);
}

.login-prompt p,
.topic-locked p {
    margin: 0 0 16px 0;
    color: var(--forum-text-muted);
}

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

.subforum-header .subforum-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.topics-list {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
    overflow: hidden;
}

.topics-table {
    display: flex;
    flex-direction: column;
}

.topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--forum-border);
    text-decoration: none;
    color: var(--forum-text);
    transition: background-color 0.2s;
}

.topic-row:last-child {
    border-bottom: none;
}

.topic-row:hover {
    background-color: var(--forum-bg);
}

.topic-content {
    flex: 1;
}

.topic-content .topic-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--forum-text);
}

.topic-row:hover .topic-title {
    color: var(--forum-primary);
}

.topic-content .topic-meta {
    font-size: 13px;
    color: var(--forum-text-muted);
}

.topic-row .topic-stats {
    font-size: 13px;
    color: var(--forum-text-muted);
    text-align: right;
    white-space: nowrap;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--forum-text-muted);
}

.empty-state h3 {
    margin: 0;
    font-weight: 500;
}

.post-attachments {
    padding: 16px 20px;
    background: var(--forum-bg);
    border-top: 1px solid var(--forum-border);
}

.attachment-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
}

.attachment-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--forum-card);
    border: 1px solid var(--forum-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--forum-text);
    font-size: 13px;
    transition: all 0.2s;
}

.attachment-item a:hover {
    border-color: var(--forum-primary);
    color: var(--forum-primary);
}

.attachment-icon {
    display: flex;
    align-items: center;
    color: var(--forum-text-muted);
}

.attachment-item a:hover .attachment-icon {
    color: var(--forum-primary);
}

.attachment-size {
    color: var(--forum-text-muted);
    font-size: 12px;
}

.attachment-pdf .attachment-icon { color: #dc2626; }
.attachment-doc .attachment-icon { color: #2563eb; }
.attachment-image .attachment-icon { color: #16a34a; }

.attachment-upload {
    margin-top: 16px;
}

.attachment-upload label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--forum-card);
    border: 2px solid var(--forum-border);
    border-radius: var(--forum-radius);
    cursor: pointer;
    font-weight: 500;
    color: var(--forum-text);
    transition: all 0.2s;
}

.attachment-upload label:hover {
    border-color: var(--forum-primary);
    color: var(--forum-primary);
}

.attachment-label-icon {
    display: flex;
    align-items: center;
}

.attachment-upload input[type="file"] {
    display: none;
}

.attachment-preview {
    margin-top: 12px;
}

.selected-files {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selected-files li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--forum-bg);
    border: 1px solid var(--forum-border);
    border-radius: 6px;
    font-size: 13px;
}

.selected-files .file-name {
    color: var(--forum-text);
}

.selected-files .file-size {
    color: var(--forum-text-muted);
    font-size: 12px;
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--forum-text-muted);
}

.existing-attachments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--forum-border);
}

.existing-attachments > label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--forum-text);
}

.attachment-edit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-edit-item {
    display: flex;
    align-items: center;
}

.attachment-delete-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.attachment-delete-label:hover {
    background: #fee2e2;
    border-color: var(--forum-danger);
}

.attachment-delete-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.attachment-delete-label input[type="checkbox"]:checked + .attachment-icon,
.attachment-delete-label input[type="checkbox"]:checked ~ .attachment-name {
    text-decoration: line-through;
    opacity: 0.6;
}

.attachment-delete-label .delete-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--forum-danger);
    opacity: 0;
    transition: opacity 0.2s;
}

.attachment-delete-label:hover .delete-hint {
    opacity: 1;
}

@media (max-width: 768px) {
    .modernforum {
        padding: 16px;
    }

    .post-item {
        flex-direction: column;
    }

    .post-author {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--forum-border);
        padding: 16px;
    }

    .subforum-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .subforum-stats {
        text-align: left;
        margin-top: 8px;
    }

    .subforum-stats span {
        display: inline;
        margin-right: 12px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-block-mobile {
        width: 100%;
    }

    .profile-header-card {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar-section {
        margin-bottom: 20px;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-meta {
        align-items: center;
    }
}

.author-avatar-link {
    display: block;
    text-decoration: none;
}

.author-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid var(--forum-border);
    transition: border-color 0.2s;
}

.author-avatar-link:hover .author-avatar-img {
    border-color: var(--forum-primary);
}

a.author-avatar {
    text-decoration: none;
    color: white;
}

a.author-name {
    text-decoration: none;
    color: var(--forum-text);
}

a.author-name:hover {
    color: var(--forum-primary);
}

.profile-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-header-card {
    display: flex;
    gap: 32px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 32px;
    box-shadow: var(--forum-shadow);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--forum-border);
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--forum-primary), var(--forum-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: 600;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-info-section {
    flex: 1;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.profile-username {
    font-size: 16px;
    color: var(--forum-text-muted);
    margin: 0 0 20px 0;
}

.profile-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.profile-stats .stat-item {
    display: flex;
    flex-direction: column;
}

.profile-stats .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--forum-text);
}

.profile-stats .stat-label {
    font-size: 13px;
    color: var(--forum-text-muted);
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--forum-text-muted);
}

.profile-meta .meta-item svg {
    flex-shrink: 0;
}

.profile-meta .meta-item a {
    color: var(--forum-primary);
    text-decoration: none;
}

.profile-meta .meta-item a:hover {
    text-decoration: underline;
}

.profile-edit-card,
.profile-signature-card,
.profile-activity-card {
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 24px;
    box-shadow: var(--forum-shadow);
}

.profile-edit-card h2,
.profile-signature-card h3,
.profile-activity-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--forum-border);
}

.profile-form {
    max-width: 600px;
}

.signature-content {
    color: var(--forum-text-muted);
    font-style: italic;
    line-height: 1.6;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    border-bottom: 1px solid var(--forum-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    text-decoration: none;
    transition: background-color 0.2s;
}

.activity-link:hover .activity-title {
    color: var(--forum-primary);
}

.activity-title {
    font-weight: 500;
    color: var(--forum-text);
}

.activity-meta {
    font-size: 13px;
    color: var(--forum-text-muted);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--forum-card-bg);
    border-radius: var(--forum-radius);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--forum-shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--forum-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--forum-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--forum-text);
}

.avatar-upload-form {
    padding: 20px;
}

.avatar-preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px dashed var(--forum-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--forum-bg);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-placeholder {
    color: var(--forum-text-muted);
}

.file-select-btn {
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.captcha-group {
    background: var(--forum-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    padding: 16px;
}

.captcha-group > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--forum-text);
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.captcha-problem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--forum-card-bg);
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    font-family: monospace;
    font-size: 20px;
    font-weight: 600;
}

.captcha-num {
    color: var(--forum-text);
}

.captcha-op {
    color: var(--forum-primary);
    font-weight: 700;
}

.captcha-eq {
    color: var(--forum-text-muted);
}

.captcha-input {
    width: 80px;
    text-align: center;
    font-size: 18px;
    font-family: monospace;
    font-weight: 600;
}

.captcha-hint {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: var(--forum-text-muted);
}

.auth-info {
    text-align: center;
    color: var(--forum-text-muted);
    margin-bottom: 20px;
}

.auth-actions {
    margin-top: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--forum-text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid var(--forum-border);
    border-radius: var(--forum-radius);
    background: var(--forum-card-bg);
    color: var(--forum-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--forum-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modernforum .forum-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.modernforum .forum-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.modernforum .forum-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--forum-text-muted);
    pointer-events: none;
    z-index: 1;
    width: 16px;
    height: 16px;
}

.modernforum .forum-search-input {
    padding: 9px 14px 9px 36px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border: 1px solid var(--forum-border) !important;
    border-radius: var(--forum-radius, 8px) !important;
    background: var(--forum-card-bg) !important;
    color: var(--forum-text) !important;
    width: 220px;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.modernforum .forum-search-input:focus {
    outline: none !important;
    border-color: var(--forum-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    width: 280px;
}

.modernforum .forum-search-input::placeholder {
    color: var(--forum-text-muted);
    opacity: 1;
}

.modernforum .forum-search-form--page {
    margin-bottom: 24px;
    gap: 10px;
}

.modernforum .forum-search-form--page .forum-search-input-wrap {
    flex: 1;
}

.modernforum .forum-search-input--large {
    width: 100% !important;
    padding: 12px 16px 12px 42px !important;
    font-size: 16px !important;
}

.modernforum .forum-search-input--large:focus {
    width: 100% !important;
}

.modernforum .forum-search-form--page .forum-search-icon {
    left: 14px;
}

@media (max-width: 768px) {
    .modernforum .forum-search-input {
        width: 160px;
    }

    .modernforum .forum-search-input:focus {
        width: 200px;
    }
}

.modernforum .post-thanks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--forum-border);
}

.modernforum .thanks-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--forum-text-muted);
    background: transparent;
    border: 1px solid var(--forum-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.modernforum .thanks-btn:hover {
    color: var(--forum-primary);
    border-color: var(--forum-primary);
    background: rgba(37, 99, 235, 0.05);
}

.modernforum .thanks-btn--active {
    color: var(--forum-primary);
    border-color: var(--forum-primary);
    background: rgba(37, 99, 235, 0.08);
}

.modernforum .thanks-btn--active:hover {
    background: rgba(37, 99, 235, 0.12);
}

.modernforum .thanks-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.modernforum .thanks-btn svg {
    flex-shrink: 0;
}

.modernforum .thanks-count {
    font-weight: 600;
}

.modernforum .thanks-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--forum-text-muted);
    border: 1px solid var(--forum-border);
    border-radius: 20px;
}

.modernforum .thanks-users {
    font-size: 12px;
    color: var(--forum-text-muted);
    line-height: 1.4;
}

.modernforum .thanks-users-label {
    font-weight: 600;
}

.forum-powered-by {
    text-align: center;
    padding: 24px 16px;
    margin-top: 32px;
    border-top: 1px solid var(--forum-border);
    font-size: 12px;
    color: var(--forum-text-muted);
}

.forum-powered-by a {
    color: var(--forum-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.forum-powered-by a:hover {
    color: var(--forum-primary);
}
