:root {
    --color-background: #ffffff;
    --color-text: #000000;
    --spacing-unit: 20px;
    --transition-speed: 0.3s;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --content-width: 680px; /* 更窄的内容区域 */
    --font-family: "Shafarik", serif;  /* 添加字体变量 */
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);  /* 使用新字体 */
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.5;
    font-weight: 400;
    font-style: normal;
}

/* 自定义光标 - 只在宽屏显示 */
@media (min-width: 769px) {
    .dc-cursor {
        position: fixed;
        pointer-events: none;
        z-index: 9999;
        width: 20px;
        height: 20px;
        transform: translate(-50%, -50%);
        mix-blend-mode: difference;
        opacity: 1;
    }

    /* 在可交互元素上隐藏自定义光标 */
    .dc-cursor.hide {
        opacity: 0;
    }

    .dc-cursor::before,
    .dc-cursor::after {
        content: '';
        position: absolute;
        background: #fff;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .dc-cursor::before {
        width: 1px;
        height: 100%;
        left: 50%;
        top: 0;
        transform-origin: center center;
    }

    .dc-cursor::after {
        width: 100%;
        height: 1px;
        top: 50%;
        left: 0;
        transform-origin: center center;
    }

    /* 悬浮状态 */
    .dc-cursor.button-hover::before {
        transform: rotate(45deg);
    }

    .dc-cursor.button-hover::after {
        transform: rotate(45deg);
    }

    /* 关闭提示文字 */
    .dc-cursor__close {
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: #fff;
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .dc-cursor.button-hover .dc-cursor__close {
        opacity: 1;
    }

    /* 默认隐藏系统光标 */
    body {
        cursor: none;
    }
}

/* 窄屏使用系统默认光标 */
@media (max-width: 768px) {
    .dc-cursor {
        display: none;
    }

    body {
        cursor: auto;
    }

    /* 确保所有可交互元素显示正确的系统光标 */
    a, 
    button,
    [data-button],
    .dc__nav button,
    .contact-info__link,
    .form-submit {
        cursor: pointer;
    }

    /* 文本输入区域显示文本光标 */
    input[type="text"],
    input[type="email"],
    textarea {
        cursor: text;
    }
}

/* 导航样式 */
.dc__nav {
    position: fixed;
    top: var(--spacing-unit);
    left: var(--spacing-unit);
    z-index: 100;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--spacing-unit) * 2);
}

/* 移动端导航样式 */
@media (max-width: 768px) {
    .dc__nav {
        flex-direction: row;
        justify-content: space-around;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: var(--color-background);
        padding: 10px var(--spacing-unit);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 91;  /* 确保导航栏在遮罩层上方 */
    }

    .dc__nav button {
        width: auto;
        margin: 0;
        padding: 8px 12px;
        font-size: 14px;
        transform: none;
        opacity: 1;
        animation: none;
    }

    .nav-spacer {
        display: none;
    }

    .dc-cursor {
        display: none;  /* 在移动端隐藏自定义光标 */
    }

    /* 恢复默认光标样式 */
    body {
        cursor: auto;
    }

    .dc__nav button,
    a,
    [data-button] {
        cursor: pointer;
    }
}

.nav-spacer {
    flex: 1;
    min-height: 20px; /* 确保在内容很少时也有最小间距 */
}

.dc__nav button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 140px; /* 固定宽度使布局更整齐 */
    background: none;
    border: none;
    padding: 10px;
    margin: 5px 0;
    cursor: pointer;
    font-size: 16px;
    font-family: var(--font-family);  /* 添加字体 */
    color: var(--color-text);
    transition: all var(--transition-speed) var(--ease-out-expo);
    opacity: 0;
    transform: translateX(-10px);
    animation: slideRight 0.4s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--index, 0) * 0.1s + 0.2s);
}

/* 加号/减号图标 */
.dc__nav button span {
    position: relative;
    width: 12px;
    height: 12px;
}

.dc__nav button span::before,
.dc__nav button span::after {
    content: '';
    position: absolute;
    background: currentColor;
    transition: all var(--transition-speed) var(--ease-out-expo);
}

