/* CSS Variables for Themes */
:root {
    /* Dark Theme (Default) */
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --text-color-secondary: rgba(255, 255, 255, 0.6);
    --nav-bg-hover: rgba(0, 0, 0, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: #fff;
    --sidebar-bg: rgba(10, 10, 10, 0.6);
    --sidebar-handle-bg: rgba(10, 10, 10, 0.95);
    --sidebar-handle-hover: #222;
    --shape-border: rgba(255, 255, 255, 0.1);
    --shape-dashed: rgba(255, 255, 255, 0.15);
    --shape-inner: rgba(255, 255, 255, 0.05);
    --shape-bg: rgba(255, 255, 255, 0.01);
    --card-bg-start: rgba(255,255,255,0.03);
    --card-bg-end: rgba(255,255,255,0);
    --card-hover-start: rgba(255,255,255,0.08);
    --card-hover-end: rgba(255,255,255,0.02);
    --card-bg-solid: #222;
    --card-bg-hover-solid: #333;
    --main-gradient: url("../image/黑色 back ground.jpg") no-repeat center center/cover;
    
    /* Cursor */
    --cursor-ring-color: rgba(255, 255, 255, 0.5);
    --cursor-dot-color: #fff;
}

[data-theme="light"] {
    /* Light Theme */
    --bg-color: #f5f5f5;
    --text-color: #1a1a1a;
    --text-color-secondary: rgba(0, 0, 0, 0.6);
    --nav-bg-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: #000;
    --sidebar-bg: rgba(240, 240, 240, 0.6);
    --sidebar-handle-bg: rgba(240, 240, 240, 0.95);
    --sidebar-handle-hover: #e0e0e0;
    --shape-border: rgba(0, 0, 0, 0.1);
    --shape-dashed: rgba(0, 0, 0, 0.15);
    --shape-inner: rgba(0, 0, 0, 0.05);
    --shape-bg: rgba(0, 0, 0, 0.01);
    --card-bg-start: rgba(0,0,0,0.03);
    --card-bg-end: rgba(0,0,0,0);
    --card-hover-start: rgba(0,0,0,0.08);
    --card-hover-end: rgba(0,0,0,0.02);
    --card-bg-solid: #fff;
    --card-bg-hover-solid: #f9f9f9;
    --main-gradient: url("../image/白色 back ground.jpg") no-repeat center center/cover;

    /* Cursor */
    --cursor-ring-color: rgba(0, 0, 0, 0.5);
    --cursor-dot-color: #000;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor */
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    background: var(--main-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    overflow-x: hidden;
    height: 100vh;
    transition: background 0.5s, color 0.5s;
}

/* Scrolling Page (e.g., News) */
body.scrolling-page {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

body.scrolling-page .main-content {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block; /* Remove flex centering */
    padding-bottom: 50px;
}

body.scrolling-page .top-nav {
    background-color: var(--nav-bg-hover);
}

/* Custom Cursor */
#cursor-dot, #cursor-ring, #cursor-img {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

#cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--cursor-dot-color);
    border-radius: 50%;
}

#cursor-ring {
    width: 30px;
    height: 30px;
    border: 1px solid var(--cursor-ring-color);
    border-radius: 50%;
    transition: width 0.2s, height 0.2s, border-color 0.2s;
}

#cursor-img {
    width: 24px;
    height: 24px;
    background-image: url('../image/cursor.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    /* Offset image slightly so tip is at cursor point if needed, or center it */
    /* Usually arrow tip is top-left, so we might need to adjust transform or position */
    transform: translate(0, 0); /* Reset center translate for arrow */
    margin-left: -2px; /* Fine tune */
    margin-top: -2px;
}

/* Active State for Cursor (Hovering Links) */
body.hovering #cursor-ring {
    width: 50px;
    height: 50px;
    border-color: var(--text-color);
    background-color: rgba(128, 128, 128, 0.1);
}

body.hovering #cursor-img {
    background-image: url('../image/cursor_active.png');
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background-color: transparent;
    z-index: 1000;
    transition: background-color 0.3s;
}

.top-nav:hover {
    background-color: var(--nav-bg-hover);
}

.logo-link {
    display: flex;
    align-items: center;
    cursor: none;
    text-decoration: none;
}

.logo-img {
    height: 30px;
    width: auto;
    cursor: none; /* Ensure custom cursor is seen */
}

