/**
 * 🍎 Apple风格UX增强样式
 * 提供完整的Apple Human Interface Guidelines视觉体验
 */

/* =============== CSS变量定义 =============== */
:root {
    /* Apple系统颜色 */
    --apple-blue: #007AFF;
    --apple-green: #34C759;
    --apple-orange: #FF9500;
    --apple-red: #FF3B30;
    --apple-purple: #AF52DE;
    --apple-pink: #FF2D92;
    --apple-teal: #5AC8FA;
    --apple-indigo: #5856D6;
    --apple-yellow: #FFCC00;
    
    /* 语义化颜色 */
    --apple-success: var(--apple-green);
    --apple-warning: var(--apple-orange);
    --apple-error: var(--apple-red);
    --apple-info: var(--apple-blue);
    
    /* 背景和表面 */
    --apple-background-primary: #FFFFFF;
    --apple-background-secondary: #F2F2F7;
    --apple-background-tertiary: #FFFFFF;
    --apple-background-grouped: #F2F2F7;
    
    /* 标签和文本 */
    --apple-label-primary: #000000;
    --apple-label-secondary: rgba(60, 60, 67, 0.6);
    --apple-label-tertiary: rgba(60, 60, 67, 0.3);
    --apple-label-quaternary: rgba(60, 60, 67, 0.18);
    
    /* 分隔线和边框 */
    --apple-separator: rgba(60, 60, 67, 0.29);
    --apple-separator-opaque: #C6C6C8;
    
    /* 填充色 */
    --apple-fill-primary: rgba(120, 120, 128, 0.2);
    --apple-fill-secondary: rgba(120, 120, 128, 0.16);
    --apple-fill-tertiary: rgba(120, 120, 128, 0.12);
    --apple-fill-quaternary: rgba(120, 120, 128, 0.08);
    
    /* 阴影 */
    --apple-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --apple-shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --apple-shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.15);
    --apple-shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* 模糊效果 */
    --apple-blur-light: blur(20px);
    --apple-blur-medium: blur(40px);
    --apple-blur-heavy: blur(60px);
    
    /* 圆角 */
    --apple-radius-small: 8px;
    --apple-radius-medium: 12px;
    --apple-radius-large: 16px;
    --apple-radius-extra-large: 20px;
    
    /* 动画时长 */
    --apple-duration-instant: 0ms;
    --apple-duration-fast: 200ms;
    --apple-duration-medium: 300ms;
    --apple-duration-slow: 500ms;
    
    /* 动画缓动 */
    --apple-easing-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
    --apple-easing-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1);
    --apple-easing-accelerate: cubic-bezier(0.4, 0.0, 1, 1);
    --apple-easing-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 字体 */
    --apple-font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --apple-font-monospace: 'SF Mono', Menlo, Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    :root {
        --apple-background-primary: #000000;
        --apple-background-secondary: #1C1C1E;
        --apple-background-tertiary: #2C2C2E;
        --apple-background-grouped: #000000;
        
        --apple-label-primary: #FFFFFF;
        --apple-label-secondary: rgba(235, 235, 245, 0.6);
        --apple-label-tertiary: rgba(235, 235, 245, 0.3);
        --apple-label-quaternary: rgba(235, 235, 245, 0.18);
        
        --apple-separator: rgba(84, 84, 88, 0.65);
        --apple-separator-opaque: #38383A;
        
        --apple-fill-primary: rgba(120, 120, 128, 0.36);
        --apple-fill-secondary: rgba(120, 120, 128, 0.32);
        --apple-fill-tertiary: rgba(120, 120, 128, 0.24);
        --apple-fill-quaternary: rgba(120, 120, 128, 0.18);
    }
}

[data-theme="dark"] {
    --apple-background-primary: #000000;
    --apple-background-secondary: #1C1C1E;
    --apple-background-tertiary: #2C2C2E;
    --apple-background-grouped: #000000;
    
    --apple-label-primary: #FFFFFF;
    --apple-label-secondary: rgba(235, 235, 245, 0.6);
    --apple-label-tertiary: rgba(235, 235, 245, 0.3);
    --apple-label-quaternary: rgba(235, 235, 245, 0.18);
    
    --apple-separator: rgba(84, 84, 88, 0.65);
    --apple-separator-opaque: #38383A;
    
    --apple-fill-primary: rgba(120, 120, 128, 0.36);
    --apple-fill-secondary: rgba(120, 120, 128, 0.32);
    --apple-fill-tertiary: rgba(120, 120, 128, 0.24);
    --apple-fill-quaternary: rgba(120, 120, 128, 0.18);
}

/* =============== 基础重置和工具类 =============== */

