/* ========================================
   Arwes 高保真特效系统
   1:1 还原 Arwes 官方设计
   ======================================== */

/* ==================== Arwes 核心动画 ==================== */

/* 文字逐字显示动画 */
@keyframes arwes-text-reveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* 文字闪烁/故障效果 */
@keyframes arwes-glitch {
    0%, 100% {
        transform: translate(0);
        opacity: 1;
    }
    20% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }
    40% {
        transform: translate(2px, -2px);
        opacity: 0.9;
    }
    60% {
        transform: translate(-1px, -1px);
        opacity: 0.85;
    }
    80% {
        transform: translate(1px, 1px);
        opacity: 0.95;
    }
}

/* 边框线条展开动画 - 从左上角开始 */
@keyframes arwes-border-unfold-tl {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    50% {
        width: 100%;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
}

/* 边框线条展开动画 - 从右下角开始 */
@keyframes arwes-border-unfold-br {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    50% {
        width: 100%;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
}

/* 边框闪烁效果 */
@keyframes arwes-border-flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 77.999%, 79%, 100% {
        opacity: 1;
    }
    20%, 21.999%, 63%, 63.999%, 78%, 78.999% {
        opacity: 0.4;
    }
}

/* 扫描线动画 */
@keyframes arwes-scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

/* 脉冲发光效果 */
@keyframes arwes-pulse-glow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(20px);
    }
    50% {
        opacity: 1;
        filter: blur(30px);
    }
}

/* ==================== Arwes 文字特效 ==================== */

/* Arwes 标题文字 */
.arwes-text {
    position: relative;
    color: hsl(180deg 88.18% 56.86%);
    font-family: 'Titillium Web', 'Rajdhani', sans-serif;
    font-weight: 300;
    letter-spacing: 0.05em;
    animation: arwes-text-reveal 0.8s ease-out;
}

/* Arwes 文字逐字显示 */
.arwes-text-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid hsl(180deg 88.18% 56.86%);
    animation: 
        arwes-text-reveal 2s steps(30) forwards,
        arwes-cursor-blink 0.75s step-end infinite;
}

@keyframes arwes-cursor-blink {
    50% { border-color: transparent; }
}

/* Arwes 故障文字效果 */
.arwes-text-glitch {
    position: relative;
    color: hsl(180deg 88.18% 56.86%);
    animation: arwes-glitch 0.3s infinite;
}

.arwes-text-glitch::before,
.arwes-text-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.arwes-text-glitch::before {
    color: hsl(300deg 100% 50%);
    animation: arwes-glitch 0.3s infinite;
    clip-path: inset(0 0 50% 0);
    transform: translate(-2px);
}

.arwes-text-glitch::after {
    color: hsl(180deg 100% 50%);
    animation: arwes-glitch 0.3s infinite reverse;
    clip-path: inset(50% 0 0 0);
    transform: translate(2px);
}

/* ==================== Arwes 边框特效 ==================== */

/* Arwes 八边形裁剪 */
.arwes-frame-octagon {
    position: relative;
    clip-path: polygon(
        0 1rem,
        1rem 0,
        calc(100% - 1rem) 0,
        100% 1rem,
        100% calc(100% - 1rem),
        calc(100% - 1rem) 100%,
        1rem 100%,
        0 calc(100% - 1rem)
    );
}

/* Arwes 边框线条容器 */
.arwes-border-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Arwes 角落装饰线条 */
.arwes-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid hsl(180deg 88.18% 56.86%);
    transition: all 0.2s ease-out;
}

.arwes-corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    animation: arwes-border-unfold-tl 0.4s ease-out;
}

.arwes-corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.arwes-corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.arwes-corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    animation: arwes-border-unfold-br 0.4s ease-out;
}

/* Arwes 边框动画线条 */
.arwes-border-line {
    position: absolute;
    background: hsl(180deg 88.18% 56.86%);
    opacity: 0;
    transition: all 0.2s ease-out;
}

.arwes-border-line-top {
    top: 0;
    left: 0;
    height: 1px;
    animation: arwes-border-unfold-tl 0.4s ease-out;
}

