/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #fff; overflow: hidden; background-color: #111; }
.bg-video { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; z-index: -1; pointer-events: none; }
.sound-btn { position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 999; transition: all 0.3s ease; color: #fff; }
.sound-btn:hover { background: rgba(251, 114, 153, 0.8); border-color: #fb7299; transform: scale(1.1); }
.sound-btn svg { width: 24px; height: 24px; }

/* ===== 顶部导航 ===== */
.top-mask { position: relative; z-index: 10; width: 100%; padding: 30px 60px; background: rgba(0, 0, 0, 0.15); backdrop-filter: blur(4px); border-bottom: 1px solid rgba(255, 255, 255, 0.15); display: flex; justify-content: space-between; align-items: center; }
.logo-group { display: flex; flex-direction: column; align-items: flex-start; }
.logo-title { font-family: "STXingkai", "华文行楷", "KaiTi", "STKaiti", serif; font-size: 56px; font-weight: bold; color: #fff; letter-spacing: 6px; margin-bottom: 4px; line-height: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); outline: none; }
.site-desc { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: rgba(255, 255, 255, 0.85); font-weight: 300; margin-bottom: 8px; min-height: 18px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); outline: none; display: inline-block; }
.site-desc:empty::before { content: "（点击编辑网站介绍）"; opacity: 0; transition: 0.3s; }
body.author-mode .site-desc:empty::before { opacity: 0.5; }
.logo-slogan { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; letter-spacing: 2px; font-weight: 300; display: flex; align-items: center; white-space: nowrap; }
.logo-slogan a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: all 0.3s ease; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); outline: none; display: inline-block; cursor: pointer; }
.logo-slogan a:hover, .logo-slogan a.active { color: #fb7299; text-shadow: 0 0 10px rgba(251, 114, 153, 0.8); font-weight: bold; }
.separator { color: rgba(255, 255, 255, 0.4); margin: 0 8px; }

/* ===== 按钮与悬浮卡片 ===== */
.mode-btn { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; padding: 8px 20px; border-radius: 20px; font-size: 14px; cursor: pointer; backdrop-filter: blur(5px); transition: all 0.3s ease; white-space: nowrap; }
.mode-btn:hover { background: rgba(255, 255, 255, 0.25); }

/* 用户悬浮信息卡 */
.user-profile-trigger { position: relative; display: inline-block; cursor: pointer; color: #4CAF50; font-weight: bold; padding: 5px; }
.user-tooltip { visibility: hidden; opacity: 0; position: absolute; top: 120%; right: 0; width: 220px; background: rgba(30, 30, 30, 0.95); backdrop-filter: blur(10px); border: 1px solid #fb7299; border-radius: 10px; padding: 15px; z-index: 1000; transition: all 0.3s; box-shadow: 0 10px 20px rgba(0,0,0,0.5); text-align: left; font-size: 13px; color: #ddd; }
.user-profile-trigger:hover .user-tooltip { visibility: visible; opacity: 1; transform: translateY(5px); }
.user-tooltip .exp-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.user-tooltip .exp-fill { height: 100%; background: linear-gradient(90deg, #4CAF50, #8BC34A); width: 0%; transition: width 0.5s; }

/* ===== 编辑提示与工具栏 ===== */
.editable[contenteditable="true"] { outline: 2px dashed rgba(251, 114, 153, 0.6); background: rgba(0, 0, 0, 0.1); border-radius: 4px; cursor: text; padding: 2px 6px; }
.editable[contenteditable="true"]:focus { outline: 2px solid #fb7299; background: rgba(0, 0, 0, 0.3); }

/* 👇 预览模式下的表现：去除可编辑框，隐藏添加按钮，允许指针点击 */
body.preview-mode .editable { outline: none !important; background: transparent !important; cursor: default !important; pointer-events: auto; }
body.preview-mode .editable::before { display: none; }
body.preview-mode #add-theme-btn { display: none !important; }
body.preview-mode .resize-handle { display: none !important; }
body.preview-mode .arc-wrapper { cursor: default; border: none; }
body.preview-mode #font-toolbar { display: none !important; }

.add-theme-btn { position: absolute; top: 20px; right: 30px; background: rgba(251, 114, 153, 0.2); border: 1px dashed #fb7299; color: #fb7299; padding: 6px 15px; border-radius: 20px; font-size: 14px; cursor: pointer; z-index: 100; transition: all 0.3s; }
.add-theme-btn:hover { background: #fb7299; color: #fff; }
.font-toolbar { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); padding: 12px 24px; border-radius: 30px; display: flex; align-items: center; box-shadow: 0 4px 20px rgba(0,0,0,0.4); z-index: 999; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0; pointer-events: none; }
.font-toolbar.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.toolbar-label { font-size: 14px; color: #fff; margin-right: 8px; }
.font-toolbar select { background: rgba(0, 0, 0, 0.5); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); padding: 6px 10px; border-radius: 8px; outline: none; font-size: 14px; cursor: pointer; }
.font-toolbar select option { background: #333; color: #fff; }
#font-color-picker { width: 32px; height: 32px; border: none; border-radius: 50%; cursor: pointer; background: transparent; padding: 0; }
#font-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
#font-color-picker::-webkit-color-swatch { border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 50%; }

/* ===== 轮播区 ===== */
.main-content { position: relative; z-index: 1; height: calc(100vh - 150px); width: 100vw; overflow: hidden; }
.arc-wrapper { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(15, 25, 35, 0.15); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); clip-path: url(#arc-clip); filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5)); border: 1px solid rgba(255, 255, 255, 0.1); will-change: left, top, width, height; }
body.author-mode:not(.preview-mode) .arc-wrapper { cursor: grab; border: 1px dashed #fb7299; }
body.author-mode:not(.preview-mode) .arc-wrapper:active { cursor: grabbing; }
.resize-handle { position: absolute; right: 15px; bottom: 15px; width: 20px; height: 20px; background: rgba(251, 114, 153, 0.8); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; display: none; z-index: 100; box-shadow: 0 2px 6px rgba(0,0,0,0.4); transition: transform 0.2s; }
.resize-handle:hover { transform: scale(1.2); background: #fb7299; }
body.author-mode:not(.preview-mode) .resize-handle { display: block; }

.carousel-container { width: 100%; height: 100%; position: relative; }
.carousel-track { display: flex; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.carousel-slide { min-width: 100%; height: 100%; position: relative; }
.slide-content { position: absolute; inset: 0; padding: 70px 80px 60px; display: flex; flex-direction: column; justify-content: center; }
.slide-title { font-size: 36px; font-weight: bold; margin-bottom: 10px; color: #fff; letter-spacing: 6px; display: inline-block; align-self: flex-start; outline: none; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.slide-subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin-bottom: 30px; align-self: flex-start; letter-spacing: 1px; font-weight: 300; text-shadow: 0 1px 4px rgba(0,0,0,0.6); border-bottom: 1px solid rgba(255, 255, 255, 0.15); padding-bottom: 12px; width: 100%; max-width: 900px; }
.slide-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; width: 100%; max-width: 900px; margin: 0 auto; }
.slide-list span { font-size: 16px; color: rgba(255, 255, 255, 0.9); cursor: pointer; transition: all 0.3s; position: relative; padding: 6px 12px 6px 24px; border-radius: 8px; text-shadow: 0 1px 5px rgba(0,0,0,0.6); }
.slide-list span.has-link { text-decoration: underline; text-decoration-color: #fb7299; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.slide-list span::before { content: ''; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background: #fb7299; border-radius: 50%; box-shadow: 0 0 10px #fb7299; transition: all 0.3s; }
.slide-list span:hover { color: #fb7299; background: rgba(255, 255, 255, 0.1); transform: translateX(6px); }
.slide-list span:hover::before { background: #fff; box-shadow: 0 0 12px #fff; }
body.preview-mode .slide-list span:hover { transform: none; } /* 预览模式取消 hover 动效 */
.more-btn-container { width: 100%; max-width: 900px; margin: 15px auto 0; text-align: right; }
.more-btn { font-size: 14px; color: #fb7299; cursor: pointer; transition: 0.3s; }
.more-btn:hover { text-shadow: 0 0 10px #fb7299; text-decoration: underline; }

.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(5px); color: #fff; width: 50px; height: 50px; border-radius: 50%; font-size: 20px; cursor: pointer; transition: all 0.3s; display: flex; justify-content: center; align-items: center; }
.carousel-btn:hover { background: #fb7299; border-color: #fb7299; transform: translateY(-50%) scale(1.1); }
.carousel-btn.prev { left: 30px; }
.carousel-btn.next { right: 30px; }
.carousel-indicators { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); cursor: pointer; transition: all 0.3s; }
.dot.active { background: #fb7299; width: 28px; border-radius: 6px; box-shadow: 0 0 10px rgba(251, 114, 153, 0.8); }

/* ===== 跑马灯与弹窗 ===== */
.marquee-container { position: fixed; bottom: 40px; left: 0; width: 100%; z-index: 1000; pointer-events: none; overflow: hidden; }
.marquee-text { position: relative; display: inline-block; white-space: nowrap; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 18px; color: #fff; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); padding: 10px 24px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); letter-spacing: 1px; transform: translateX(100vw); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 2000; display: none; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal-content { background: #1e1e1e; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; width: 800px; max-width: 90%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-header { padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 20px; font-weight: 500; }
.table-container { padding: 20px; overflow-y: auto; flex: 1; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
th { color: #888; font-weight: 500; position: sticky; top: 0; background: #1e1e1e; }
tr:hover { background: rgba(255, 255, 255, 0.02); }
td:nth-child(2) { font-family: monospace; color: #fb7299; }

@media (max-width: 768px) {
  body { overflow: auto; }
  .top-mask { padding: 20px; flex-direction: column; align-items: flex-start; gap: 15px; }
  .logo-title { font-size: 40px; letter-spacing: 3px; }
  .logo-slogan { font-size: 13px; }
  .mode-switch { align-self: flex-end; flex-wrap: wrap; justify-content: flex-end; }
  .font-toolbar { top: 10px; padding: 10px 15px; flex-wrap: wrap; gap: 10px; width: 90%; justify-content: center; }
  .main-content { height: auto; padding: 60px 10px 30px; }
  .arc-wrapper { position: relative; left: auto; top: auto; transform: none !important; margin: 0 auto; width: 95% !important; height: 520px !important; cursor: default !important; }
  body.author-mode .arc-wrapper { border: none; }
  .resize-handle { display: none !important; }
  .slide-content { padding: 60px 20px 40px; }
  .slide-title { font-size: 26px; }
  .slide-subtitle { margin-bottom: 20px; }
  .slide-list { grid-template-columns: 1fr; gap: 8px; }
  .slide-list span { padding-top: 8px; padding-bottom: 8px; font-size: 15px; }
  .carousel-btn { display: none; }
}