/* 缤纷影视 - 全局样式 */

:root {
  --primary-color: #1a73e8;
  --secondary-color: #34a853;
  --accent-color: #fbbc04;
  --danger-color: #ea4335;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-light: #f5f5f5;
  --bg-white: #fff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* UI风格变体 */
body.ui-style-0 { --primary-color: #1a73e8; }
body.ui-style-1 { --primary-color: #d93025; }
body.ui-style-2 { --primary-color: #f57c00; }
body.ui-style-3 { --primary-color: #7b1fa2; }
body.ui-style-4 { --primary-color: #0097a7; }
body.ui-style-5 { --primary-color: #689f38; }
body.ui-style-6 { --primary-color: #e91e63; }
body.ui-style-7 { --primary-color: #5e35b1; }
body.ui-style-8 { --primary-color: #00acc1; }
body.ui-style-9 { --primary-color: #8d6e63; }
body.ui-style-10 { --primary-color: #546e7a; }
body.ui-style-11 { --primary-color: #6d4c41; }
body.ui-style-12 { --primary-color: #c62828; }
body.ui-style-13 { --primary-color: #00897b; }
body.ui-style-14 { --primary-color: #ff6f00; }
body.ui-style-15 { --primary-color: #ad1457; }

/* 基础布局 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  opacity: 0.8;
}

a:active {
  opacity: 0.6;
}

/* 导航栏强化 */
nav {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--primary-color);
}

nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

nav a {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transform: translateX(-50%);
  transition: var(--transition);
}

nav a:hover {
  background: var(--bg-light);
  text-decoration: none;
}

nav a:hover::after {
  width: 60%;
}

/* 响应式导航 */
@media (max-width: 768px) {
  nav .nav-container {
    flex-wrap: nowrap;
    overflow-x: visible;
    justify-content: space-between;
  }

  nav a {
    padding: 14px 8px;
    font-size: 14px;
    flex: 1 1 auto;
    min-width: 60px;
  }

  nav a::after {
    display: none;
  }
}

@media (max-width: 480px) {
  nav a {
    padding: 12px 6px;
    font-size: 13px;
    min-width: 50px;
  }
}

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

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
}

/* 卡片 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
}

.btn:hover {
  background: var(--primary-color);
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: white;
}

.btn:active {
  transform: translateY(0);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-light);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 13px;
  margin: 4px;
  transition: var(--transition);
}

.tag:hover {
  background: var(--primary-color);
  color: white;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .grid {
    gap: 15px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 16px 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 36px;
  margin-bottom: 24px;
}

h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

h3 {
  font-size: 22px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 20px;
  }
}

/* 段落 */
p {
  margin: 0 0 16px 0;
  line-height: 1.8;
}

/* 列表 */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
