* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}
:root {
  --main: #ff5c93;
  --main-dark: #d84373;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #2c2c36;
  --muted: #68707d;
  --border: #dfe3ea;
  --shadow: 0 20px 45px rgba(44,44,54,0.08);
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: 0.2s ease;
}
button:hover {
  opacity: 0.95;
}
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 14px;
  background: #fff;
}
input:focus, textarea:focus {
  border-color: var(--main);
  box-shadow: 0 0 0 4px rgba(255,92,147,0.08);
}

/* 头部导航容器 修复不换行核心 */
.navbar {
  background: var(--surface);
  display: flex;
  flex-wrap: nowrap !important; /* 强制单行，禁止换行 */
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 99;
}
.logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--main);
  flex-shrink: 0; /* logo不压缩 */
}
/* 导航外层滚动容器（新增，实现>>箭头） */
.nav-wrap {
  position: relative;
  flex: 1; /* 自动占满logo与用户栏中间所有剩余宽度 */
  overflow: hidden;
  min-width: 0; /* flex收缩兼容 */
}
/* 横向滚动菜单 */
.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
/* 滚动条美化 */
.nav::-webkit-scrollbar {
  height: 3px;
}
.nav::-webkit-scrollbar-thumb {
  background: var(--main);
  border-radius: 99px;
}
.nav a {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
}
.nav a:hover,
.nav a.active {
  color: #fff;
  background: var(--main);
}
/* 右侧滚动提示箭头>> */
.nav-arrow {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(to left, #fff 70%, transparent);
  padding: 8px 14px 8px 24px;
  color: var(--muted);
  pointer-events: none;
  font-weight: bold;
}
/* 用户操作栏 禁止压缩换行 */
.user-bar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
/* 工具类修正：pc-only默认flex，768px以下彻底隐藏 */
.pc-only { display: flex; }
.mobile-only { display: none; }
@media (max-width: 768px) {
    .pc-only { display: none !important; }
    .mobile-only { display: block !important; }
    /* 手机导航栏缩小内边距 */
    .navbar {
        padding: 0.8rem 12px;
    }
}
.btn-primary {
  background: var(--main);
  color: #fff;
  padding: 12px 18px;
}
.btn-default {
  background: #f1f4f8;
  color: var(--text);
  padding: 12px 18px;
}

/* 容器 */
.container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}
.hero {
  background: linear-gradient(135deg, rgba(255,92,147,0.12), rgba(255,255,255,0.85));
  border: 1px solid rgba(255,92,147,0.15);
  border-radius: 24px;
  padding: 2.4rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 1.8rem;
}
.hero h1 {
  font-size: clamp(2rem, 2.5vw, 2.6rem);
  margin-bottom: 0.8rem;
  color: var(--text);
}
.hero p {
  color: var(--muted);
  font-size: 1rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
}
.card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-8px);
}
.card-img {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1.2rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.24);
}
.card-img span {
  font-size: 0.9rem;
  opacity: 0.95;
  margin-top: 0.3rem;
}
.bg-far { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.bg-cos { background: linear-gradient(135deg, #ff7675, #d63031); }
.bg-novel { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.bg-act { background: linear-gradient(135deg, #fdcb6e, #e17055); }
.bg-tieba { background: linear-gradient(135deg, #00cec9, #00b894); }
.bg-mycenter { background: linear-gradient(135deg, #9ae3f0, #3ca2ca); }

.card .title {
  padding: 1.3rem 1.4rem 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.card .desc {
  padding: 0 1.4rem 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.flex {
  display: flex;
  gap: 12px;
  align-items: center;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.text-center {
  text-align: center;
}
.text-sm {
  font-size: 12px;
  color: var(--muted);
}
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }

/* 页脚样式 - 修改部分 */
#footer-container {
  /* background: #f1f5f5; */
  background-color: rgba(255, 255, 255, 0.9);
  color: #494c4d;
  padding: 20px 0;
  margin-top: 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
}

.footer-content p {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.5;
}

.footer-links {
  margin-top: 10px;
  margin-bottom: 10px;
}

.footer-links a {
  color: #494c4d;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  text-decoration: underline;
  color: #3498db;
}

/* 原有的页脚样式移除边框 */
.footer {
  text-align: center;
  padding: 30px 20px;
  background: var(--surface);
  margin-top: 50px;
  color: var(--muted);
  font-size: 14px;
  /* 移除边框: border-top: 1px solid rgba(0,0,0,0.05); */
}
.footer a {
  margin: 0 10px;
  color: var(--muted);
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-box {
  background: var(--surface);
  width: 90%;
  max-width: 420px;
  border-radius: 18px;
  padding: 28px;
}

/* 打卡卡片样式 */
.bg-checkin {
  background: linear-gradient(135deg, #f3babc 0%, #f37552 99%, #fad0c4 100%);
}
/* 保持和其他卡片一致的基础样式 */
.card-img.bg-checkin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 120px;
  color: white;
  font-size: 20px;
  font-weight: bold;
}
.card-img.bg-checkin span {
  font-size: 14px;
  margin-top: 8px;
  font-weight: normal;
}

/* Utility classes */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  background: var(--main);
}
.btn-primary {
  background: var(--main);
}
.btn-danger {
  background: #f44;
}
.input-small {
  padding: 6px;
}
.text-muted {
  color: #666;
}
.mt4 {
  margin-top: 4px;
}
.mb10 {
  margin-bottom: 10px;
}
.section-heading {
  margin-top: 10px;
  font-weight: bold;
}
.responsive-img {
  max-width: 100%;
  border-radius: 6px;
}
.small-img {
  max-width: 100px;
  margin-top: 4px;
  border-radius: 4px;
}
.text-right {
  text-align: right;
}
.inline-form {
  display: inline;
}
.text-wrap {
  line-height: 1.8;
  white-space: pre-wrap;
}
.text-line {
  line-height: 1.8;
}
textarea.textarea-large {
  height: 100px;
  margin: 10px 0;
  padding: 8px;
}
.file-input {
  margin-bottom: 10px;
}
hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 15px 0;
}
hr.tight {
  margin: 10px 0;
}

/* Additional utility classes for unification */
.card-small {
  max-width: 450px;
  margin: 0 auto;
}
.card-medium {
  max-width: 700px;
  margin: 0 auto;
}
.card-large {
  max-width: 800px;
  margin: 0 auto;
}
.flex-wrap {
  flex-wrap: wrap;
}
.gap-16 {
  gap: 16px;
}
.gap-20 {
  gap: 20px;
}
.min-width-200 {
  min-width: 200px;
}
.display-none {
  display: none;
}
.margin-top-10 {
  margin-top: 10px;
}
.input-flex {
  flex: 1;
}
.btn-full {
  width: 100%;
  padding: 10px;
}
.text-main {
  color: var(--main);
}
.line-height-2 {
  line-height: 2;
}
.padding-50 {
  padding: 50px 20px;
}
.flex-1 {
  flex: 1;
}

/* ================= 3D 魔方 ================= */
.cube-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 60px auto;
  max-width: 1200px;
  padding: 0 20px;
  gap: 30px;
}

.cube-container {
  width: 320px;
  height: 320px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 30s infinite linear;
}

.cube > div {
  position: absolute !important;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(150,150,150,.8);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  backface-visibility: hidden;
}

.front  { transform: rotateY(0deg)   translateZ(160px); }
.back   { transform: rotateY(180deg) translateZ(160px); }
.right  { transform: rotateY(90deg)  translateZ(160px); }
.left   { transform: rotateY(-90deg) translateZ(160px); }
.top    { transform: rotateX(90deg)  translateZ(160px); }
.bottom { transform: rotateX(-90deg) translateZ(160px); }

/* 缩略图 */
.thumbnails {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.thumbnails img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 6px;
  cursor: pointer;
}
.thumbnails img:hover {
  transform: scale(1.1);
  border-color: #ff6b9d;
}

@keyframes rotateCube {
  from { transform: rotateX(0deg) rotateY(0deg); }
  to   { transform: rotateX(360deg) rotateY(360deg); }
}

@media (max-width: 900px) {
  .cube-section { flex-direction: column; }
  .thumbnails { flex-direction: row; order: 2; margin-top: 20px; }
}
@media (max-width: 480px) {
  .cube-container { width: 280px; height: 280px; }
  .front  { transform: rotateY(0deg)   translateZ(140px); }
  .back   { transform: rotateY(180deg) translateZ(140px); }
  .right  { transform: rotateY(90deg)  translateZ(140px); }
  .left   { transform: rotateY(-90deg) translateZ(140px); }
  .top    { transform: rotateX(90deg)  translateZ(140px); }
  .bottom { transform: rotateX(-90deg) translateZ(140px); }
  .thumbnails img { width: 60px; height: 60px; }
}

/* ============ 响应式工具类 & 移动端汉堡菜单 ============ */
.pc-only { display: flex; }
.mobile-only { display: none; }
.hamburger {
    font-size: 26px;
    background: transparent;
    color: var(--text);
    padding: 4px 10px;
}
/* 移动端侧边菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 82%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    padding: 60px 24px;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.mobile-menu.active {
    left: 0;
}
.mobile-menu a {
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 10px;
}
.mobile-menu a:hover {
    background: #f3f4f6;
}
/* 通用媒体查询断点 */
@media (max-width: 768px) {
    .pc-only { display: none !important; }
    .mobile-only { display: block !important; }
    .container {
        margin: 15px auto;
        padding: 0 12px;
    }
    .hero {
        padding: 1.4rem 1rem;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    /* 新增：缩小导航内边距，节省空间 */
    .navbar {
        padding: 0.8rem 12px;
    }
    .nav a {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }
    /* 列表横向布局改为纵向 */
    .cos-item, .far-item {
        flex-direction: column;
        gap: 12px;
    }
    .cos-item img {
        width: 100%;
        height: 160px;
        margin: 0;
    }
    .cos-btns {
        flex-direction: row;
        width: 100%;
    }
    button, .btn {
        width: 100%;
        padding: 14px 0;
    }
}
@media (min-width:769px) and (max-width:992px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .modal-box {
        width: 94%;
        padding: 20px;
    }
}