:root {
    --daofa-primary: #556b2f;
    --daofa-primary-dark: #3a4a20;
    --daofa-primary-light: #8fa06f;
    --daofa-accent: #c0392b;
    --daofa-bg: #f4f1ea;
    --daofa-text: #2c3e50;
    --daofa-border: #d0d7c2;
    --daofa-card-bg: rgba(255, 255, 255, 0.9);
    --daofa-shadow: 0 4px 6px rgba(85, 107, 47, 0.1);
    --daofa-parchment: #fdfbf7;
}

body {
    background-color: var(--daofa-bg);
    color: var(--daofa-text);
    font-family: "Noto Serif SC", "STSong", "SimSun", serif;
}

a {
    color: var(--daofa-primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--daofa-primary-dark);
}

/* Layout Fixes */
.main-content {
    padding-top: 20px;
    min-height: calc(100vh - 200px);
}

/* Admin Specific */
body.daofa-theme.admin-page {
    background-color: #f8f9fa; /* Admin uses lighter bg */
}

body.daofa-theme.admin-page .navbar {
    background-color: var(--daofa-primary-dark) !important;
    background-image: linear-gradient(to right, var(--daofa-primary-dark), var(--daofa-primary));
}

body.daofa-theme.admin-page .sidebar {
    background-color: #fff;
    border-right: 1px solid var(--daofa-border);
}