.apple-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.apple-blur-background {
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
}

/* =============== 模态框系统 =============== */

.apple-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--apple-duration-medium) var(--apple-easing-standard),
                visibility var(--apple-duration-medium) var(--apple-easing-standard);
}

.apple-modal--visible {
    opacity: 1;
    visibility: visible;
}

.apple-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--apple-duration-medium) var(--apple-easing-standard);
}

.apple-modal__backdrop--blur {
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
}

.apple-modal__backdrop--solid {
    background: rgba(0, 0, 0, 0.6);
}

.apple-modal__backdrop--transparent {
    background: transparent;
}

.apple-modal--visible .apple-modal__backdrop {
    opacity: 1;
}

.apple-modal__container {
    position: relative;
    background: var(--apple-background-primary);
    border-radius: var(--apple-radius-large);
    box-shadow: var(--apple-shadow-modal);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--apple-duration-medium) var(--apple-easing-spring);
    will-change: transform;
}

.apple-modal--visible .apple-modal__container {
    transform: translateY(0) scale(1);
}

/* 模态框尺寸变体 */
.apple-modal--small .apple-modal__container {
    width: 320px;
    min-height: 200px;
}

.apple-modal--medium .apple-modal__container {
    width: 480px;
    min-height: 300px;
}

.apple-modal--large .apple-modal__container {
    width: 640px;
    min-height: 400px;
}

.apple-modal--fullscreen .apple-modal__container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

.apple-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--apple-separator);
    background: var(--apple-background-secondary);
    flex-shrink: 0;
    min-height: 60px;
}

.apple-modal__title {
    font-family: var(--apple-font-system);
    font-size: 20px;
    font-weight: 600;
    color: var(--apple-label-primary);
    margin: 0;
    line-height: 1.2;
    flex: 1;
    padding-right: 16px;
}

.apple-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--apple-fill-secondary);
    color: var(--apple-label-secondary);
    cursor: pointer;
    transition: all var(--apple-duration-fast) var(--apple-easing-standard);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.apple-modal__close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--apple-label-primary);
    opacity: 0;
    transform: scale(0);
    border-radius: 50%;
    transition: all var(--apple-duration-fast) var(--apple-easing-standard);
}

.apple-modal__close:hover {
    background: var(--apple-fill-tertiary);
    color: var(--apple-label-primary);
    transform: scale(1.1);
}

.apple-modal__close:hover::before {
    opacity: 0.1;
    transform: scale(1);
}

.apple-modal__close:active {
    transform: scale(0.95);
}

.apple-modal__close svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.apple-modal__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--apple-fill-secondary) transparent;
    -webkit-overflow-scrolling: touch;
}

.apple-modal__body::-webkit-scrollbar {
    width: 8px;
}

.apple-modal__body::-webkit-scrollbar-track {
    background: transparent;
}

.apple-modal__body::-webkit-scrollbar-thumb {
    background: var(--apple-fill-secondary);
    border-radius: 4px;
}

.apple-modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--apple-fill-tertiary);
}

/* =============== 加载状态组件 =============== */

.apple-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apple-loading-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
}

.apple-loading-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--apple-background-primary);
    border-radius: var(--apple-radius-large);
    box-shadow: var(--apple-shadow-heavy);
    min-width: 200px;
    text-align: center;
}

.apple-loading-spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
}

.apple-loading__spinner-svg {
    width: 100%;
    height: 100%;
    color: var(--apple-blue);
    animation: apple-spinner-rotate 2s linear infinite;
}

.apple-loading-text {
    font-family: var(--apple-font-system);
    font-size: 16px;
    font-weight: 500;
    color: var(--apple-label-primary);
    margin: 0;
    line-height: 1.4;
}

@keyframes apple-spinner-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 加载覆盖层 */
.apple-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
    border-radius: inherit;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--apple-duration-medium) var(--apple-easing-standard);
}

[data-theme="dark"] .apple-loading-overlay {
    background: rgba(0, 0, 0, 0.95);
}

.apple-loading-overlay.show {
    opacity: 1;
}

.apple-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.apple-loading--small {
    gap: 8px;
}

.apple-loading--small .apple-loading__spinner {
    width: 24px;
    height: 24px;
}

.apple-loading--small .apple-loading__message {
    font-size: 14px;
}

.apple-loading--medium {
    gap: 12px;
}

.apple-loading--medium .apple-loading__spinner {
    width: 32px;
    height: 32px;
}

.apple-loading--large {
    gap: 16px;
}

.apple-loading--large .apple-loading__spinner {
    width: 48px;
    height: 48px;
}

.apple-loading--large .apple-loading__message {
    font-size: 18px;
}

