/* 隐藏可能由部署平台注入的导航栏 */
body > nav:not(.navbar),
body > header:not(.navbar) {
    display: none !important;
}

/* 导航栏样式 - 与MSG项目保持一致 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 300;
    color: #742581;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.navbar-links {
    display: flex;
    gap: 24px;
}

.navbar-link {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid transparent;
    position: relative;
}

.navbar-link:hover {
    color: #742581;
}

.navbar-link.active {
    color: #742581;
    border-bottom-color: #742581;
    font-weight: 500;
}

/* 语言切换器样式 */
.language-switcher {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

.language-switcher::-ms-expand {
    display: none;
}

.language-switcher:hover {
    border-color: #742581;
}

.language-switcher:focus {
    border-color: #742581;
    box-shadow: 0 0 0 3px rgba(116, 37, 129, 0.1);
}

/* 移动端菜单按钮 - 默认隐藏 */
.mobile-menu-btn {
    display: none;
}

/* 移动端侧边栏 - 默认隐藏 */
.mobile-sidebar {
    display: none;
}

/* 移动端遮罩层 - 默认隐藏 */
.mobile-menu-overlay {
    display: none;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    /* 汉堡菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        width: 40px;
        height: 40px;
        background: white;
        border: 1px solid #e8e8e8;
        border-radius: 0;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .mobile-menu-btn:hover {
        background: #f5f5f5;
        border-color: #d0d0d0;
    }

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
        color: #374151;
    }

    /* 侧边栏菜单 */
    .mobile-sidebar {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        border-left: 1px solid #e8e8e8;
        will-change: right;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-sidebar.active {
        right: 0;
    }

    /* 移动端导航栏调整 */
    .navbar {
        padding: 0 16px;
    }

    .navbar-links {
        display: none;
    }

    .navbar-right {
        display: flex;
        align-items: center;
    }

    .language-switcher {
        display: none; /* 桌面端语言切换器隐藏 */
    }

    /* 移动端语言切换器 */
    .mobile-language-switcher {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        padding: 6px 12px;
        font-size: 14px;
        color: #374151;
        cursor: pointer;
        transition: border-color 0.2s, box-shadow 0.2s;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
        padding-right: 32px;
        width: 100%;
        margin-top: 16px;
    }

    .mobile-language-switcher::-ms-expand {
        display: none;
    }

    .mobile-language-switcher:hover {
        border-color: #742581;
    }

    .mobile-language-switcher:focus {
        border-color: #742581;
        box-shadow: 0 0 0 3px rgba(116, 37, 129, 0.1);
    }

    /* 移动端菜单内容 */
    .mobile-menu-content {
        padding: 20px;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #e8e8e8;
    }

    .mobile-menu-title {
        font-size: 18px;
        font-weight: 500;
        color: #374151;
    }

    .mobile-menu-close {
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: background 0.2s;
    }

    .mobile-menu-close:hover {
        background: #f5f5f5;
    }

    .mobile-menu-close svg {
        width: 20px;
        height: 20px;
        color: #374151;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 16px;
    }

    .mobile-nav-link {
        display: block;
        padding: 12px 16px;
        color: #374151;
        text-decoration: none;
        font-size: 14px;
        font-weight: 300;
        transition: background 0.2s, color 0.2s;
        border-radius: 6px;
    }

    .mobile-nav-link:hover {
        background: #f9fafb;
        color: #742581;
    }

    .mobile-nav-link.active {
        background: #f3f4f6;
        color: #742581;
        font-weight: 400;
    }

    /* 遮罩层 */
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* 调整页面顶部间距，为固定导航栏留出空间 */
body {
    padding-top: 80px !important;
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
}

/* 字体定义 */
@font-face {
    font-family: 'UDXinWan';
    src: url('../fonts/A-OTF 新丸ゴ Pro-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'UDXinWan';
    src: url('../fonts/A-OTF 新丸ゴ Pro-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'UDXinWan';
    src: url('../fonts/A-OTF 新丸ゴ Pro-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'mplus1p';
    src: url('../fonts/MPLUS1p-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'mplus1p';
    src: url('../fonts/MPLUS1p-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'mplus1p';
    src: url('../fonts/MPLUS1p-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}


/* Page fade transitions */
body.fade-base { opacity: 0; transition: opacity 250ms ease; }
body.fade-in { opacity: 1; }
body.fade-out { opacity: 0; }

@font-face {
    font-family: 'Soft Go Std';
    src: url('../fonts/Soft Go Std Ligh.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Soft Go Std';
    src: url('../fonts/Soft Go Std Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Soft Go Std';
    src: url('../fonts/Soft Go Std Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'bebasneue';
    src: url('../fonts/BebasNeue-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'AaChaoDaJianYuan';
    src: url('../fonts/Aa超大简圆 2万字.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Kosugi Maru';
    src: url('../fonts/KosugiMaru-Regular.ttf') format('truetype');
    font-display: swap;
}

.sakura-text-color {
    color: #F19DB5;
}

#main-title {
    font-weight: 700 !important;
    font-family: 'Inter', 'Noto Sans CJK JP', 'Noto Sans SC', sans-serif;
}

.aspect-photo {
    aspect-ratio: 89 / 127;
}

#photo-card {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    margin-top: 4px;
    margin-bottom: 4px;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #8B5CF6;
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #8B5CF6;
    cursor: pointer;
    border-radius: 50%;
}

details>summary {
    cursor: pointer;
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

.color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#image-container {
    cursor: grab;
}

#image-container:active {
    cursor: grabbing;
}

#info-bar {
    position: relative;
    overflow: hidden;
}
.movable-block {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* Cropper Modal Styles */
#crop-modal, #save-modal {
    background-color: rgba(0, 0, 0, 0.8);
}
#crop-container {
    max-width: 90vw;
    max-height: 75vh;
}

#save-modal img {
    max-width: 90vw;
    max-height: 80vh;
}

.tick {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.weight-btn.active-weight {
    background-color: #8B5CF6;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* 折叠按钮样式 */
details[open] > summary svg {
    transform: rotate(180deg);
}

details > summary:hover svg {
    color: currentColor;
}

/* 主菜单按钮样式 */
details > summary {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    background: transparent;
    border: none;
    border-radius: 6px;
    margin: 0;
    padding: 10px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

details > summary:hover {
    background: rgba(139, 92, 246, 0.05);
    color: rgb(109 40 217);
}

details > summary:active {
    transform: scale(0.98);
}

/* 子菜单按钮特殊样式 */
details details > summary {
    background: transparent;
    border: none;
    margin: 2px 0 2px 16px;
    border-radius: 6px;
    position: relative;
    padding: 8px 12px;
    font-size: 0.9rem;
}

details details > summary::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 1px;
}

details details > summary:hover {
    background: rgba(139, 92, 246, 0.08);
    color: rgb(109 40 217);
}

details details > summary:active {
    transform: scale(0.97);
}

/* 三级子菜单样式 */
details details details > summary {
    background: transparent;
    border: none;
    margin: 1px 0 1px 24px;
    border-radius: 4px;
    font-size: 0.85rem;
    padding: 6px 10px;
}

details details details > summary::before {
    left: -16px;
    width: 1px;
    height: 12px;
    background: #0ea5e9;
    border-radius: 1px;
}

details details details > summary:hover {
    background: rgba(14, 165, 233, 0.08);
    color: rgb(2, 132, 199);
}

/* 模块容器样式 */
.module-container {
    margin: 8px 0;
    padding: 0;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    animation: fadeInUp 0.3s ease-out;
}

.module-container:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* 子模块内容区域样式 */
details > div {
    overflow: hidden;
    padding: 12px 0;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-8px);
}

details[open] > div {
    max-height: 2000px;
    opacity: 1;
    transform: translateY(0);
}

details details > div {
    background: rgba(139, 92, 246, 0.02);
    border-left: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 0;
    margin-top: 4px;
    margin-left: 16px;
    padding: 8px 12px;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-6px);
}

details details[open] > div {
    max-height: 1500px;
    opacity: 1;
    transform: translateY(0);
}

details details details > div {
    background: rgba(14, 165, 233, 0.02);
    border-left: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 0;
    margin-top: 4px;
    margin-left: 24px;
    padding: 6px 10px;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-4px);
}

details details details[open] > div {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
}

/* 滑动动画已替换为transition，提供更平滑的展开/收起效果 */

/* 增强子菜单视觉层次 - 已在上面定义，这里移除重复 */

/* 为输入控件添加更好的样式 */
input[type="text"], input[type="color"], select {
    transition: all 0.2s ease;
}

input[type="text"]:focus, select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* 优化颜色选择器样式 */
.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 优化滑块样式 */
input[type="range"]:hover {
    transform: translateY(-1px);
}

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

/* 底部署名样式 - 仅保留动画，确保Tailwind样式生效 */
footer {
    animation: fadeInUp 0.6s ease-out 0.3s both;
    width: 100% !important;
}

footer > div {
    max-width: 80rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .module-container {
        margin: 6px 0;
        padding-bottom: 8px;
    }

    details > summary {
        padding: 8px 10px;
    }

    details details > summary {
        margin-left: 12px;
        padding: 6px 10px;
    }

    details details details > summary {
        margin-left: 20px;
        padding: 4px 8px;
    }
}


/* Apply success flash for merge page */
.btn-apply-success {
  background-color: #16a34a !important; /* green-600 */
  animation: pop 260ms ease;
}


/* Apply button pop animation */
@keyframes pop {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.btn-pop { animation: pop 260ms ease; }

/* Pill-style Tool Switcher */
#tool-switcher {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tool-switcher-btn {
  position: relative;
  z-index: 10;
  padding: 0.5rem 1.25rem; /* 8px 20px */
  border-radius: 9999px;
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: #4b5563; /* gray-600 */
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: color 300ms ease-in-out;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.tool-switcher-bg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background-color: white;
  border-radius: 9999px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#tool-switcher.fad-active .tool-switcher-bg {
  transform: translateX(calc(100%));
}

#tool-switcher.fad-active #btn-tool-merge,
#tool-switcher:not(.fad-active) #btn-tool-fad {
  color: #4b5563; /* gray-600 */
}

#tool-switcher:not(.fad-active) #btn-tool-merge,
#tool-switcher.fad-active #btn-tool-fad {
  color: #6d28d9; /* violet-700 */
}


/* Capcut Path Modal Custom Styles */
#capcut-path-modal .bg-white {
  font-family: 'Kosugi Maru', sans-serif;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem; /* 12px */
}

#capcut-path-modal h2 {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  color: #4c51bf; /* indigo-700 */
}

#capcut-path-modal code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  background-color: #f3f4f6; /* gray-100 */
  color: #be123c; /* rose-700 */
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 0.875em;
  border-radius: 0.25rem;
}

#capcut-path-modal p {
  line-height: 1.6;
  color: #4b5563; /* gray-600 */
}

#capcut-path-modal .font-semibold {
  color: #374151; /* gray-700 */
}

/* SRT/ASS Fixer Tool Switcher */
#tool-switcher.ass-active .tool-switcher-bg {
  transform: translateX(calc(100%));
}

#tool-switcher.ass-active #btn-tool-srt,
#tool-switcher:not(.ass-active) #btn-tool-ass {
  color: #4b5563; /* gray-600 */
}

#tool-switcher:not(.ass-active) #btn-tool-srt,
#tool-switcher.ass-active #btn-tool-ass {
  color: #6d28d9; /* violet-700 */
}
