/* ============================================================
   common.css - 发文站 全局公共样式
   版本：2.0 - 匹配参考设计
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #111827;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #f3f4f6;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.navbar-logo .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2D5F4C;
}

.navbar-logo .domain {
    font-size: 0.7rem;
    color: #6b7280;
    display: none;
}

@media (min-width: 640px) {
    .navbar-logo .domain {
        display: inline;
    }
}

.navbar-nav {
    display: none;
    align-items: center;
    gap: 4px;
}

@media (min-width: 768px) {
    .navbar-nav {
        display: flex;
    }
}

.navbar-nav a {
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    color: #4b5563;
}

.navbar-nav a:hover {
    background: #f3f4f6;
}

.navbar-nav a.active {
    background: #E8F5E9;
    color: #2D5F4C;
    font-weight: 500;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-actions .vip-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #FF6B35;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.navbar-actions .vip-link:hover {
    background: rgba(255, 107, 53, 0.1);
}

.navbar-actions .vip-link i {
    font-size: 0.85rem;
}

.navbar-actions .user-area {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-actions .user-area .profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #2D5F4C;
    border-radius: 8px;
    transition: background 0.15s;
}

.navbar-actions .user-area .profile-link:hover {
    background: #E8F5E9;
}

.navbar-actions .user-area .logout-btn {
    padding: 8px;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    background: none;
    border: none;
}

.navbar-actions .user-area .logout-btn:hover {
    background: #f3f4f6;
}

.navbar-actions .user-area .login-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #2D5F4C;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.navbar-actions .user-area .login-btn:hover {
    border-color: #2D5F4C;
    background: #f9fafb;
}

.mobile-menu-btn {
    display: block;
    padding: 8px;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* ---------- 浮动咨询按钮 ---------- */
.floating-consult {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    width: 56px;
    height: 56px;
    background: #FF6B35;
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 1.4rem;
    transition: all 0.2s;
}

.floating-consult:hover {
    background: rgba(255, 107, 53, 0.9);
    transform: scale(1.1);
}

/* ---------- 底部微信联系区域 ---------- */
.footer-contact {
    background: #f0faf5;
    padding: 40px 0;
    border-top: 1px solid #d1fae5;
}

.footer-contact-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.contact-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    width: 56px;
    height: 56px;
    background: #2d6a4f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d6a4f;
    margin-bottom: 4px;
}

.contact-wechat {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.contact-wechat i {
    color: #07c160;
    margin-right: 4px;
}

.contact-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}

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

.contact-qr {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    border: 3px solid #2d6a4f;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.contact-qr-tip {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .footer-contact-inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    .contact-left {
        flex-direction: column;
        text-align: center;
    }
    .contact-qr {
        width: 130px;
        height: 130px;
    }
}

/* ---------- 底部版权 ---------- */
.footer {
    background: #2D5F4C;
    color: white;
    padding: 24px 0;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 0;
    opacity: 0.9;
}

/* ---------- 卡片 ---------- */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ---------- 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2D5F4C;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.btn-primary:hover {
    background: rgba(45, 95, 76, 0.9);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #2D5F4C;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    border: 2px solid #2D5F4C;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.btn-secondary:hover {
    background: #2D5F4C;
    color: white;
}

.btn-orange {
    background: #FF6B35;
    color: white;
}

.btn-orange:hover {
    background: rgba(255, 107, 53, 0.9);
}

.btn-full {
    width: 100%;
}

.btn-pill {
    border-radius: 40px;
}

/* ---------- 模态框 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-box input,
.modal-box select,
.modal-box textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus {
    outline: none;
    border-color: #2D5F4C;
    box-shadow: 0 0 0 3px rgba(45, 95, 76, 0.1);
}

.modal-box .btn-primary {
    width: 100%;
}

.modal-box .btn-close {
    margin-top: 8px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.tag-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-green {
    background: #d1fae5;
    color: #065f46;
}

.tag-orange {
    background: #fef3c7;
    color: #b45309;
}

.tag-purple {
    background: #ede9fe;
    color: #6d28d9;
}

.tag-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* ---------- 订单状态标签 ---------- */
.status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background: #e6f7ec;
    color: #2c6e3c;
}

.status-processing {
    background: #fff7e5;
    color: #b45309;
}

.status-pending {
    background: #f1f5f9;
    color: #5c6f87;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination button,
.pagination .page-number {
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover,
.pagination .page-number:hover {
    background: #f3f4f6;
}

.pagination .active {
    background: #2D5F4C;
    color: white;
    border-color: #2D5F4C;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 筛选按钮 ---------- */
.filter-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #d1d5db;
    border-radius: 30px;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #2D5F4C;
    color: #2D5F4C;
}

.filter-btn.active {
    background: #2D5F4C;
    color: white;
    border-color: #2D5F4C;
}

/* ---------- 输入框 ---------- */
.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
}

.input-field:focus {
    outline: none;
    border-color: #2D5F4C;
    box-shadow: 0 0 0 3px rgba(45, 95, 76, 0.1);
}

select.input-field {
    appearance: none;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 36px;
}

/* ---------- 工具类 ---------- */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.mb-8 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ---------- 响应式工具 ---------- */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
    .container {
        padding: 0 16px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}