/* 横线 */
.dc__nav button span::before {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* 竖线 */
.dc__nav button span::after {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

/* 展开状态 */
.dc__nav button[aria-expanded="true"] {
    color: var(--color-text);
}

/* 展开时竖线消失形成减号 */
.dc__nav button[aria-expanded="true"] span::after {
    transform: translateX(-50%) scaleY(0);
}

/* 其他按钮弱化 */
.dc__nav button[aria-expanded="false"].sibling-expanded {
    opacity: 0.4;
}

/* hover时恢复完整显示 */
.dc__nav button[aria-expanded="false"].sibling-expanded:hover {
    opacity: 1;
}

/* 页面布局 */
.page-inner {
    min-height: 100vh;
    padding: var(--spacing-unit);
    opacity: 0;
    animation: fadeIn 0.6s var(--ease-out-expo) forwards;
}

/* Studio 部分样式 */
.dc__main {
    position: relative;
    margin-left: 240px;
    padding: 40px;
    max-width: var(--content-width);
}

/* 全局容器样式 */
.dc__main__container {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out-expo),
                transform 0.6s var(--ease-out-expo);
    position: relative;  /* 改为relative */
    z-index: 2;
}

.dc__main__container[aria-expanded="true"] {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.studio-content {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

.studio-content__title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    color: #666;
}

.studio-content__content {
    font-size: 18px;
    line-height: 1.8;
    max-width: 100%;
}

.studio-list {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

.studio-list__title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

.studio-list__content ul {
    list-style: none;
}

.studio-list__content li {
    margin-bottom: 8px;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideRight 0.4s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--index, 0) * 0.05s + 0.2s);
}

.studio-list__content li.indent {
    padding-left: 20px;
}

.studio-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: 0.4s;
}

.studio-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    opacity: 0;
    transform: scale(0.95);
    animation: zoomIn 0.6s var(--ease-out-expo) forwards;
    animation-delay: calc(var(--index, 0) * 0.1s + 0.6s);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .dc__main {
        margin-left: 200px;
        padding: 30px;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    /* 基础布局调整 */
    .dc__main {
        margin-left: 0;
        padding: 20px;
    }

    /* 抽屉容器 - 完全重写 */
    .dc__main__container {
        display: block !important;  /* 覆盖全局display */
        opacity: 1 !important;      /* 覆盖全局opacity */
        transform: none !important; /* 移除transform */
        position: fixed !important; /* 改为fixed */
        left: 0;
        right: 0;
        bottom: -50vh;
        width: 100%;
        height: 50vh;
        background: var(--color-background);
        transition: bottom 0.3s var(--ease-out-expo);
        z-index: 90;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* 抽屉展开状态 */
    .dc__main__container[aria-expanded="true"] {
        bottom: 60px !important;
        transform: none !important;
    }

    /* 内容区域 */
    .expander__content {
        height: 100%;
        overflow-y: auto;
        padding: 20px;
        -webkit-overflow-scrolling: touch;
    }

    /* 导航栏 */
    .dc__nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        z-index: 100;
        background: var(--color-background);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* 移除所有遮罩效果 */
    .modal-overlay,
    .has-expanded-content .dc__main::before {
        display: none !important;
    }

    /* 确保内容不会被导航栏遮挡 */
    body {
        padding-bottom: 60px;
    }

    /* 主标题位置调整 - 固定在左侧 */
    .home-title {
        position: fixed;
        left: 20px !important;      /* 使用 !important 确保覆盖 */
        width: auto !important;
        padding-right: 15px;
        text-align: right;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
    }

    .home-title h1 {
        font-size: 18px;
        white-space: nowrap;
    }

    /* 滚动文字位置调整 - 从标题右侧开始 */
    .home-scroller {
        position: fixed !important;
        left: 100px !important;     /* 从标题右侧固定距离开始 */
        right: 20px !important;
        width: auto !important;
        top: 0;
        height: 100vh;
    }

    .home-scroller__content {
        padding-left: 0;
        padding-right: 20px;
    }

    .home-scroller__content span {
        font-size: 16px;
    }

    /* 确保遮罩效果在移动端正常工作 */
    .home-scroller::before,
    .home-scroller::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: calc(50% - 16px);
        pointer-events: none;
        z-index: 1;
    }

    .home-scroller::before {
        top: 0;
        background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    }

    .home-scroller::after {
        bottom: 0;
        background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    }
}

/* 内容区域的链接和按钮使用系统光标 */
.dc__main a,
.dc__nav button,
[data-button] {
    cursor: pointer; /* 使用系统默认指针 */
}

/* 作品集样式 */
.work-intro {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
}

.work-intro__content {
    font-size: 18px;
    line-height: 1.8;
    max-width: 100%;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 80px;
    margin-top: 40px;
}

.work-item {
    padding: 30px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.work-item:last-child {
    border-bottom: none;
}

.work-item__title {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: normal;
}

.work-item__meta {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
}

.work-item__lab {
    font-size: 16px;
    margin-bottom: 5px;
}

.work-item__link {
    color: var(--color-text);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.work-item__link:hover {
    opacity: 1;
}

.work-item__affiliation {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.work-item__description {
    font-size: 16px;
    line-height: 1.6;
}

.work-item__description p {
    margin-bottom: 15px;
}

.work-item__achievements {
    list-style-type: none;
    padding-left: 20px;
    margin: 15px 0;
}

.work-item__achievements li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 15px;
}

.work-item__achievements li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #666;
}

/* 响应式调整 */
@media (min-width: 1200px) {
    .work-grid {
        gap: 100px;
    }
}

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

    .work-item {
        padding: 20px 0;
    }

    .work-item__title {
        font-size: 20px;
    }
}