.nav-links {
    display: flex;
    gap: 50px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    transition: all 0.3s;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-extras {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: none; /* Custom cursor */
    color: var(--text-color);
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s, color 0.3s;
    padding: 0;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Language Switcher */
.lang-switch {
    position: relative;
    display: inline-block;
}

.lang-current {
    font-size: 14px;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    background: transparent;
    color: var(--text-color);
    cursor: none; /* Custom cursor */
    transition: border-color 0.3s, background-color 0.3s;
    font-family: inherit;
}

.lang-switch:hover .lang-current {
    border-color: var(--border-color-hover);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    min-width: 60px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.lang-switch:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    background: transparent;
    border: none;
    color: var(--text-color-secondary);
    padding: 8px 15px;
    text-align: center;
    cursor: none;
    font-size: 13px;
    transition: color 0.2s, background-color 0.2s;
    font-family: inherit;
}

.lang-option:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .lang-option:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Main Content Placeholder */
.main-content {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
    overflow: hidden;
    transition: background 0.5s;
}

.bg-placeholder {
    text-align: center;
    z-index: 1;
    position: relative;
}

/* 散射射线样式 */
.scatter-ray {
  position: fixed;
  height: 1px;
  background: linear-gradient(90deg, var(--text-color) 0%, var(--text-color) 30%, transparent 100%);
  transform-origin: left center;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 3px var(--text-color);
  border-radius: 0.5px;
}

.bg-placeholder h1 {
    font-size: 64px;
    letter-spacing: 12px;
    font-weight: 300;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(0,0,0,0.1);
    opacity: 0;
    animation: fadeIn 1s ease-out forwards 0.5s;
    color: var(--text-color);
}

.bg-placeholder p {
    font-size: 16px;
    letter-spacing: 4px;
    color: var(--text-color-secondary);
    opacity: 0;
    animation: fadeIn 1s ease-out forwards 1s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Projects Modal */
.projects-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    z-index: 2000;
    
    /* Initial State: Hidden Circle */
    width: 0;
    height: 0;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--text-color);
}

.projects-modal.active {
    width: 450px;
    height: 600px;
    max-height: 80vh;
    border-radius: 12px;
    opacity: 1;
    pointer-events: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: var(--text-color);
    cursor: none; /* Custom cursor */
    z-index: 2001;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-inner {
    width: 100%;
    height: 100%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s 0.3s; /* Delay for modal expansion */
}

.projects-modal.active .modal-inner {
    opacity: 1;
}

.modal-inner h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-color);
    letter-spacing: 4px;
    font-weight: 300;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    flex-shrink: 0;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    list-style: none;
    padding: 0 5px;
    overflow-y: auto;
    flex: 1;
}

/* Custom Scrollbar for Project List */
.project-list::-webkit-scrollbar {
    width: 4px;
}
.project-list::-webkit-scrollbar-track {
    background: transparent;
}
.project-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.project-list li {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease;
    flex-shrink: 0;
}

.projects-modal.active .project-list li {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation */
.projects-modal.active .project-list li:nth-child(1) { transition-delay: 0.4s; }
.projects-modal.active .project-list li:nth-child(2) { transition-delay: 0.5s; }
.projects-modal.active .project-list li:nth-child(3) { transition-delay: 0.6s; }
.projects-modal.active .project-list li:nth-child(4) { transition-delay: 0.7s; }

.project-card {
    background: var(--card-bg-solid);
    padding: 20px 25px;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 90px;
}

.project-card:hover {
    background: var(--card-bg-solid);
    border-radius: 0;
    box-shadow: inset 0 0 0 1px var(--text-color);
    /* align-items: center; Removed to allow manual sliding */
}

.project-card .title-wrapper {
    position: relative;
    width: fit-content;
    left: 0;
    transform: translateX(0);
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s;
}

.project-card:hover .title-wrapper {
    left: 50%;
    transform: translateX(-50%);
}

.project-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    transform: scale(1);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card:hover h3 {
    transform: scale(1.4);
    margin-bottom: 0;
}

.project-card p {
    font-size: 12px;
    color: var(--text-color-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.4s ease-out, opacity 0.4s ease-in, max-height 0.4s ease-out, margin 0.4s ease-out;
    transform-origin: top;
    max-height: 20px;
    opacity: 1;
    transform: translateX(0);
}

.project-card:hover p {
    max-height: 0;
    opacity: 0;
    transform: translateX(150px);
    margin: 0;
}

/* Info Card (Contact Modal) - Allow copying */
.project-card.info-card:hover p {
    max-height: 20px;
    opacity: 1;
    transform: translateX(0);
    margin: inherit; /* Restore default */
}

.project-card.info-card:hover .title-wrapper {
    left: 0;
    transform: translateX(0);
}

.project-card.info-card:hover h3 {
    transform: scale(1);
    margin-bottom: 5px;
}

.project-card.info-card, 
.project-card.info-card * {
    cursor: text;
    user-select: text;
}
