/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft Yahei", sans-serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #37a;
}

a:hover {
    color: #005aa0;
}

ul {
    list-style: none;
}

/* 辅助类 */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

.left {
    float: left;
}

.right {
    float: right;
}

.container {
    width: 950px;
    margin: 0 auto;
    padding: 0 10px;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f5c518;
    color: #333;
    border-radius: 3px;
    font-weight: bold;
}

.btn:hover {
    background-color: #f8d047;
    color: #333;
}

/* 头部导航 */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
}

.header .logo {
    margin-right: 20px;
}

.header .logo a {
    display: block;
    width: 120px;
    height: 30px;
    text-indent: -9999px;
    background: #f5c518;
    color: #333;
    text-align: center;
    line-height: 30px;
    font-size: 18px;
    font-weight: bold;
}

/* 静态 logo 图片样式（用于 imgs/favicon.jpg），不可点击 */
.header .logo h1 {
    margin: 0;
}
.header .logo .logo-img {
    display: block;
    width: 120px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    pointer-events: none; /* 禁用鼠标事件，确保不可点击 */
}

/* 调整 logo 大小以完整显示图标 */
.header .logo .logo-img {
    height: 44px; /* 更高以完整显示 favicon.jpg */
    width: auto;
}

/* 搜索框：将提交按钮内嵌到输入框右侧 */
.header .search {
    width: 520px;
    margin-top: 0;
}
.header .search form {
    position: relative;
}
.header .search {
    width: 520px;
    margin-top: 0;
}
.header .search form {
    position: relative;
}
.header .search input {
    width: 100%;
    padding: 9px 44px 9px 12px; /* 右侧留出按钮空间 */
    border: 1px solid #ddd;
    border-radius: 20px; /* 圆角，接近示例 */
    outline: none;
    height: 36px;
    box-sizing: border-box;
}
.header .search input:focus {
    box-shadow: 0 0 0 3px rgba(37,120,180,0.08);
}
.header .search button.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 26px;
    border-radius: 4px;
    border: none;
    background-color: #2f6fad; /* 深蓝色，类似示例 */
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header .search button.search-btn:active,
.header .search button.search-btn:focus {
    outline: none;
}

/* 微调 header 菜单垂直对齐 */
.header .menu {
    margin-top: 6px;
}


.header .menu {
    margin-top: 5px;
}

.header .menu .menu-item {
    margin-left: 15px;
    color: #333;
}

.header .menu .btn {
    background-color: #f5c518;
    color: #333;
}

/* 横幅区域 */
.banner {
    background-color: #1a1a1a;
    color: #fff;
    padding: 40px 0;
}

.banner .slogan {
    width: 500px;
    margin-right: 40px;
}

.banner .slogan h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.banner .slogan p {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 20px;
}

