/* ========================================
 * Common Styles - shared by desktop & mobile
 * ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    word-wrap: break-word;
}

main {
    flex: 1;
    padding: 10px 0 20px 0;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    empty-cells: show;
}

caption,
th {
    text-align: left;
    font-weight: 400;
}

label {
    cursor: pointer;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
    padding: 6px 10px;
    border: 1px solid var(--ft-border);
    background-color: #f0fdf4;
    border-radius: var(--ft-radius-sm);
    outline: none;
    transition: border-color var(--ft-transition-fast);
    font-size: var(--ft-font-size-base);
    font-family: var(--ft-font-family);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--ft-primary);
}

#wp {
    min-height: 400px;
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

.none {
    display: none;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.cl:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

.z {
    float: left;
}

.y {
    float: right;
}

.vm {
    vertical-align: middle;
}

.edit-action-danger {
    background: #983535;
    color: white;
}

.topic-edit-button {
    font-size: 12px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
}

.mtn {
    margin-top: 5px;
}

.mbn {
    margin-bottom: 5px;
}

.mtm {
    margin-top: 10px;
}

.mbm {
    margin-bottom: 10px;
}

.mtw {
    margin-top: 20px;
}

.mbw {
    margin-bottom: 20px;
}

.ptn {
    padding-top: 5px;
}

.pbn {
    padding-bottom: 5px;
}

.ptm {
    padding-top: 10px;
}

.pbm {
    padding-bottom: 10px;
}

.bbda {
    border-bottom: 1px dashed #cdcdcd;
}

.bw0 {
    border: none;
}

.avt img {
    padding: 2px;
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    background: #fff;
    border: 1px solid #cdcdcd;
    border-radius: 5px;
    box-sizing: border-box;
}

.avtm img {
    width: 120px;
    height: auto;
    max-width: 120px;
}

.avts img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    vertical-align: middle;
}

.avt {
    display: inline-block;
}

.modal-overlay[style*="display: flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.breadcrumb-link {
    color: #1e7e34;
    text-decoration: none;
}

.logo-img img {
    max-width: 180px;
    height: auto;
}

input[type="radio"],
input[type="checkbox"] {
    accent-color: #1e7e34;
}

.auth-btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.auth-btn-primary {
    background: #b8860b;
    color: #fff;
    width: 100%;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #8b6914;
}

.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.auth-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.justify-end {
    justify-content: flex-end;
}

.flex-1 {
    flex: 1;
}

.message-username-bold {
    font-weight: 400;
}

.messageform {
    margin: 0.5em 0;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-start {
    justify-content: flex-start;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.px-1 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.rounded {
    border-radius: 0.25rem;
}

.ml-auto {
    margin-left: auto;
}

.padding-top-15 {
    padding-top: 15px;
}

.mt-1 {
    margin-top: 0.25rem;
}

.btn-primary {
    background: #b8860b;
    color: #fff;
    border: none;
    font-weight: 400;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
    border: none;
    font-weight: 400;
}

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

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    font-weight: 400;
}

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

.btn-cancel {
    background: #e5e7eb;
    color: #374151;
    border: none;
    font-weight: 400;
}

.btn-cancel:hover {
    background: #d1d5db;
}

.text-primary {
    color: #1e7e34;
}

.text-primary-dark {
    color: #0a4220;
}

.text-link {
    color: #0d5c2e;
}

.text-gray-600 {
    color: #666;
}

.text-gray-500 {
    color: #999;
}

.text-gray-400 {
    color: #a3a3a3;
}

.text-gray-300 {
    color: #9ca3af;
}

.text-red {
    color: #dc2626;
}

.text-dark {
    color: #1f2937;
}

.btn-upload {
    background-color: var(--ft-primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.btn-upload:hover {
    background-color: var(--ft-primary-dark);
}

.btn-submit {
    background-color: var(--ft-primary);
    color: white;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--ft-primary-dark);
}

.editor-container {
    border: 1px solid #cdcdcd;
    background-color: #fff;
}

.quill-editor-container {
    border: 1px solid #cdcdcd;
    background-color: #fff;
}

.color-option-red {
    color: #ee1b2e;
}

.color-option-blue {
    color: #1e8a5e;
}

.color-option-green {
    color: #3c9d40;
}

.color-option-default {
    color: #333333;
}

.attach-item {
    position: relative;
    display: inline-flex;
    margin: 0 5px;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    vertical-align: top;
}

.attach-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.delete-attach-btn-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
}

.attach-item-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 5px;
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    font-size: 12px;
}

.delete-attach-btn-file {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #999;
}

.drag-handle {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: move;
}

.forum-item {
    padding: 0.375rem 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.forum-item.bg-gray-100 {
    background: #f9fafb;
}

.hidden-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.0625rem 0.125rem;
    font-size: 0.7rem;
    border-radius: 9999px;
}

.recipe-info-container {
    flex: 1;
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.category-item:hover {
    background-color: #f9f9f9;
}

.yaofang-count {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 12px;
    margin-right: 0.5rem;
}

.enter-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    border: none;
    background: none;
    transition: all 0.2s;
}

.recipe-item {
    display: flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.recipe-item:hover {
    background-color: #f9f9f9;
}

.recipe-status-tag {
    padding: 0.0625rem 0.125rem;
    font-size: 0.7rem;
    line-height: 0.8em;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
}

.recipe-status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.recipe-status-inactive {
    background: #f3f4f6;
    color: #4b5563;
}

.recipe-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #374151;
    font-size: 0.875rem;
}

.quick-reply-link {
    color: #1e7e34 !important;
    text-decoration: none;
    cursor: pointer;
    margin: 0 10px;
}

.quick-reply-link:first-child {
    margin-right: 10px;
    margin-left: 0;
}

.quick-reply-link:last-child {
    margin-left: 10px;
    margin-right: 0;
}

.breadcrumb-link:hover {
    color: #0a4220;
}

.auth-success-title {
    margin-bottom: 8px;
    color: #111;
    font-size: 17px;
    font-weight: 400;
}

.auth-success-message {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
}

.auth-success-note {
    color: #9ca3af;
    font-size: 12px;
}

.auth-link {
    margin-top: 20px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.gap-3 {
    gap: 0.75rem;
}

.admin-page {
    padding: 16px 8px;
}

.bm_h a {
    color: #333;
}

.pt {
    overflow-y: auto;
}

select {
    padding: 2px;
}

.notice {
    clear: both;
    margin: 5px 0;
    padding: 3px 5px 3px 20px;
    background: #fefee9;
    border: 1px solid #cdcdcd;
}

#ft a {
    color: #666;
}

#scbar form,
#scbar table {
    width: 100%;
}

#scbar td {
    vertical-align: middle;
    padding: 0 5px;
}

.scbar_txt_td {
    width: 100%;
}

.scbar_txt_td input[type="text"]:focus {
    border-color: #1e7e34;
}

.scbar_btn_td {
    white-space: nowrap;
}

#pt {
    margin-bottom: 10px;
    padding: 5px 0;
}

#pt em {
    margin-right: 5px;
    font-style: normal;
    color: #999;
    font-family: simsun, serif;
    font-weight: 400;
}

#pt a {
    color: #1e7e34;
    text-decoration: none;
}

.pcb .t_fsz {
    margin: 0;
    padding: 0;
}

.pcb .t_fsz table {
    border: none;
    margin: 0;
    padding: 0;
    width: auto;
}

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

.form-input:focus {
    border-color: #1e7e34;
}

.form-textarea:focus {
    border-color: #1e7e34;
}

.alert-error {
    background: #fff2f2;
    border-color: #ffcccc;
    color: #cc0000;
}

.alert-success {
    background: #f2ffe2;
    border-color: #ccff99;
    color: #006600;
}

#f_pst {
    margin-top: 10px;
    border: none;
}

#f_pst .pbt {
    padding-bottom: 8px;
    margin-bottom: 8px;
}

#f_pst .pnpost {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px dashed #e5e5e5;
}

.bml .bm_h {
    background-color: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
    padding: 12px 15px;
    height: auto;
    line-height: 1.5;
}

.bml .xs2 a {
    color: #1e7e34;
    text-decoration: none;
}

#pgt {
    margin: 10px 0;
}

#pgt img {
    vertical-align: middle;
    margin-right: 5px;
}

.confirm-dialog.show {
    display: block;
}

.dialog-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.dialog-body {
    padding: 20px;
}

.dialog-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.cancel-btn {
    background: #e5e7eb;
    color: #374151;
}

#messageContainer {
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ft-border) transparent;
}

#messageContainer::-webkit-scrollbar {
    width: 6px;
}

#messageContainer::-webkit-scrollbar-track {
    background: transparent;
}

#messageContainer::-webkit-scrollbar-thumb {
    background-color: var(--ft-border);
    border-radius: var(--ft-radius-full);
}

.message-list {
    background-color: var(--ft-card);
    border: 1px solid var(--ft-border);
    overflow: hidden;
}

.message-item.unread {
    background-color: #fffce8;
    position: relative;
}

.message-item.unread .message-title {
    font-weight: 700;
}

.message-item.unread .message-username-bold {
    font-weight: 700;
}

.message-item.unread .message-preview {
    font-weight: 700;
}

.message-item.unread .message-time {
    font-weight: 700;
}

.message-item.unread .message-subject {
    font-weight: 400;
}

.message-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--ft-primary);
    border-radius: var(--ft-radius-full);
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.unread-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 1rem;
    height: 1rem;
    background-color: var(--ft-destructive);
    border-radius: var(--ft-radius-full);
    border: 2px solid var(--ft-card);
}

.message-detail {
    background-color: var(--ft-card);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-xl);
    overflow: hidden;
}

.message-detail-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ft-border);
    background-color: var(--ft-gray-50);
}

.message-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.message-detail-meta-item svg {
    width: 1rem;
    height: 1rem;
}

.message-detail-body p {
    margin-bottom: 1rem;
}

.message-detail-body p:last-child {
    margin-bottom: 0;
}

#messageForm {
    padding: 0;
}

#messageInput {
    width: 100%;
    box-sizing: border-box;
}

.gap-1 {
    gap: 0.25rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.text-xxs {
    font-size: 0.625rem;
}

#messageContainer a,
#messageContainer a:visited,
#messageContainer a:link {
    color: #1e7e34;
    text-decoration: none;
}

#confirm-dialog {
    display: none;
}

#confirm-dialog.show {
    display: block;
    z-index: 10000 !important;
}

.message-reply {
    padding: 1.5rem;
    border-top: 1px solid var(--ft-border);
    background-color: var(--ft-gray-50);
}

.message-compose {
    background-color: var(--ft-card);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-xl);
    padding: 1.5rem;
}

.conversation-list {
    background-color: var(--ft-card);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-xl);
    overflow: hidden;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--ft-border);
    transition: all var(--ft-transition-fast);
    cursor: pointer;
}

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

.conversation-item.active {
    background-color: rgba(0, 83, 185, 0.1);
    border-left: 3px solid var(--ft-primary);
}

.conversation-avatar {
    position: relative;
}

.conversation-avatar .online-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    background-color: var(--ft-success);
    border: 2px solid var(--ft-card);
    border-radius: var(--ft-radius-full);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 400;
    color: var(--ft-foreground);
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

.chat-messages {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 80%;
}

.chat-message.sent {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--ft-radius-full);
    background-color: var(--ft-secondary);
    flex-shrink: 0;
    overflow: hidden;
}

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

.chat-message.received .chat-bubble {
    background-color: var(--ft-secondary);
    color: var(--ft-secondary-foreground);
    border-bottom-left-radius: var(--ft-radius-sm);
}

.chat-message.sent .chat-bubble {
    background: linear-gradient(
        135deg,
        var(--ft-primary) 0%,
        var(--ft-primary-dark) 100%
    );
    color: var(--ft-primary-foreground);
    border-bottom-right-radius: var(--ft-radius-sm);
}

.chat-message.sent .chat-message-time {
    text-align: left;
}

.messages-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.messages-empty-icon {
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        var(--ft-secondary) 0%,
        var(--ft-muted) 100%
    );
    border-radius: var(--ft-radius-full);
    color: var(--ft-muted-foreground);
}

.messages-empty-icon svg {
    width: 2.5rem;
    height: 2.5rem;
}

.error-page {
    min-height: 37vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(
        135deg,
        var(--ft-background) 0%,
        var(--ft-background-warm) 100%
    );
}

.error-container {
    max-width: 32rem;
    text-align: center;
}

.error-icon {
    width: 8rem;
    height: 8rem;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ft-radius-full);
    color: var(--ft-primary);
}

.error-icon svg {
    width: 4rem;
    height: 4rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.error-actions .btn {
    min-width: 8rem;
}

.error-404 .error-icon {
    animation: float 3s ease-in-out infinite;
}

.error-403 .error-icon {
    background: linear-gradient(
        135deg,
        rgba(199, 62, 62, 0.1) 0%,
        rgba(184, 92, 56, 0.1) 100%
    );
    color: var(--ft-destructive);
}

.error-503 .error-icon {
    animation: pulse 2s ease-in-out infinite;
}

.error-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.5;
}

.error-decoration-1 {
    top: 10%;
    left: 10%;
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--ft-primary) 0%, transparent 100%);
    border-radius: var(--ft-radius-full);
    filter: blur(40px);
}

.error-decoration-2 {
    bottom: 20%;
    right: 15%;
    width: 6rem;
    height: 6rem;
    background: linear-gradient(135deg, var(--ft-accent) 0%, transparent 100%);
    border-radius: var(--ft-radius-full);
    filter: blur(50px);
}

.error-decoration-3 {
    top: 30%;
    right: 10%;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(
        135deg,
        var(--ft-primary-light) 0%,
        transparent 100%
    );
    border-radius: var(--ft-radius-full);
    filter: blur(30px);
}

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

.form-field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-field-input,
.form-field-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-field-input:focus,
.form-field-textarea:focus {
    border-color: #1e7e34;
    outline: none;
}

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

.form-field-info {
    background: #eff6ff;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.form-section-header {
    font-size: 18px;
    font-weight: 700;
    color: #1e7e34;
    margin: 24px 0 12px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid #1e7e34;
}

.form-options-wrap {
    display: flex;
    flex-wrap: wrap;
}

.form-radio-label,
.form-checkbox-label {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    cursor: pointer;
}

.form-radio-label input,
.form-checkbox-label input {
    margin-right: 6px;
    accent-color: #1e7e34;
}

.form-radio-label span,
.form-checkbox-label span {
    font-size: 14px;
    color: #374151;
}

.form-radio-group {
    display: flex;
    align-items: center;
}

tr.auto-reply-post .t_f {
    color: #b8860b !important;
}

