/* iOS 风格的基础样式 */
:root {
    --ios-blue: #007AFF;
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-gray: #8E8E93;
    --ios-light-gray: #C7C7CC;
    --ios-background: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-text: #000000;
    --ios-secondary-text: #6C6C70;
    --ios-border: #C6C6C8;
    --ios-separator: #C6C6C8;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--ios-background);
    color: var(--ios-text);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏 */
.navbar {
    background-color: var(--ios-card);
    border-bottom: 1px solid var(--ios-separator);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar-brand {
    color: var(--ios-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.25rem;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--ios-card);
    min-width: 160px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    z-index: 1000;
}

.dropdown.show .dropdown-content {
    display: block;
}

.dropdown-item {
    color: var(--ios-text);
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
}

.dropdown-item:hover {
    background-color: var(--ios-background);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--ios-secondary-text);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: var(--ios-light-gray);
}

.breadcrumb-item a {
    color: var(--ios-blue);
    text-decoration: none;
}

/* 卡片 */
.card {
    background-color: var(--ios-card);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.card-body {
    padding: 1rem;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--ios-separator);
}

.table th {
    font-weight: 600;
    color: var(--ios-secondary-text);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--ios-border);
    border-radius: 8px;
    background-color: var(--ios-card);
    color: var(--ios-text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--ios-blue);
}

.form-text {
    font-size: 0.875rem;
    color: var(--ios-secondary-text);
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-check-text {
    color: var(--ios-text);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background-color: var(--ios-light-gray);
    color: var(--ios-text);
}

.btn-primary {
    background-color: var(--ios-blue);
    color: white;
}

.btn-danger {
    background-color: var(--ios-red);
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

/* 标签列表 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--ios-background);
    border-radius: 6px;
    cursor: pointer;
}

.tag-text {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

/* 警告框 */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.alert-danger {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: var(--ios-card);
    color: var(--ios-text);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--ios-background);
}

.page-link.active {
    background-color: var(--ios-blue);
    color: white;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* 表单操作 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--ios-border);
    border-radius: 8px;
    background-color: var(--ios-card);
    color: var(--ios-text);
    font-size: 0.875rem;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-secondary-text);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* 卡片样式 */
.card {
    background-color: var(--ios-card-background);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--ios-border);
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}

/* 列表样式 */
.list-group {
    background-color: var(--ios-card-background);
    border-radius: 10px;
    overflow: hidden;
}

.list-group-item {
    padding: 1rem;
    border-bottom: 1px solid var(--ios-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--ios-blue);
    color: white;
}

.badge-success {
    background-color: var(--ios-green);
    color: white;
}

.badge-danger {
    background-color: var(--ios-red);
    color: white;
}

/* 警告框样式 */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--ios-green);
    color: white;
}

.alert-danger {
    background-color: var(--ios-red);
    color: white;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: var(--ios-card-background);
    color: var(--ios-blue);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--ios-light-gray);
}

.page-link.active {
    background-color: var(--ios-blue);
    color: white;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--ios-light-gray);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--ios-card-background);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--ios-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--ios-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ios-light-gray);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--ios-green);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 搜索框 */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--ios-border);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--ios-card-background);
}

.search-box:before {
    content: "🔍";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-gray);
}

/* 文件上传 */
.file-upload {
    position: relative;
    display: inline-block;
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--ios-light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-upload-label:hover {
    background-color: var(--ios-border);
}

/* 进度条 */
.progress {
    width: 100%;
    height: 4px;
    background-color: var(--ios-light-gray);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--ios-blue);
    transition: width 0.3s;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--ios-light-gray);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--ios-secondary-text);
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child):after {
    content: "›";
    margin-left: 0.5rem;
}

.breadcrumb-item a {
    color: var(--ios-blue);
    text-decoration: none;
}

/* 统计卡片 */
.stats-card {
    background-color: var(--ios-card-background);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.stats-number {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stats-label {
    color: var(--ios-secondary-text);
    font-size: 0.875rem;
}

/* 图表容器 */
.chart-container {
    background-color: var(--ios-card-background);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--ios-blue);
}

.timeline-item:after {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    bottom: 0;
    width: 2px;
    background-color: var(--ios-border);
}

.timeline-item:last-child:after {
    display: none;
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--ios-secondary-text);
    margin-bottom: 0.5rem;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    background-color: var(--ios-card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--ios-green);
}

.notification-error {
    border-left: 4px solid var(--ios-red);
}

/* 加载更多按钮 */
.load-more {
    display: block;
    width: 100%;
    padding: 1rem;
    text-align: center;
    background-color: var(--ios-light-gray);
    border: none;
    border-radius: 8px;
    color: var(--ios-blue);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.load-more:hover {
    background-color: var(--ios-border);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ios-secondary-text);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--ios-light-gray) 25%, var(--ios-border) 50%, var(--ios-light-gray) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 图片上传预览 */
.image-preview {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--ios-light-gray);
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.image-preview-remove:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 响应式网格 */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 文本截断 */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ios-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--ios-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ios-secondary-text);
} 