.apple-loading__message {
    font-family: var(--apple-font-system);
    font-size: 16px;
    font-weight: 500;
    color: var(--apple-label-primary);
    margin: 0;
    line-height: 1.4;
}

/* 进度条加载 */
.apple-loading__progress {
    width: 200px;
    margin-bottom: 16px;
}

.apple-loading__progress-bar {
    width: 100%;
    height: 4px;
    background: var(--apple-fill-quaternary);
    border-radius: 2px;
    overflow: hidden;
}

.apple-loading__progress-fill {
    height: 100%;
    background: var(--apple-blue);
    border-radius: 2px;
    transition: width var(--apple-duration-medium) var(--apple-easing-standard);
    transform-origin: left;
}

/* 骨架屏加载 */
.apple-loading__skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.apple-skeleton-line {
    height: 16px;
    background: linear-gradient(
        90deg,
        var(--apple-fill-quaternary) 25%,
        var(--apple-fill-tertiary) 50%,
        var(--apple-fill-quaternary) 75%
    );
    background-size: 200% 100%;
    border-radius: 8px;
    animation: apple-skeleton-shimmer 2s infinite;
}

.apple-skeleton-line--short {
    width: 60%;
}

@keyframes apple-skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =============== 通知系统 =============== */

.apple-notifications {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apple-notifications--top-right {
    top: 20px;
    right: 20px;
}

.apple-notifications--top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.apple-notifications--top-left {
    top: 20px;
    left: 20px;
}

.apple-notifications--bottom-right {
    bottom: 20px;
    right: 20px;
}

.apple-notifications--bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.apple-notifications--bottom-left {
    bottom: 20px;
    left: 20px;
}

.apple-notification {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--apple-background-primary);
    border: 1px solid var(--apple-separator);
    border-radius: var(--apple-radius-medium);
    box-shadow: var(--apple-shadow-heavy);
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: all var(--apple-duration-medium) var(--apple-easing-spring);
}

.apple-notification--visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.apple-notification__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.apple-notification--success .apple-notification__icon {
    color: var(--apple-success);
}

.apple-notification--error .apple-notification__icon {
    color: var(--apple-error);
}

.apple-notification--warning .apple-notification__icon {
    color: var(--apple-warning);
}

.apple-notification--info .apple-notification__icon {
    color: var(--apple-info);
}

.apple-notification__content {
    flex: 1;
    min-width: 0;
}

.apple-notification__message {
    font-family: var(--apple-font-system);
    font-size: 15px;
    font-weight: 500;
    color: var(--apple-label-primary);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.apple-notification__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--apple-label-tertiary);
    cursor: pointer;
    transition: all var(--apple-duration-fast) var(--apple-easing-standard);
    flex-shrink: 0;
    margin: -4px -4px -4px 8px;
}

.apple-notification__close:hover {
    background: var(--apple-fill-quaternary);
    color: var(--apple-label-secondary);
    transform: scale(1.1);
}

.apple-notification__close:active {
    transform: scale(0.9);
}

/* =============== 表单验证样式 =============== */

.apple-field--error {
    border-color: var(--apple-error) !important;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1) !important;
    animation: apple-field-shake var(--apple-duration-fast) ease-in-out;
}

.apple-field--success {
    border-color: var(--apple-success) !important;
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1) !important;
}

.apple-field-error {
    display: block;
    font-family: var(--apple-font-system);
    font-size: 13px;
    font-weight: 500;
    color: var(--apple-error);
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--apple-duration-fast) var(--apple-easing-decelerate);
}

.apple-field-error[style*="opacity: 1"] {
    opacity: 1;
    transform: translateY(0);
}

.apple-field-success-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--apple-success);
    opacity: 0;
    animation: apple-field-success var(--apple-duration-medium) var(--apple-easing-spring) forwards;
}

@keyframes apple-field-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes apple-field-success {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* =============== 跳过链接 =============== */

.apple-skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--apple-background-primary);
    color: var(--apple-blue);
    padding: 8px 16px;
    border-radius: var(--apple-radius-small);
    text-decoration: none;
    font-family: var(--apple-font-system);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--apple-blue);
    z-index: 3000;
    transition: top var(--apple-duration-fast) var(--apple-easing-standard);
}

.apple-skip-link:focus {
    top: 8px;
}

/* =============== 焦点指示器增强 =============== */

.apple-focus-visible {
    outline: 2px solid var(--apple-blue) !important;
    outline-offset: 2px !important;
    border-radius: 4px !important;
}