body.daofa-theme.admin-page .card {
    border: 1px solid var(--daofa-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Admin Sidebar */
@media (min-width: 768px) {
    .daofa-sidebar {
        min-height: calc(100vh - 56px);
        background-color: #fff;
        border-right: 1px solid var(--daofa-border);
        box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    }
}

/* Login/Register Toggle */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: var(--daofa-primary);
    color: #fff;
}

.nav-link {
    color: var(--daofa-text);
}

/* Search Results */
.search-result-item {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--daofa-border);
    transition: transform 0.2s;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Post Cards */
.post-card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Daofa Layout Components */
.daofa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.daofa-header {
    text-align: center;
    padding: 60px 0 40px;
    position: relative;
}

.daofa-title {
    font-family: "KaiTi", "STKaiti", serif;
    font-size: 3rem;
    color: var(--daofa-primary-dark);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.daofa-subtitle {
    font-size: 1.2rem;
    color: #666;
    letter-spacing: 2px;
}

/* Cards */
.daofa-card {
    background: var(--daofa-card-bg);
    border: 1px solid var(--daofa-border);
    border-radius: 8px;
    box-shadow: var(--daofa-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23556b2f' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.daofa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(85, 107, 47, 0.15);
}

.daofa-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--daofa-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.daofa-card:hover::before {
    transform: scaleX(1);
}

.daofa-card-body {
    padding: 1.5rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.daofa-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--daofa-text);
    font-weight: bold;
    font-family: "KaiTi", serif;
}

.daofa-card-title a {
    color: var(--daofa-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.daofa-card-title a:hover {
    color: var(--daofa-primary);
}

.daofa-card-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--daofa-border);
    padding-bottom: 0.5rem;
}

.daofa-card-text {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.daofa-card-img {
    overflow: hidden;
    border-bottom: 1px solid var(--daofa-border);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.daofa-card-img img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.daofa-card:hover .daofa-card-img img {
    transform: scale(1.1);
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--daofa-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(85, 107, 47, 0.15);
    position: relative;
    z-index: 10;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23556b2f' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Buttons */
.daofa-btn, .btn-daofa {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--daofa-primary);
    color: #fff;
    border: 1px solid var(--daofa-primary);
    border-radius: 4px;
    transition: all 0.3s;
}

.daofa-btn:hover, .btn-daofa:hover {
    background-color: var(--daofa-primary-dark);
    border-color: var(--daofa-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.daofa-link {
    color: var(--daofa-primary);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.daofa-link:hover {
    color: var(--daofa-accent);
    padding-left: 5px;
}

/* Background Effects */
.daofa-bg-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.8) 0%, rgba(244,241,234,1) 100%);
    pointer-events: none;
}

.daofa-bagua-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 C77.6 0 100 22.4 100 50 C100 77.6 77.6 100 50 100 C22.4 100 0 77.6 0 50 C0 22.4 22.4 0 50 0 Z M50 2 C23.5 2 2 23.5 2 50 C2 76.5 23.5 98 50 98 C76.5 98 98 76.5 98 50 C98 23.5 76.5 2 50 2 Z' fill='%23556b2f' fill-opacity='0.03'/%3E%3Cpath d='M50 10 C50 10 50 30 50 50 C50 70 50 90 50 90 C28 90 10 72 10 50 C10 28 28 10 50 10 Z' fill='%23556b2f' fill-opacity='0.03'/%3E%3Ccircle cx='50' cy='30' r='5' fill='%23556b2f' fill-opacity='0.03'/%3E%3Ccircle cx='50' cy='70' r='5' fill='%23fff' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: -1;
    opacity: 0.5;
    animation: rotate 60s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.daofa-herb-deco {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 100 Q30 60 50 20 Q70 60 50 100 Z' fill='%23556b2f' fill-opacity='0.1'/%3E%3Cpath d='M60 100 Q40 70 60 40 Q80 70 60 100 Z' fill='%23556b2f' fill-opacity='0.08'/%3E%3Cpath d='M40 100 Q20 70 40 40 Q60 70 40 100 Z' fill='%23556b2f' fill-opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom right;
    background-size: contain;
    z-index: -1;
    pointer-events: none;
}

.daofa-herb-deco-left {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 250px;
    height: 250px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 100 Q30 60 50 20 Q70 60 50 100 Z' fill='%23556b2f' fill-opacity='0.08'/%3E%3Cpath d='M60 100 Q40 70 60 40 Q80 70 60 100 Z' fill='%23556b2f' fill-opacity='0.06'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: contain;
    z-index: -1;
    transform: scaleX(-1);
    pointer-events: none;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Private Consultation Banner */
.private-banner {
    padding: 60px 0 40px;
    text-align: center;
    background-color: transparent;
}

.private-banner-title {
    font-family: "Noto Serif SC", "STKaiti", serif;
    font-weight: bold;
    color: var(--daofa-primary-dark);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.private-banner-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.private-banner-secure {
    display: inline-block;
    background-color: rgba(85, 107, 47, 0.1);
    color: var(--daofa-primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid rgba(85, 107, 47, 0.2);
}

/* Chat Room Enhancements */
.daofa-nickname-badge {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 20px 4px 20px 4px;
    font-size: 0.85rem;
    font-weight: bold;
    border-width: 1.5px;
    border-style: solid;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08), inset 0 0 10px rgba(255,255,255,1);
    margin-bottom: 4px;
    font-family: "KaiTi", serif;
    transition: all 0.3s ease;
    text-shadow: 0 0 1px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

.daofa-nickname-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nickname-color-0 { color: #556b2f; border-color: #556b2f; background-color: rgba(85, 107, 47, 0.05); }
.nickname-color-1 { color: #c0392b; border-color: #c0392b; background-color: rgba(192, 57, 43, 0.05); }
.nickname-color-2 { color: #2980b9; border-color: #2980b9; background-color: rgba(41, 128, 185, 0.05); }
.nickname-color-3 { color: #8e44ad; border-color: #8e44ad; background-color: rgba(142, 68, 173, 0.05); }
.nickname-color-4 { color: #d35400; border-color: #d35400; background-color: rgba(211, 84, 0, 0.05); }
.nickname-color-5 { color: #16a085; border-color: #16a085; background-color: rgba(22, 160, 133, 0.05); }
.nickname-color-6 { color: #7f8c8d; border-color: #7f8c8d; background-color: rgba(127, 140, 141, 0.05); }

.daofa-message-nickname {
    display: none; /* Hide old nickname style */
}

.daofa-message.self .daofa-message-nickname {
    text-align: right;
    color: var(--daofa-primary);
}

.daofa-message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 5px;
}

.daofa-message.self .daofa-message-time {
    margin-left: 0;
    margin-right: 5px;
}

.daofa-chat-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--daofa-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.daofa-chat-header {
    padding: 15px 20px;
    background-color: var(--daofa-primary);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
 
.daofa-chat-title {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.7);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2), 0 0 12px rgba(255,255,255,0.35), inset 0 0 8px rgba(255,255,255,0.2);
    font-family: "KaiTi", serif;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.daofa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: rgba(255,255,255,0.6);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23556b2f' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.daofa-message {
    margin-bottom: 15px;
    max-width: 80%;
    clear: both;
    position: relative;
}

.daofa-message.self {
    float: right;
}

.daofa-message.other {
    float: left;
}

.daofa-message-content {
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    line-height: 1.5;
}

.daofa-message.self .daofa-message-content {
    background-color: var(--daofa-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    background-image: linear-gradient(135deg, var(--daofa-primary), var(--daofa-primary-light));
}

.daofa-message.other .daofa-message-content {
    background-color: #fff;
    border: 1px solid var(--daofa-border);
    border-bottom-left-radius: 4px;
    color: var(--daofa-text);
}

.daofa-message-meta {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.8;
}

.daofa-message.self .daofa-message-meta {
    text-align: right;
    color: rgba(255,255,255,0.8);
}

.daofa-message.other .daofa-message-meta {
    text-align: left;
    color: #999;
}

.daofa-chat-input {
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid var(--daofa-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.daofa-chat-input textarea {
    flex: 1;
    border: 1px solid var(--daofa-border);
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    outline: none;
    transition: all 0.3s;
    background-color: #f9f9f9;
}

.daofa-chat-input textarea:focus {
    border-color: var(--daofa-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.1);
}

/* Consultation Form Styles */
.daofa-form-panel {
    background-color: var(--daofa-parchment);
    border: 1px solid var(--daofa-border);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    margin-bottom: 30px;
}

.daofa-form-panel::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid var(--daofa-border);
    pointer-events: none;
    border-radius: 4px;
}

.daofa-form-title {
    text-align: center;
    margin-bottom: 30px;
    font-family: "KaiTi", serif;
    color: var(--daofa-primary-dark);
    font-size: 1.5rem;
    border-bottom: 1px solid var(--daofa-border);
    padding-bottom: 15px;
}

.daofa-form-group {
    margin-bottom: 25px;
}

.daofa-form-label {
    font-weight: bold;
    color: var(--daofa-primary-dark);
    margin-bottom: 8px;
    display: block;
}

.daofa-form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--daofa-border);
    background-color: rgba(255,255,255,0.5);
    border-radius: 4px;
    transition: all 0.3s;
    font-family: inherit;
}

.daofa-form-control:focus {
    border-color: var(--daofa-primary);
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.1);
}

.daofa-upload-box {
    border: 2px dashed var(--daofa-border);
    padding: 30px;
    text-align: center;
    background-color: rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.daofa-upload-box:hover {
    border-color: var(--daofa-primary);
    background-color: rgba(85, 107, 47, 0.05);
}

/* Product Grid */
.daofa-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.daofa-product-card {
    background: #fff;
    border: 1px solid var(--daofa-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.daofa-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.daofa-product-img-wrapper {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background-color: #f8f9fa;
}

.daofa-product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.daofa-product-card:hover .daofa-product-img {
    transform: scale(1.1);
}

.daofa-product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--daofa-accent);
    color: #fff;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    z-index: 2;
}

.daofa-product-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.daofa-product-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--daofa-text);
}

.daofa-tags {
    margin-bottom: 10px;
}

.daofa-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    background-color: rgba(85, 107, 47, 0.1);
    color: var(--daofa-primary);
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.daofa-product-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.daofa-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.daofa-price {
    font-size: 1.25rem;
    color: var(--daofa-accent);
    font-weight: bold;
}

/* 一闪一闪文字标签效果 */
.blink-text {
    animation: daofa-blink 1s infinite;
}

@keyframes daofa-blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}
