/* iOS 风格移动端样式 - 简洁干净 */

/* 基础变量 */
:root {
    --ios-blue: #007AFF;
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-orange: #FF9500;
    --ios-gray: #8E8E93;
    --ios-light-gray: #F2F2F7;
    --ios-bg: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-text: #000000;
    --ios-text-secondary: #8E8E93;
    --ios-border: #E5E5EA;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.47059;
    color: var(--ios-text);
    background: var(--ios-bg);
    min-height: 100vh;
    padding-bottom: calc(50px + var(--safe-bottom));
    -webkit-font-smoothing: antialiased;
}

/* 顶部导航栏 - iOS风格 */
.nav-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--ios-border);
    z-index: 100;
    padding-top: var(--safe-top);
}

.nav-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 16px;
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.nav-btn {
    min-width: 60px;
    padding: 6px 12px;
    font-size: 17px;
    color: var(--ios-blue);
    background: none;
    border: none;
    cursor: pointer;
}

.nav-btn:active {
    opacity: 0.6;
}

/* 内容区域 */
.content {
    padding: 16px;
}

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

.ios-list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--ios-border);
    text-decoration: none;
    color: var(--ios-text);
}

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

.ios-list-item:active {
    background: var(--ios-light-gray);
}

.ios-list-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.ios-list-content {
    flex: 1;
}

.ios-list-title {
    font-size: 17px;
    color: var(--ios-text);
}

.ios-list-subtitle {
    font-size: 15px;
    color: var(--ios-text-secondary);
    margin-top: 2px;
}

.ios-list-arrow {
    color: var(--ios-text-secondary);
    font-size: 20px;
}

/* iOS 按钮 */
.btn-ios {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 17px;
    font-weight: 400;
    text-align: center;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-ios:active {
    opacity: 0.6;
}

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

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

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

.btn-ios-secondary {
    background: var(--ios-light-gray);
    color: var(--ios-blue);
}

/* iOS 输入框 */
.ios-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 17px;
    border: none;
    border-bottom: 0.5px solid var(--ios-border);
    background: var(--ios-card);
    outline: none;
}

.ios-input:last-child {
    border-bottom: none;
}

.ios-input::placeholder {
    color: var(--ios-text-secondary);
}

/* 表单组 */
.ios-form-group {
    margin-bottom: 20px;
}

.ios-form-label {
    display: block;
    font-size: 13px;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-left: 16px;
}

/* 卡片 */
.ios-card {
    background: var(--ios-card);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.ios-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ios-card-subtitle {
    font-size: 15px;
    color: var(--ios-text-secondary);
}

/* 底部标签栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--ios-border);
    display: flex;
    justify-content: space-around;
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    color: var(--ios-gray);
    text-decoration: none;
    font-size: 10px;
}

.tab-item.active {
    color: var(--ios-blue);
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 15px;
    color: var(--ios-text-secondary);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--ios-border);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: var(--ios-card);
}

.upload-area-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area-text {
    font-size: 17px;
    color: var(--ios-blue);
    margin-bottom: 4px;
}

.upload-area-hint {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

/* 图片网格 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.photo-item {
    aspect-ratio: 1;
    position: relative;
    background: var(--ios-light-gray);
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item-video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* 预览区域 */
.preview-area {
    background: var(--ios-card);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.preview-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--ios-light-gray);
}

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

.preview-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--ios-red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 进度条 */
.progress-bar {
    height: 4px;
    background: var(--ios-light-gray);
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

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

/* 提示消息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    z-index: 1000;
    display: none;
}

.toast.show {
    display: block;
}

/* 登录页面 */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--ios-bg);
}

.login-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--ios-blue);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--ios-text-secondary);
}

.login-form {
    background: var(--ios-card);
    border-radius: 10px;
    margin: 0 16px 20px;
    overflow: hidden;
}

.login-footer {
    text-align: center;
    padding: 20px;
    font-size: 15px;
    color: var(--ios-text-secondary);
}

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

/* 统计数字 */
.stat-number {
    font-size: 34px;
    font-weight: 300;
    color: var(--ios-blue);
}

.stat-label {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: var(--ios-light-gray);
    color: var(--ios-text-secondary);
}

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

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

/* 操作按钮组 */
.action-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
}

.action-sheet.show {
    display: block;
}

.action-sheet-content {
    background: var(--ios-bg);
    border-radius: 16px 16px 0 0;
    padding: 8px;
    margin: 0 8px 8px;
}

.action-sheet-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 20px;
    text-align: center;
    background: var(--ios-card);
    border: none;
    border-bottom: 0.5px solid var(--ios-border);
    color: var(--ios-blue);
}

.action-sheet-btn:first-child {
    border-radius: 12px 12px 0 0;
}

.action-sheet-btn:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.action-sheet-btn.danger {
    color: var(--ios-red);
}

.action-sheet-cancel {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    background: var(--ios-card);
    border: none;
    border-radius: 12px;
    margin-top: 8px;
    color: var(--ios-blue);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--ios-card);
    border-radius: 14px;
    width: 270px;
    max-width: 90%;
    text-align: center;
    overflow: hidden;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    padding: 20px 20px 8px;
}

.modal-message {
    font-size: 13px;
    color: var(--ios-text-secondary);
    padding: 0 20px 20px;
}

.modal-actions {
    display: flex;
    border-top: 0.5px solid var(--ios-border);
}

.modal-btn {
    flex: 1;
    padding: 12px;
    font-size: 17px;
    border: none;
    background: none;
    color: var(--ios-blue);
}

.modal-btn:first-child {
    border-right: 0.5px solid var(--ios-border);
}

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

/* ==================== App模式样式 ==================== */
/* 用于学校App内嵌页面，通过body添加class="app-mode"启用 */

/* App模式下header固定在顶部 */
.app-mode .nav-header {
    position: sticky !important;
    top: 0 !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    border-bottom: 0.5px solid var(--ios-border);
}

/* App模式下header内容增加顶部padding，适配App状态栏 */
.app-mode .nav-header-content {
    padding-top: 55px !important;
    padding-bottom: 18px !important;
}

/* App模式下内容区域顶部间距 */
.app-mode .content {
    padding-top: 8px;
}

/* App模式下隐藏banner */
.app-mode .home-banner {
    display: none !important;
}
