/* ========== 个人主页样式 ========== */
.profile-page {
    height: 100%;
    overflow-y: auto;
    background: #0a0a0a;
    color: #fff;
    padding-bottom: 70px;
    -webkit-overflow-scrolling: touch;
}
.profile-cover {
    position: relative;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    overflow: hidden;
    cursor: pointer;
}
.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-change-hint {
    position: absolute;
    bottom: 10px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0.8;
    pointer-events: none;
}
.profile-header {
    padding: 0 16px 16px;
    position: relative;
}
.profile-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    overflow: hidden;
    margin-top: -43px;
    margin-bottom: 12px;
    border: 3px solid #0a0a0a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: pointer;
    position: relative;
    z-index: 2;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar::after {
    content: "📷";
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.profile-avatar:hover::after { opacity: 1; }
.profile-nickname {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
}
.profile-id {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 6px;
}
.profile-bio {
    font-size: 14px;
    color: #ccc;
    margin: 0 0 16px;
}
.edit-profile-btn {
    position: absolute;
    top: 20px;
    right: 16px;
    background: #2a2a2a;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    border: 1px solid #444;
}
.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    margin: 0 16px;
}
.stat-item {
    text-align: center;
    flex: 1;
}
.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}
.profile-tabs {
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    border-bottom: 1px solid #222;
    background: #0a0a0a;
    position: sticky;
    top: 0;
    z-index: 5;
}
.profile-tabs .tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: transparent;
    border-radius: 0;
}
.profile-tabs .tab-item.active {
    color: #ff3355;
    border-bottom-color: #ff3355;
}
.profile-content {
    padding: 12px 8px;
}
.profile-content .tab-pane { display: none; }
.profile-content .tab-pane.active { display: block; }
.history-sub-tabs {
    display: flex;
    margin-bottom: 16px;
    gap: 8px;
    padding: 0 8px;
}
.sub-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #1a1a1a;
    color: #aaa;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.sub-tab.active {
    background: #ff3355;
    color: #fff;
}
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; }
.list-container { padding: 0 4px; }
.list-container .video-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}
.waterfall-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.waterfall-grid .empty-state {
    grid-column: span 3;
    text-align: center;
    color: #777;
    padding: 40px 0;
    font-size: 15px;
}
.waterfall-grid .video-card {
    display: block;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
    position: relative;
}
.waterfall-grid .video-card:active {
    background: transparent;
    opacity: 0.8;
}
.waterfall-grid .card-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    margin-right: 0;
    border: 1px solid #333;
}
.waterfall-grid .card-info { padding: 6px 2px; }
.waterfall-grid .card-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #eee;
}
.waterfall-grid .card-status {
    top: 4px;
    right: 4px;
}
.waterfall-grid .card-status .status-icon {
    width: 20px;
    height: 20px;
    font-size: 12px;
    background: rgba(0,0,0,0.7);
}

/* ========== 通用卡片 ========== */
.video-card {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background .2s;
    user-select: none;
    position: relative;
}
.video-card:active { background: #2a2a2a; }
.card-thumb {
    width: 80px;
    height: 110px;
    background: #2e2e2e;
    border-radius: 10px;
    margin-right: 14px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #3a3a3a;
}
.card-info { flex: 1; overflow: hidden; }
.card-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.card-tag {
    display: inline-block;
    background: #2a2a2a;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    color: #ccc;
}
.card-status {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 5;
}
.card-status .status-icon {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.card-status .status-icon.liked { color: #ff3355; }
.card-status .status-icon.collected { color: #ffcc00; }
.empty, .empty-state {
    text-align: center;
    color: #777;
    margin-top: 60px;
    font-size: 14px;
}
.thumb-placeholder {
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 28px;
}

/* ========== 三点菜单按钮 ========== */
.profile-menu-container {
    position: absolute;
    top: 20px;
    right: 16px;
    z-index: 10;
}
.profile-menu-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.profile-menu-btn:hover {
    background: rgba(255,255,255,0.2);
}
.profile-dropdown-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 14px;
    min-width: 150px;
    padding: 6px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    display: none;
    z-index: 100;
}
.profile-dropdown-menu.show {
    display: block;
}
.dropdown-item {
    padding: 12px 18px;
    color: #ddd;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}
.dropdown-item i {
    width: 18px;
    text-align: center;
    color: #aaa;
}
.dropdown-item:hover {
    background: #2a2a2a;
    color: #fff;
}
.dropdown-item:active {
    background: #333;
}

/* ========== 深色模式设置弹窗 ========== */
.theme-settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.theme-settings-dialog {
  background: #1e1e2e;
  border-radius: 20px;
  width: 90%;
  max-width: 320px;
  padding: 0;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border: 1px solid #333;
  color: #fff;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.theme-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #333;
}
.theme-settings-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-settings-header h3 i {
  color: #ffd700;
}
.theme-settings-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.theme-settings-close:hover {
  color: #fff;
}

.theme-settings-body {
  padding: 20px;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.theme-switch-label {
  font-size: 16px;
  font-weight: 500;
  color: #ddd;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: 0.3s;
  border-radius: 28px;
}
.theme-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .theme-slider {
  background-color: #ff3355;
}
input:checked + .theme-slider:before {
  transform: translateX(24px);
}

.theme-switch-hint {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-top: 16px;
}

/* ==================== 浅色模式（我的页面） ==================== */
body.light-mode .profile-page {
    background: #f5f5f5;
    color: #222;
}
body.light-mode .profile-nickname {
    color: #222;
}
body.light-mode .profile-id {
    color: #666;
}
body.light-mode .profile-bio {
    color: #555;
}
body.light-mode .profile-stats {
    border-color: #ddd;
}
body.light-mode .stat-value {
    color: #222;
}
body.light-mode .stat-label {
    color: #666;
}
body.light-mode .profile-tabs {
    background: #f5f5f5;
    border-color: #ddd;
}
body.light-mode .profile-tabs .tab-item {
    color: #666;
}
body.light-mode .profile-tabs .tab-item.active {
    color: #ff3355;
}
body.light-mode .sub-tab {
    background: #fff;
    color: #555;
}
body.light-mode .sub-tab.active {
    background: #ff3355;
    color: #fff;
}
body.light-mode .list-container .video-card {
    background: #fff;
    border-color: #ddd;
}
body.light-mode .card-title {
    color: #222;
}
body.light-mode .card-tag {
    background: #eee;
    color: #555;
}
body.light-mode .waterfall-grid .card-title {
    color: #333;
}
body.light-mode .empty, body.light-mode .empty-state {
    color: #999;
}
body.light-mode .thumb-placeholder {
    background: #e0e0e0;
    color: #999;
}
body.light-mode .profile-cover {
    background: linear-gradient(135deg, #e0e0e0, #cccccc);
}
body.light-mode .profile-avatar {
    border-color: #f5f5f5;
}
body.light-mode .profile-menu-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #333;
}
body.light-mode .profile-menu-btn:hover {
    background: rgba(0,0,0,0.1);
}
body.light-mode .profile-dropdown-menu {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
body.light-mode .dropdown-item {
    color: #333;
}
body.light-mode .dropdown-item:hover {
    background: #f0f0f0;
    color: #222;
}
body.light-mode .dropdown-item i {
    color: #666;
}

/* 导航栏保持深色 */
body.light-mode .nav {
  background: #0f0f0f !important;
  color: #aaa !important;
  border-top: 1px solid #222 !important;
}
body.light-mode .nav .item {
  color: #aaa !important;
}
body.light-mode .nav .item.active {
  color: #fff !important;
}