/* 有心人666 - 主样式表 */
/* 响应式设计：适配手机、平板、电脑 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 头部 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo a {
    font-size: 22px;
    font-weight: bold;
    color: #e74c3c;
}
.main-nav ul { display: flex; gap: 5px; }
.main-nav a {
    display: block;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
}
.main-nav a:hover { background: #f0f0f0; color: #e74c3c; }
.header-right { display: flex; align-items: center; gap: 15px; }
.btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: inline-block;
}
.btn-login { background: #fff; border: 1px solid #e74c3c; color: #e74c3c; }
.btn-login:hover { background: #e74c3c; color: #fff; }
.btn-register { background: #e74c3c; color: #fff; }
.btn-register:hover { background: #c0392b; }
.btn-primary { background: #e74c3c; color: #fff; }
.btn-primary:hover { background: #c0392b; }
.btn-default { background: #fff; border: 1px solid #ddd; color: #333; }
.btn-default:hover { border-color: #e74c3c; color: #e74c3c; }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 30px; font-size: 16px; }

/* 用户下拉 */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.username { font-size: 14px; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    padding: 8px 0;
    z-index: 1001;
}
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    transition: background 0.2s;
}
.dropdown-menu a:hover { background: #f5f5f5; color: #e74c3c; }
.dropdown-menu hr { border: none; border-top: 1px solid #eee; margin: 5px 0; }

/* 消息图标 */
.msg-icon {
    position: relative;
    font-size: 18px;
    color: #666;
}
.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 公告栏 */
.announcement-bar {
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    padding: 8px 0;
    font-size: 14px;
    color: #f57c00;
}
.announcement-bar .container { display: flex; align-items: center; gap: 10px; }

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}
.mobile-menu {
    display: none;
    background: #fff;
    padding: 10px 0;
    border-top: 1px solid #eee;
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    border-bottom: 1px solid #f5f5f5;
}

/* 主内容区 */
.main-content { min-height: calc(100vh - 200px); padding: 20px 0; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

/* 网格布局 */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-tip { font-size: 12px; color: #999; margin-top: 4px; }

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.table th { background: #f8f9fa; font-weight: 600; color: #555; }
.table tr:hover { background: #fafafa; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.pagination .current { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}
.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

/* 底部 */
.site-footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 0;
    margin-top: 40px;
}
.footer-links {
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}
.footer-links a { color: #bdc3c7; transition: color 0.3s; }
.footer-links a:hover { color: #fff; }
.footer-links .sep { margin: 0 8px; color: #555; }
.copyright { text-align: center; font-size: 13px; color: #95a5a6; }

/* 服务卡片 */
.service-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.service-card-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f0f0f0;
}
.service-card-body { padding: 15px; }
.service-card-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.service-card-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.service-card-user span { font-size: 13px; color: #666; }
.service-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.service-card-price {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.search-box button {
    padding: 10px 25px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 聊天窗口 */
.chat-container {
    background: #fff;
    border-radius: 10px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}
.chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}
.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.chat-message-content {
    background: #f5f5f5;
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 70%;
}
.chat-message-name { font-size: 12px; color: #999; margin-bottom: 4px; }
.chat-message-text { font-size: 14px; word-break: break-all; }
.chat-message img { max-width: 200px; border-radius: 6px; margin-top: 5px; }
.chat-input-area {
    border-top: 1px solid #eee;
    padding: 15px;
}
.chat-input-row { display: flex; gap: 10px; margin-bottom: 10px; }
.chat-input-row input { flex: 1; }

/* 管理员后台 */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-sidebar a {
    display: block;
    padding: 12px 25px;
    color: #bdc3c7;
    transition: all 0.3s;
    font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: #34495e;
    color: #fff;
    padding-left: 30px;
}
.admin-sidebar .section-title {
    padding: 15px 25px 8px;
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
}
.admin-content {
    flex: 1;
    padding: 25px;
    background: #f5f7fa;
}
.admin-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.admin-stat-card .number {
    font-size: 32px;
    font-weight: bold;
    color: #e74c3c;
}
.admin-stat-card .label { font-size: 14px; color: #999; margin-top: 5px; }

/* 个人中心 */
.profile-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
}
.profile-info h2 { font-size: 24px; margin-bottom: 5px; }
.profile-info p { opacity: 0.9; font-size: 14px; }
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}
.tabs a {
    padding: 12px 25px;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}
.tabs a.active, .tabs a:hover {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state i { font-size: 48px; margin-bottom: 15px; }
.empty-state p { font-size: 15px; }

/* 响应式 - 平板 */
@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .admin-sidebar { width: 180px; }
}

/* 响应式 - 手机 */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .header-inner { height: 50px; }
    .logo a { font-size: 18px; }
    .username { display: none; }
    .main-content { padding: 10px 0; }
    .card { padding: 15px; }
    .search-box { flex-direction: column; }
    .chat-container { height: 500px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        padding: 10px 0;
        display: flex;
        overflow-x: auto;
    }
    .admin-sidebar a { padding: 10px 15px; white-space: nowrap; }
    .admin-sidebar .section-title { display: none; }
    .profile-header { flex-direction: column; text-align: center; }
    .tabs { overflow-x: auto; }
    .tabs a { padding: 10px 15px; white-space: nowrap; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 8px 6px; }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-red { color: #e74c3c; }
.text-green { color: #27ae60; }
.text-gray { color: #999; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.hidden { display: none !important; }

/* ===== 管理员后台入口样式 ===== */
.admin-nav-link {
    color: #e74c3c !important;
    font-weight: bold;
}
.admin-nav-link:hover {
    color: #c0392b !important;
}
.admin-dropdown-link {
    color: #e74c3c !important;
    font-weight: bold;
}
.admin-dropdown-link:hover {
    background: #fdf0ef !important;
}
.mobile-admin-link {
    color: #e74c3c !important;
    font-weight: bold;
    background: #fdf0ef;
    border-left: 3px solid #e74c3c;
}
.mobile-admin-link:hover {
    background: #fae5e3 !important;
}
.mobile-admin-link i {
    color: #e74c3c;
}