/* 联系方式样式 */
.contact-intro {
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
}

.contact-intro__content {
    font-size: 18px;
    line-height: 1.8;
    max-width: 100%;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

/* 联系信息部分 */
.contact-info {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: 0.2s;
}

.contact-info__group {
    margin-bottom: 40px;
}

.contact-info__title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
    color: #666;
}

.contact-info__link {
    display: block;
    font-size: 18px;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: 10px;
    transition: opacity var(--transition-speed) ease;
}

.contact-info__link:hover {
    opacity: 0.6;
}

.contact-info__text {
    font-size: 18px;
    line-height: 1.6;
}

/* 表单样式 */
.contact-form {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s var(--ease-out-expo) forwards;
    animation-delay: 0.3s;
}

.form-group {
    margin-bottom: 30px;
}

.form-label {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    background: none;
    border: none;
    border-bottom: 1px solid #ddd;
    color: var(--color-text);
    transition: border-color var(--transition-speed) ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-text);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    padding: 12px 30px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--color-text);
    color: var(--color-background);
    border: none;
    cursor: pointer;
    transition: opacity var(--transition-speed) ease;
}

.form-submit:hover {
    opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* 主标题全局样式 */
.home-title {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.home-title h1 {
    font-size: 20px;          /* 与滚动列表相同 */
    line-height: 1.6;         /* 与滚动列表相同 */
    padding: 0.2em 0;         /* 与滚动列表相同 */
    font-weight: normal;      /* 移除加粗 */
    color: var(--color-text);
    margin: 0;               /* 移除默认边距 */
}

/* 宽屏样式 */
@media (min-width: 769px) {
    .home-title {
        left: 0;
        width: 50%;
        padding-right: 4px;
        text-align: right;
    }

    .home-scroller {
        position: fixed;
        right: 0;
        top: 0;
        width: 50%;
        height: 100vh;
        padding-left: 4px;
    }
}

/* 窄屏样式 */
@media (max-width: 768px) {
    .home-title {
        width: 30% !important;
        left: 0 !important;
        padding-right: 4px;
        text-align: right;
    }

    .home-scroller {
        position: fixed !important;
        left: 30% !important;
        right: 20px !important;
        width: auto !important;
        padding-left: 4px;
    }
}

/* 滚动文字全局样式 */
.home-scroller {
    position: fixed;
    right: 0;
    top: 0;
    width: 50%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.home-scroller__inner {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 100vh;
}

.home-scroller__line {
    position: absolute;
    left: 0;
    right: 0;
    will-change: transform;
}

.home-scroller__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 4px;
}

.home-scroller__content span {
    font-size: 20px;
    line-height: 1.6;
    color: var(--color-text);
    display: block;
    white-space: nowrap;
    padding: 0.2em 0;
}

/* 上下遮罩 */
.home-scroller::before,
.home-scroller::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}

.home-scroller::before {
    top: 0;
    height: calc(50% - 16px);
    background: rgba(255, 255, 255, 0.85);
}

.home-scroller::after {
    bottom: 0;
    height: calc(50% - 16px);
    background: rgba(255, 255, 255, 0.85);
}

/* 展开内容时的毛玻璃效果 */
.has-expanded-content .dc__main::before {
    content: '';
    position: fixed;
    inset: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* 确保展开内容在毛玻璃上层 */
.dc__main__container {
    position: relative;
    z-index: 2;
}

.scroller-viewport {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.accordion-item.active .accordion-content {
    max-height: 500px; /* 确保这个高度足够显示内容 */
    opacity: 1;
    padding: 20px;
    transition: all 0.3s ease-in-out;
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: all 0.3s ease-in-out;
}

/* 主标题样式 */
@media (max-width: 768px) {
    .home-title {
        width: 50%;  /* 改回50% */
        padding-right: 4px;
        text-align: right;  /* 保持右对齐 */
        top: 50%;  /* 恢复原来的位置 */
    }

    .home-scroller {
        width: 50%;  /* 改回50% */
        top: 0;  /* 恢复原来的位置 */
        right: 0;
    }

    .home-scroller__content {
        padding-left: 4px;
        align-items: flex-start;  /* 恢复左对齐 */
    }
}

/* 遮罩层样式 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 89;  /* 降低遮罩层的层级 */
    cursor: pointer !important;
}

@media (max-width: 768px) {
    .has-expanded-content .modal-overlay {
        display: block;
        opacity: 1;
    }

    .dc__main__container {
        z-index: 90;  /* 确保内容在遮罩层上方但在导航栏下方 */
    }
}