/* 移除默认的焦点样式 */
button:focus:not(.apple-focus-visible),
input:focus:not(.apple-focus-visible),
select:focus:not(.apple-focus-visible),
textarea:focus:not(.apple-focus-visible),
[tabindex]:focus:not(.apple-focus-visible) {
    outline: none !important;
}

/* =============== 响应式设计 =============== */

@media (max-width: 768px) {
    .apple-modal__container {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        margin: 16px;
    }
    
    .apple-modal--fullscreen .apple-modal__container {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .apple-modal__header {
        padding: 16px 20px 12px;
        min-height: 56px;
    }
    
    .apple-modal__title {
        font-size: 18px;
    }
    
    .apple-modal__body {
        padding: 20px;
    }
    
    .apple-notifications {
        left: 16px !important;
        right: 16px !important;
        max-width: none;
        transform: none !important;
    }
    
    .apple-notification {
        min-width: 0;
        max-width: none;
    }
    
    /* 移动端安全区域适配 */
    .apple-modal {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .apple-notifications--top-right,
    .apple-notifications--top-center,
    .apple-notifications--top-left {
        top: calc(16px + env(safe-area-inset-top));
    }
    
    .apple-notifications--bottom-right,
    .apple-notifications--bottom-center,
    .apple-notifications--bottom-left {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .apple-modal__header {
        padding: 12px 16px 8px;
        min-height: 48px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .apple-modal__title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .apple-modal__body {
        padding: 16px;
    }
    
    .apple-loading-modal__content {
        padding: 24px;
        min-width: 160px;
    }
    
    .apple-loading-spinner {
        width: 32px;
        height: 32px;
        margin-bottom: 12px;
    }
    
    .apple-loading-text {
        font-size: 14px;
    }
}

/* =============== 减少动画支持 =============== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .apple-modal__container {
        transform: none !important;
    }
    
    .apple-notification {
        transform: none !important;
    }
    
    .apple-loading__spinner-svg {
        animation: none !important;
    }
}

/* =============== 高对比度模式支持 =============== */

@media (prefers-contrast: high) {
    .apple-modal {
        --apple-separator: #000000;
    }
    
    .apple-notification {
        border: 2px solid var(--apple-label-primary);
    }
    
    .apple-modal__close {
        border: 1px solid var(--apple-label-secondary);
    }
    
    .apple-field--error {
        border-width: 2px !important;
    }
    
    .apple-field--success {
        border-width: 2px !important;
    }
}

/* =============== 打印样式 =============== */

@media print {
    .apple-modal,
    .apple-notifications,
    .apple-loading-modal,
    .apple-loading-overlay {
        display: none !important;
    }
}

/* =============== 工具特定优化 =============== */

/* 为工具弹窗添加特殊类 */
.apple-modal--tool {
    --apple-duration-medium: 350ms;
}

.apple-modal--tool .apple-modal__container {
    border: 1px solid var(--apple-separator);
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
}

.apple-modal--tool .apple-modal__header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--apple-blur-light);
    -webkit-backdrop-filter: var(--apple-blur-light);
}

[data-theme="dark"] .apple-modal--tool .apple-modal__header {
    background: rgba(28, 28, 30, 0.8);
}

/* 工具内容区域优化 */
.tool-interface {
    font-family: var(--apple-font-system);
    color: var(--apple-label-primary);
}

.tool-interface input,
.tool-interface select,
.tool-interface textarea {
    font-family: var(--apple-font-system);
    border: 1px solid var(--apple-separator);
    border-radius: var(--apple-radius-small);
    background: var(--apple-background-secondary);
    color: var(--apple-label-primary);
    transition: all var(--apple-duration-fast) var(--apple-easing-standard);
}

.tool-interface input:focus,
.tool-interface select:focus,
.tool-interface textarea:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

.tool-interface button {
    font-family: var(--apple-font-system);
    font-weight: 600;
    border-radius: var(--apple-radius-small);
    transition: all var(--apple-duration-fast) var(--apple-easing-standard);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-interface button:hover {
    transform: translateY(-1px);
}

.tool-interface button:active {
    transform: translateY(0);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .tool-interface button:hover {
        transform: none;
    }
    
    .apple-modal__close:hover {
        transform: none;
    }
    
    .apple-notification__close:hover {
        transform: none;
    }
}

/* 确保触摸目标足够大 */
@media (max-width: 768px) {
    .apple-modal__close {
        width: 44px;
        height: 44px;
        margin: -6px -6px -6px 12px;
    }
    
    .apple-notification__close {
        width: 44px;
        height: 44px;
        margin: -10px -10px -10px 8px;
    }
    
    .tool-interface button {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 122, 255, 0.1);
    }
    
    .tool-interface input,
    .tool-interface select,
    .tool-interface textarea {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
    }
}