.arwes-border-line-bottom {
    bottom: 0;
    right: 0;
    height: 1px;
    animation: arwes-border-unfold-br 0.4s ease-out;
}

.arwes-border-line-left {
    top: 0;
    left: 0;
    width: 1px;
    animation: arwes-border-unfold-tl 0.4s ease-out;
}

.arwes-border-line-right {
    bottom: 0;
    right: 0;
    width: 1px;
    animation: arwes-border-unfold-br 0.4s ease-out;
}

/* ==================== Arwes 卡片特效 ==================== */

/* Arwes 卡片基础样式 */
.arwes-card {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
    background: hsla(180, 100%, 10%, 0.1);
    border: 1px solid hsla(180, 33%, 25%, 0.5);
    clip-path: polygon(
        0 1rem,
        1rem 0,
        calc(100% - 1rem) 0,
        100% 1rem,
        100% calc(100% - 1rem),
        calc(100% - 1rem) 100%,
        1rem 100%,
        0 calc(100% - 1rem)
    );
    transition: all 0.2s ease-out;
}

.arwes-card:hover {
    background: hsla(180, 100%, 10%, 0.2);
    border-color: hsla(180, 33%, 30%, 0.5);
}

/* Arwes 卡片内容容器 */
.arwes-card-content {
    position: relative;
    z-index: 1;
    display: block;
    padding: 1rem;
}

/* Arwes 卡片标题 */
.arwes-card-title {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
    color: hsl(180deg 88.18% 56.86%);
    font-family: 'Titillium Web', sans-serif;
}

/* ==================== Arwes 按钮特效 ==================== */

/* Arwes 按钮基础样式 */
.arwes-button {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    padding: 0 12px;
    min-width: 60px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    text-decoration: none;
    color: hsl(60deg 100% 75%);
    text-align: center;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

/* Arwes 按钮边框效果 */
.arwes-button::before,
.arwes-button::after {
    content: '';
    position: absolute;
    height: 100%;
    border-left: 1px solid hsl(60deg 100% 75%);
    transition: all 0.2s ease-out;
}

.arwes-button::before {
    left: 0;
    bottom: 0;
    transform: translate(4px, 4px) scaleY(0.2);
    transform-origin: left bottom;
}

.arwes-button::after {
    right: 0;
    bottom: 0;
    transform: translate(-4px, -4px) scaleY(0.2);
    transform-origin: right bottom;
}

.arwes-button:hover::before,
.arwes-button:hover::after {
    border-color: hsl(60deg 100% 40% / 50%);
    transform: translate(0, 0) scale(1);
}

/* Arwes 按钮八边形裁剪 */
.arwes-button-octagon {
    clip-path: polygon(
        0 6px,
        6px 0,
        calc(100% - 6px) 0,
        100% 6px,
        100% calc(100% - 6px),
        calc(100% - 6px) 100%,
        6px 100%,
        0 calc(100% - 6px)
    );
}

/* ==================== Arwes 背景特效 ==================== */

/* Arwes 背景层 */
.arwes-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: hsl(180deg 50% 3%);
}

/* Arwes 背景网格 */
.arwes-bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(hsla(180, 50%, 30%, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, hsla(180, 50%, 30%, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* Arwes 背景扫描线 */
.arwes-bg-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        hsla(180, 100%, 50%, 0.3),
        transparent
    );
    animation: arwes-scanline 8s linear infinite;
    pointer-events: none;
}

/* Arwes 背景粒子 */
.arwes-bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.arwes-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: hsla(180, 100%, 50%, 0.5);
    border-radius: 50%;
    animation: arwes-particle-float 10s linear infinite;
}

@keyframes arwes-particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) translateX(20px);
        opacity: 0;
    }
}

/* Arwes 背景发光效果 */
.arwes-bg-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        hsla(180, 100%, 50%, 0.1) 0%,
        transparent 70%
    );
    animation: arwes-pulse-glow 4s ease-in-out infinite;
    pointer-events: none;
}

/* ==================== Arwes 输入框特效 ==================== */

