/**
 * 速马赫OA系统 - iOS/mac 通用样式
 * 移动端: iOS 风格
 * PC端: macOS 风格
 */

:root {
    --primary: #1a237e;
    --primary-light: #283593;
    --accent: #ff6f00;
    --accent-hover: #e65100;
    --bg: #f2f2f7;
    --card-bg: rgba(255,255,255,0.85);
    --text: #1c1c1e;
    --text-secondary: #8e8e93;
    --border: rgba(0,0,0,0.08);
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9500;
    --shadow-ios: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-mac: 0 8px 32px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* iOS 毛玻璃卡片 */
.ios-card {
    background: var(--card-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ios);
    border: 0.5px solid var(--border);
    overflow: hidden;
}

/* mac 卡片 */
.mac-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-mac);
    border: 1px solid rgba(0,0,0,0.06);
}

/* 统一按钮 */
.btn-ios {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    width: 100%;
}
.btn-ios:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}
.btn-secondary:hover { background: rgba(0,0,0,0.08); }

.btn-danger {
    background: rgba(255,59,48,0.08);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(255,59,48,0.12); }

.btn-mac {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

/* 表单输入 - iOS风格 */
.input-ios {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(0,0,0,0.04);
    font-size: 16px;
    color: var(--text);
    transition: var(--transition);
    outline: none;
}
.input-ios:focus {
    background: rgba(0,0,0,0.06);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}
.input-ios::placeholder { color: var(--text-secondary); }

/* mac 表格 */
.mac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mac-table th, .mac-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.mac-table th {
    background: rgba(0,0,0,0.02);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mac-table tr:hover { background: rgba(0,0,0,0.015); }

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.tag-green { background: rgba(52,199,89,0.12); color: #248a3d; }
.tag-red { background: rgba(255,59,48,0.10); color: #c41c14; }
.tag-blue { background: rgba(0,122,255,0.10); color: #0051d5; }
.tag-orange { background: rgba(255,149,0,0.12); color: #c46f00; }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    padding: 12px 24px;
    border-radius: 100px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: rgba(52,199,89,0.9); }
.toast-error { background: rgba(255,59,48,0.9); }

/* 移动端底部导航 - iOS Tab Bar */
.ios-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}
.ios-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    padding: 4px 12px;
}
.ios-tabbar a span { font-size: 22px; }
.ios-tabbar a.active { color: var(--accent); }

/* mac 侧边栏 */
.mac-sidebar {
    width: 220px;
    background: #f5f5f7;
    border-right: 1px solid rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0; top: 0;
}
.mac-sidebar-brand {
    padding: 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.mac-sidebar-nav { flex: 1; padding: 8px; }
.mac-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: var(--transition);
}
.mac-sidebar-nav a:hover, .mac-sidebar-nav a.active {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}
.mac-sidebar-nav a.active { font-weight: 600; }
.mac-sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 11px;
    color: var(--text-secondary);
}

/* 模态框 - iOS/mac 统一 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
    background: var(--card-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    border: 0.5px solid var(--border);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 20px 24px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body { padding: 8px 24px 20px; }
.modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 搜索栏 */
.search-ios {
    width: 100%;
    padding: 10px 16px;
    border-radius: 100px;
    border: none;
    background: rgba(0,0,0,0.05);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}
.search-ios:focus {
    background: rgba(0,0,0,0.08);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}

/* 分页 */
.pagination-ios {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.pagination-ios a, .pagination-ios span {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}
.pagination-ios a { background: rgba(0,0,0,0.04); color: var(--text); }
.pagination-ios a:hover { background: rgba(0,0,0,0.08); }
.pagination-ios span.active { background: var(--primary); color: #fff; }
.pagination-ios span.disabled { color: var(--text-secondary); }

/* 响应式工具 */
@media (min-width: 769px) {
    .hide-pc { display: none !important; }
    .ios-tabbar { display: none; }
}
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .mac-sidebar { display: none; }
    body { padding-bottom: 70px; }
}
