/* ============================================================
   iOS 风格弹窗组件 (ios-modal.css)
   用法：IOSModal.show({ title, message, icon, buttons, ... })
   ============================================================ */

/* 遮罩层 */
.ios-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 99990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ios-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 弹窗容器 */
.ios-modal {
    width: 300px;
    max-width: 85vw;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 99991;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.ios-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* 内容区 */
.ios-modal-body {
    padding: 24px 20px 20px;
    text-align: center;
}

/* 图标 */
.ios-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    margin: 0 auto 14px;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 标题 */
.ios-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c1c1e;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* 内容文字 */
.ios-modal-message {
    font-size: 14px;
    color: #3c3c43;
    margin: 0;
    line-height: 1.6;
}

.ios-modal-message p {
    margin: 4px 0;
}

/* 按钮区域 */
.ios-modal-buttons {
    display: flex;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ios-modal-buttons.single {
    border-top: none;
}

/* 按钮 */
.ios-modal-btn {
    flex: 1;
    padding: 14px 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #007aff;
    font-weight: 500;
    font-family: inherit;
}

.ios-modal-btn + .ios-modal-btn {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.ios-modal-btn:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.ios-modal-btn.primary {
    font-weight: 600;
}

.ios-modal-btn.destructive {
    color: #ff3b30;
}

.ios-modal-btn.cancel {
    color: #8e8e93;
}

/* ===== 暗色模式适配 ===== */
[data-theme="dark"] .ios-modal {
    background-color: rgba(40, 40, 42, 0.92);
}

[data-theme="dark"] .ios-modal-title {
    color: #ffffff;
}

[data-theme="dark"] .ios-modal-message {
    color: #ebebf5;
}

[data-theme="dark"] .ios-modal-buttons {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ios-modal-btn + .ios-modal-btn {
    border-left-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ios-modal-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ios-modal-btn.cancel {
    color: #98989f;
}

/* ===== 小图标内联模式（iOS原生Alert风格） ===== */
.ios-modal.icon-inline .ios-modal-body {
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px 16px;
}

.ios-modal.icon-inline .ios-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin: 2px 0 0 0;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.ios-modal.icon-inline .ios-modal-text-wrap {
    flex: 1;
    min-width: 0;
}

.ios-modal.icon-inline .ios-modal-title {
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ios-modal.icon-inline .ios-modal-message {
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}

/* ===== 通知横幅（iOS Notification Banner） ===== */
.ios-notification {
    width: 380px;
    max-width: 92vw;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-200px);
    z-index: 99995;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.ios-notification.show {
    transform: translateX(-50%) translateY(0);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ios-notification-inner {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
}

.ios-notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
    background-color: #fff;
}

.ios-notification-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    background-color: #007aff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.ios-notification-content {
    flex: 1;
    min-width: 0;
}

.ios-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.ios-notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1e;
    line-height: 1.3;
}

.ios-notification-time {
    font-size: 11px;
    color: #8e8e93;
    flex-shrink: 0;
    margin-left: 8px;
}

.ios-notification-body {
    font-size: 13px;
    color: #3c3c43;
    line-height: 1.4;
}

/* 通知横幅暗色模式 */
[data-theme="dark"] .ios-notification {
    background-color: rgba(40, 40, 42, 0.85);
}

[data-theme="dark"] .ios-notification-title {
    color: #ffffff;
}

[data-theme="dark"] .ios-notification-body {
    color: #ebebf5;
}

[data-theme="dark"] .ios-notification-time {
    color: #98989f;
}

/* ===== 底部弹出 Sheet（iOS风格） ===== */
.ios-sheet-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.ios-sheet-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ios-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 998;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    padding: 24px 24px 40px;
}
.ios-sheet.show {
    transform: translateY(0);
}

.ios-sheet-handle {
    width: 144px;
    height: 4px;
    background-color: #d1d1d6;
    border-radius: 9999px;
    margin: 0 auto 24px;
    cursor: pointer;
}

.ios-sheet-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
    color: #000;
}

.ios-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.ios-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.ios-sheet-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: transform 0.15s;
}
.ios-sheet-item:active .ios-sheet-icon {
    transform: scale(0.92);
}
.ios-sheet-icon img {
    width: 28px;
    height: 28px;
}

.ios-sheet-label {
    font-size: 12px;
    color: #3c3c43;
}

.ios-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.ios-sheet-action-btn {
    width: 100%;
    padding: 16px;
    background-color: #fff;
    border-radius: 12px;
    text-align: left;
    padding-left: 16px;
    font-size: 16px;
    color: #007aff;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}
.ios-sheet-action-btn:active {
    background-color: #f2f2f7;
}

.ios-sheet-cancel {
    width: 100%;
    padding: 16px;
    background-color: #fff;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}
.ios-sheet-cancel:active {
    background-color: #f2f2f7;
}

/* 暗色模式 */
[data-theme="dark"] .ios-sheet {
    background-color: rgba(40, 40, 42, 0.85);
}
[data-theme="dark"] .ios-sheet-title {
    color: #fff;
}
[data-theme="dark"] .ios-sheet-label {
    color: #ebebf5;
}
[data-theme="dark"] .ios-sheet-action-btn,
[data-theme="dark"] .ios-sheet-cancel {
    background-color: #2c2c2e;
    color: #fff;
}
[data-theme="dark"] .ios-sheet-action-btn {
    color: #0a84ff;
}