/* Arwes 输入框 */
.arwes-input {
    position: relative;
    width: 100%;
    padding: 8px 12px;
    background: hsla(180, 50%, 5%, 0.8);
    border: 1px solid hsla(180, 33%, 25%, 0.5);
    color: hsl(180deg 88.18% 56.86%);
    font-family: 'Titillium Web', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease-out;
    clip-path: polygon(
        0 4px,
        4px 0,
        calc(100% - 4px) 0,
        100% 4px,
        100% calc(100% - 4px),
        calc(100% - 4px) 100%,
        4px 100%,
        0 calc(100% - 4px)
    );
}

.arwes-input:focus {
    outline: none;
    border-color: hsl(180deg 88.18% 56.86%);
    box-shadow: 0 0 10px hsla(180, 100%, 50%, 0.2);
}

.arwes-input::placeholder {
    color: hsla(180, 50%, 50%, 0.5);
}

/* ==================== Arwes 导航特效 ==================== */

/* Arwes 导航链接 */
.arwes-nav-link {
    position: relative;
    color: hsla(180, 50%, 70%, 0.8);
    text-decoration: none;
    font-family: 'Titillium Web', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease-out;
}

.arwes-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: hsl(180deg 88.18% 56.86%);
    transition: width 0.2s ease-out;
}

.arwes-nav-link:hover {
    color: hsl(180deg 88.18% 56.86%);
}

.arwes-nav-link:hover::after {
    width: 100%;
}

/* ==================== Arwes 分隔线 ==================== */

/* Arwes 水平分隔线 */
.arwes-divider {
    position: relative;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        hsla(180, 33%, 25%, 0.5),
        transparent
    );
    margin: 2rem 0;
}

/* Arwes 垂直分隔线 */
.arwes-divider-vertical {
    position: relative;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent,
        hsla(180, 33%, 25%, 0.5),
        transparent
    );
}

/* ==================== Arwes 加载动画 ==================== */

/* Arwes 加载器 */
.arwes-loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.arwes-loader-ring {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: arwes-loader-spin 1.5s linear infinite;
}

.arwes-loader-ring:nth-child(1) {
    border-top-color: hsl(180deg 88.18% 56.86%);
}

.arwes-loader-ring:nth-child(2) {
    inset: 8px;
    border-right-color: hsl(60deg 100% 75%);
    animation-delay: 0.2s;
    animation-direction: reverse;
}

.arwes-loader-ring:nth-child(3) {
    inset: 16px;
    border-bottom-color: hsl(300deg 100% 50%);
    animation-delay: 0.4s;
}

@keyframes arwes-loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== Arwes 工具类 ==================== */

/* Arwes 颜色类 */
.arwes-color-primary { color: hsl(180deg 88.18% 56.86%); }
.arwes-color-secondary { color: hsl(60deg 100% 75%); }
.arwes-color-tertiary { color: hsl(300deg 100% 50%); }

/* Arwes 背景色类 */
.arwes-bg-primary { background: hsl(180deg 50% 3%); }
.arwes-bg-secondary { background: hsla(180, 100%, 10%, 0.1); }
.arwes-bg-tertiary { background: hsla(180, 100%, 10%, 0.2); }

/* Arwes 边框色类 */
.arwes-border-primary { border-color: hsl(180deg 88.18% 56.86%); }
.arwes-border-secondary { border-color: hsla(180, 33%, 25%, 0.5); }
.arwes-border-tertiary { border-color: hsla(180, 33%, 30%, 0.5); }

/* ==================== 响应式优化 ==================== */

@media (max-width: 768px) {
    .arwes-card {
        clip-path: polygon(
            0 0.5rem,
            0.5rem 0,
            calc(100% - 0.5rem) 0,
            100% 0.5rem,
            100% calc(100% - 0.5rem),
            calc(100% - 0.5rem) 100%,
            0.5rem 100%,
            0 calc(100% - 0.5rem)
        );
    }
    
    .arwes-button {
        padding: 0 8px;
        min-width: 40px;
        height: 20px;
        line-height: 20px;
        font-size: 10px;
    }
}

/* ==================== 无障碍优化 ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
