/* 全局样式 */
:root {
  --regular-text-color: #303030;
  --secondary-text-color: #757575;
  --regular-font-size: 1rem;
  --small-font-size: 0.8rem;
  --regular-gap: 1rem;
  --small-gap: 0.8rem;
  --mini-gap: 0.6rem;
  --super-mini-gap: 0.4rem;
  --regular-border-radius: 0.5rem;
  --regular-shadow: 0 0rem 0.6rem rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  color: #303030;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  height: 100%;
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

#main-view {
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Logo 区域样式 */
.logo-area {
  background-size: cover !important;
  background-position: center !important;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  display: flex;
  border-radius: 100%;
  animation: logoEnter 1.2s;
  animation-fill-mode: forwards;
  transition: all 0.8s;
  width: 60vmin;
  height: 60vmin;
  max-width: 400px;
  max-height: 400px;
}

.logo-area.is-blur {
  filter: blur(5px);
}

.img-shadow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 100%;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(0,0,0,0.2));
  opacity: 0;
  transition: opacity 0.5s;
}

.img-shadow.img-shadow-show {
  opacity: 1;
}

.logo-area .inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
}

.main-logo {
  width: 30%;
  height: 30%;
  transition: transform 0.8s;
}

.main-logo.main-logo-top {
  transform: translateY(-20%);
}

.hello {
  color: white;
  font-size: 1.5rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s, transform 0.8s;
}

.hello.hello_bottom {
  opacity: 1;
  transform: translateY(20px);
}

.hello_bottom_text {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* 遮罩层样式 */
.ban-touch-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  background: rgba(0, 0, 0, 0.5);
}

.ban-touch-mask.touchable {
  display: none;
}

/* GitHub 徽标样式 */
.github-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  animation: githubEnter 1.5s;
}

.github-badge a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--regular-border-radius);
  color: white;
  font-size: var(--small-font-size);
  transition: all 0.3s;
}

.github-badge a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ICP 备案号样式 */
.icp {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 100;
}

.icp.visible {
  opacity: 1;
}

/* Drawer 样式 */
.drawer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: -1;
}

.drawer.active {
  z-index: 99;
}

.drawer__inner {
  padding: 1rem;
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transition: transform ease 0.5s;
  transform: translate(-50%, calc(100% + 0.5rem));
  z-index: 100;
  background-color: #f1f1f1;
  width: calc(100vw - 1rem);
  box-sizing: border-box;
  border-radius: var(--regular-border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 80vh;
}

.drawer__inner.is-opened {
  transform: translate(-50%, 0);
}

.drawer__close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-text-color);
  z-index: 101;
}

.drawer__content {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.drawer__footer {
  padding: 1rem 0;
  text-align: center;
  font-size: var(--small-font-size);
  color: var(--secondary-text-color);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Drawer 开关样式 */
.website-drawer .drawer-handler {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  z-index: 50;
  animation: fadeIn 1.5s;
}

.drawer-handler__icon {
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.drawer-handler:hover .drawer-handler__icon {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
}

.drawer-handler__text {
  font-size: 0.8rem;
  color: white;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.drawer-handler__text.wheel-up {
  display: none;
}

/* Tabs 样式 */
.tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tabs__header {
  display: flex;
  gap: var(--mini-gap);
  overflow-x: auto;
  padding-bottom: var(--mini-gap);
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: var(--regular-gap);
}

.tabs__header::-webkit-scrollbar {
  display: none;
}

.tabs__tab-label {
  padding: 0.5rem 1rem;
  white-space: nowrap;
  border-radius: var(--regular-border-radius);
  font-size: var(--small-font-size);
  color: var(--secondary-text-color);
  cursor: pointer;
  transition: all 0.2s;
}

.tabs__tab-label.active {
  background: rgba(0, 0, 0, 0.1);
  color: var(--regular-text-color);
  font-weight: 500;
}

.tabs__content {
  flex: 1;
  overflow-y: auto;
}

.tabs__panel {
  display: none;
}

.tabs__panel.active {
  display: block;
}

/* Website Item 样式 */
.website-item {
  background-color: #ffffff;
  padding: 0.5rem;
  border-radius: var(--regular-border-radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 80px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--regular-shadow);
  margin-bottom: var(--mini-gap);
}

.website-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.website-item__info {
  flex: 1;
  padding-right: var(--mini-gap);
}

.website-item__info .title {
  font-weight: 500;
  font-size: var(--regular-font-size);
  line-height: 1.4rem;
}

.website-item__info .description {
  font-size: var(--small-font-size);
  color: var(--secondary-text-color);
  line-height: 1.4rem;
  margin-top: var(--super-mini-gap);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.website-item__logo {
  width: 3rem;
  height: 3rem;
  border-radius: var(--regular-border-radius);
  background-color: #bcbcbc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.website-item__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-default-logo {
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

/* 动画 */
@keyframes logoEnter {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes githubEnter {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* 响应式设计 */
@media screen and (max-width: 900px) {
  html {
    font-size: 14px;
  }
  
  .logo-area {
    width: 80vmin;
    height: 80vmin;
  }
}

@media screen and (max-width: 600px) {
  .drawer__inner {
    max-height: 90vh;
    width: calc(100vw - 0.5rem);
    bottom: 0.25rem;
  }
  
  .website-drawer .drawer-handler {
    bottom: 1.5rem;
  }
}