.banner .banner-img img {
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* 核心内容区 */
.main {
    padding: 30px 0;
}

.aside-left, .content-middle, .aside-right {
    margin-bottom: 20px;
}

.aside-left {
    width: 200px;
    margin-right: 20px;
}

.aside-left h3, .content-middle h3, .aside-right h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

.category-list li {
    margin-bottom: 10px;
}

.content-middle {
    width: 480px;
    margin-right: 20px;
}

.topic-list li {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #e5e5e5;
}

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

.topic-list h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.meta {
    font-size: 13px;
    color: #666;
}

.meta .tag {
    background-color: #e1f5fe;
    color: #0288d1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

.aside-right {
    width: 230px;
}

.user-list li {
    margin-bottom: 15px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 3px;
    float: left;
    margin-right: 10px;
}

/* 页脚 */
.footer {
    background-color: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 20px 0;
    text-align: center;
    color: #666;
    font-size: 14px;
}
.img-card {
  background-color: #fff; /* 卡片背景色 */
  border-radius: 8px;    /* 圆角 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* 阴影增强层次感 */
  padding: 10px;         /* 内边距 */
  display: inline-block; /* 适配图片宽度 */
}

.img-card img {
  width: 300px;          /* 图片宽度（可根据需求调整） */
  height: auto;          /* 保持宽高比 */
  border-radius: 4px;    /* 图片圆角 */
}

/* profile/feed styles */
.profile-page { padding: 24px 0; }
.composer { background:#fff; border:1px solid #eee; padding:12px; border-radius:4px; }
.post { background:#fff; border:1px solid #eee; padding:12px; margin-bottom:12px; border-radius:4px; display:block; overflow:hidden; }
.post .post-left { float:left; margin-right:12px; }
.post .post-left .avatar { width:48px; height:48px; border-radius:4px; }
.post .post-body { overflow:hidden; }
.post .post-meta { color:#666; margin-bottom:8px; }
.post .post-text { color:#333; }

.box { background:#f9f9f9; padding:12px; border-radius:4px; border:1px solid #eee; }

/* profile card and edit box */
.profile-card { background:#fff; padding:12px; border-radius:6px; border:1px solid #eee; }
.profile-card img { box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.profile-card strong { font-size:18px; }
.profile-edit-form { background:#fff; padding:12px; border-radius:4px; border:1px solid #eee; }

/* small UI for follow/message */
#profile-message-box { max-width:640px; }
.profile-actions .btn { padding:6px 10px; }
.profile-card .btn { padding:6px 10px; }

/* pagination controls for feed */
.feed-pagination { display:flex; gap:8px; justify-content:center; margin-top:12px; }
.feed-pagination button { padding:6px 10px; border-radius:4px; border:1px solid #ddd; background:#fff; cursor:pointer; }
.feed-pagination button:disabled { opacity:0.5; cursor:not-allowed; }

/* Header layout overrides for flex behaviour and user display */
.header .container { display: flex; align-items: center; gap: 12px; }
.header .logo { float: none; }
.header .search { float: none; flex: 1 1 480px; }
.header .menu { float: none; margin-left: 8px; }
.header .header-user { margin-left: 12px; display:flex; align-items:center; gap:8px; }
.header .header-user .menu-item { margin-left: 0; }

.header-logged { display:flex; align-items:center; gap:8px; }
.header-avatar { width:32px; height:32px; border-radius:4px; object-fit:cover; }
.header-username { color:#333; font-weight:600; margin-right:8px; }

/* Ensure old float helpers don't break header layout */
.header .left, .header .right { float: none; }

/* ==== 电影卡片网格样式（用于 movies.html） ==== */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 18px;
    margin-bottom: 36px;
}
.movie-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform .12s ease, box-shadow .12s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.poster-link { display:block; }
.poster {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}
.movie-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 86px;
}
.movie-title { font-size: 16px; margin: 0; }
.movie-title a { color: #222; }
.year { color: #888; font-size: 13px; margin-left: 6px; font-weight: normal; }
.movie-meta { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top: auto; }
.rating { background: #ffdf5d; color: #333; padding: 4px 8px; border-radius: 4px; font-weight: 700; }
.movie-card .btn { padding: 6px 10px; background: #2f6fad; color: #fff; border-radius: 4px; text-decoration: none; }
.movie-card .btn:hover { background: #255985; }

/* 小屏时让网格列数变少 */
@media (max-width: 640px) {
    .container { width: auto; padding: 0 12px; }
    .movies-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .poster { height: 200px; }
}

/* 小组讨论布局样式 */
.groups-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 18px;
}
.groups-aside .box { padding: 12px; }
.group-header { background:#fff; padding:12px 16px; border-radius:6px; box-shadow:0 1px 4px rgba(0,0,0,0.04); margin-bottom:12px; }
.group-compose { background:#fff; padding:12px; border-radius:6px; box-shadow:0 1px 4px rgba(0,0,0,0.04); }
.group-compose input, .group-compose textarea, #create-group-form input { width:100%; padding:8px; border:1px solid #e6e6e6; border-radius:4px; margin-bottom:8px; }
.group-posts .post { background:#fff; border:1px solid #eee; margin-bottom:12px; padding:12px; border-radius:6px; }
.group-posts .post .post-meta { margin-bottom:8px; color:#666; font-size:13px; }
.groups-aside h3 { margin:0 0 8px 0; font-size:16px; }
.groups-aside #groups-list a { display:block; padding:6px 4px; color:#2f6fad; }
.groups-aside #groups-list a:hover { text-decoration:underline; }

@media (max-width: 900px) {
    .groups-layout { grid-template-columns: 1fr; }
    .groups-aside { order: 2; }
}

/* 话题广场样式 */
.topics-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 18px; }
.topics-main { background: none; }
.topics-recs-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.small-link { font-size:13px; color:#2f6fad; }
.topic-cards { display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.topic-card { background:#fff; border:1px solid #e7e7e7; padding:18px; border-radius:6px; text-align:center; box-shadow:0 1px 3px rgba(0,0,0,0.03); }
.topic-card img.topic-thumb { width:100%; height:120px; object-fit:cover; border-radius:4px; margin-bottom:8px; }
.topic-card h4 { font-size:16px; margin-bottom:12px; }
.topic-card .topic-join { display:inline-block; padding:6px 10px; border:1px solid #2f6fad; color:#2f6fad; border-radius:4px; text-decoration:none; }
.topic-card .topic-join:hover { background:#2f6fad; color:#fff; }
.feed-sample .feed-item { display:flex; gap:12px; background:#fff; padding:12px; border-radius:6px; border:1px solid #eee; }
.feed-sample .avatar { width:48px; height:48px; object-fit:cover; border-radius:50%; }
.feed-thumbs img { width:80px; height:50px; object-fit:cover; margin-right:6px; border-radius:4px; }
.topics-side .box { padding:12px; }
.hot-topics { padding-left:16px; margin:0; }
.hot-topics li { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px dashed #f0f0f0; }
.hot-topics li .title { color:#2f6fad; }
.hot-topics li .count { color:#d9534f; font-weight:700; }

@media (max-width: 900px) {
    .topics-layout { grid-template-columns: 1fr; }
    .topic-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .topic-cards { grid-template-columns: 1fr; }
}

    /* create topic form */
    .create-topic input { width:100%; padding:8px; border:1px solid #e6e6e6; border-radius:4px; margin-bottom:8px; }
    .create-topic .btn { padding:6px 12px; }
    .create-topic input[type=file] { padding:6px 0; }