/* ============================================================
   影院票务管理系统 — 全局样式
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

/* — 导航栏 — */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff; padding: 0 40px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 100;
}
.navbar .logo { font-size: 22px; font-weight: bold; letter-spacing: 2px; cursor: pointer; }
.navbar .logo span { color: #e94560; }
.navbar .nav-links { display: flex; gap: 24px; align-items: center; }
.navbar .nav-links a { color: #ccc; text-decoration: none; font-size: 15px; transition: color 0.3s; }
.navbar .nav-links a:hover { color: #e94560; }
.navbar .nav-user { display: flex; align-items: center; gap: 12px; }
.navbar .nav-user .username { font-size: 14px; color: #e94560; }
.navbar .btn-sm { padding: 6px 16px; font-size: 13px; border-radius: 4px; cursor: pointer; border: none; transition: background-color 0.3s, color 0.3s; }
.navbar .btn-outline { background: transparent; border: 1px solid #e94560; color: #e94560; }
.navbar .btn-outline:hover { background: #e94560; color: #fff; }

/* — 容器 — */
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

/* — 卡片 — */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,0.08); overflow: hidden; }
.card-header { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; font-size: 20px; font-weight: bold; }
.card-body { padding: 24px; }

/* — 电影网格 — */
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.movie-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; will-change: transform;
}
.movie-card:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.movie-card .poster {
    height: 340px; background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 48px; font-weight: bold;
}
.movie-card .info { padding: 16px; }
.movie-card .info h3 { font-size: 18px; margin-bottom: 8px; }
.movie-card .info .meta { font-size: 13px; color: #888; display: flex; gap: 16px; margin-bottom: 8px; }
.movie-card .info .price { font-size: 22px; color: #e94560; font-weight: bold; }
.movie-card .info .price small { font-size: 14px; color: #999; }

/* — 表单 — */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px; border: 1px solid #d9d9d9; border-radius: 8px;
    font-size: 15px; transition: border-color 0.3s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #e94560; box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }

/* — 按钮 — */
.btn {
    padding: 12px 28px; font-size: 15px; border-radius: 8px; border: none; cursor: pointer;
    transition: background-color 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s; display: inline-block; text-decoration: none; text-align: center;
}
.btn-primary { background: #e94560; color: #fff; }
.btn-primary:hover { background: #d63852; }
.btn-block { width: 100%; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #49b018; }
.btn-warning { background: #faad14; color: #fff; }
.btn-warning:hover { background: #e09d12; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #e04345; }

/* — 登录/注册页 — */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); will-change: transform; }
.auth-card { background: #fff; border-radius: 16px; padding: 48px 40px; width: 420px; box-shadow: 0 8px 48px rgba(0,0,0,0.18); transform: translateZ(0); }
.auth-card h2 { text-align: center; margin-bottom: 8px; font-size: 28px; color: #1a1a2e; }
.auth-card .subtitle { text-align: center; color: #999; margin-bottom: 32px; font-size: 14px; }
.auth-card .switch-link { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }
.auth-card .switch-link a { color: #e94560; text-decoration: none; font-weight: 500; }

/* — 登录方式切换 Tab — */
.login-tabs {
    display: flex;
    margin-bottom: 28px;
    border-bottom: 2px solid #f0f0f0;
}
.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.3s, border-color 0.3s;
    font-weight: 500;
}
.login-tab:hover { color: #e94560; }
.login-tab.active { color: #e94560; border-bottom-color: #e94560; }

.wechat-qr-container { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qr-code { width: 180px; height: 180px; border: 8px solid #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); overflow: hidden; }
.qr-code canvas { display: block; width: 100%; height: 100%; }
.qr-tip { font-size: 14px; color: #888; text-align: center; margin: 0; }
.qr-footer { width: 100%; }
/* 手机确认界面 */
.phone-confirm { width: 100%; animation: slideUp 0.35s ease; }
.phone-frame {
    background: #f7f7f7;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.phone-header {
    background: #07c160;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 15px;
    font-weight: 500;
}
.phone-body { text-align: center; padding: 24px 20px 16px; }
.phone-avatar {
    width: 56px; height: 56px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 10px;
}
.phone-nick { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 8px; }
.phone-hint { font-size: 13px; color: #888; margin: 0; }
.phone-actions { padding: 0 20px 20px; }

/* — 消息提示 — */
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 9999; padding: 12px 28px; border-radius: 8px; font-size: 14px; color: #fff; animation: fadeIn 0.3s; }
.toast-success { background: #52c41a; }
.toast-error { background: #ff4d4f; }
.toast-warning { background: #faad14; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* — 详情页 — */
.detail-layout { display: flex; gap: 40px; }
.detail-poster {
    width: 300px; height: 420px; border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 72px;
    flex-shrink: 0;
}
.detail-info h2 { font-size: 28px; margin-bottom: 16px; }
.detail-info .field { margin-bottom: 10px; font-size: 15px; }
.detail-info .field strong { color: #555; min-width: 70px; display: inline-block; }
.detail-info .price-tag { font-size: 32px; color: #e94560; font-weight: bold; margin: 20px 0; }
.schedule-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.schedule-item {
    padding: 10px 16px; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer;
    transition: all 0.3s; text-align: center; min-width: 130px;
}
.schedule-item:hover, .schedule-item.selected { border-color: #e94560; background: #fff5f5; }
.schedule-item .time { font-size: 17px; font-weight: bold; }
.schedule-item .hall { font-size: 12px; color: #888; margin-top: 2px; }

/* — 订单列表 — */
.order-list { display: flex; flex-direction: column; gap: 16px; }
.order-item {
    display: flex; align-items: center; gap: 20px; padding: 20px; background: #fff;
    border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.order-item .order-poster {
    width: 80px; height: 110px; border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: bold;
    flex-shrink: 0;
}
.order-item .order-info { flex: 1; }
.order-item .order-info h4 { font-size: 18px; margin-bottom: 6px; }
.order-item .order-info p { font-size: 13px; color: #888; margin-bottom: 4px; }
.order-item .order-amount { font-size: 22px; color: #e94560; font-weight: bold; text-align: right; }
.order-item .order-status { font-size: 13px; padding: 4px 10px; border-radius: 4px; display: inline-block; }
.status-pending { background: #fff7e6; color: #fa8c16; }
.status-paid { background: #f6ffed; color: #52c41a; }
.status-cancelled { background: #fff1f0; color: #ff4d4f; }

/* — 管理后台 — */
.admin-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #f0f0f0; }
.admin-tab {
    padding: 12px 28px; cursor: pointer; font-size: 15px; color: #888;
    border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.3s, border-color 0.3s;
}
.admin-tab.active { color: #e94560; border-bottom-color: #e94560; font-weight: 500; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.admin-table th { background: #fafafa; font-weight: 600; color: #555; }
.admin-table tr:hover td { background: #fafafa; }

/* — 模态弹窗 — */
.modal-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.45); z-index:1000; align-items:center; justify-content:center; animation:fadeIn 0.2s; will-change: opacity; }
.modal { background:#fff; border-radius:12px; width:90%; max-width:520px; max-height:85vh; overflow-y:auto; box-shadow:0 8px 40px rgba(0,0,0,0.2); animation:slideUp 0.25s; will-change: transform, opacity; }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:18px 24px; border-bottom:1px solid #f0f0f0; }
.modal-title { font-size:18px; font-weight:bold; }
.modal-close { font-size:24px; cursor:pointer; color:#999; }
.modal-close:hover { color:#333; }
.modal-body { padding:24px; }
.modal-footer { display:flex; justify-content:flex-end; gap:12px; padding:16px 24px; border-top:1px solid #f0f0f0; }
.modal-input { width:100%; padding:10px 14px; border:1px solid #d9d9d9; border-radius:8px; font-size:14px; outline:none; transition:border-color 0.3s; background:#fff; box-sizing:border-box; }
.modal-input:focus { border-color:#e94560; }
textarea.modal-input { resize:vertical; min-height:60px; }
select.modal-input { cursor:pointer; }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* — 骨架屏 — */
.skeleton-poster { height:340px; background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:12px 12px 0 0; }
.skeleton-line { height:16px; background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:4px; }
.skeleton-card { background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 2px 12px rgba(0,0,0,0.08); }
@keyframes shimmer { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }

/* — 按钮扩展 — */
.btn-default { background: #f0f0f0; color: #333; }
.btn-default:hover { background: #e0e0e0; }

/* — 响应式 — */
@media (max-width: 768px) {
    .detail-layout { flex-direction: column; }
    .detail-poster { width: 100%; height: 280px; }
    .navbar { padding: 0 16px; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .movie-card .poster { height: 220px; }
    .auth-card { width: 90%; padding: 36px 24px; }
}

/* — 海报图片 — */
.poster-img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: transform 0.3s;
}
.movie-card:hover .poster-img { transform: scale(1.05); }
.poster-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; color: #fff; font-size: 48px; font-weight: bold;
}

/* — 详情页海报 — */
.detail-poster-img {
    width: 300px; height: 420px; border-radius: 12px; object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); flex-shrink: 0;
}
.detail-poster-fallback {
    width: 300px; height: 420px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 72px; flex-shrink: 0;
}

/* — 管理后台电影海报缩略图 — */
.poster-thumb {
    width: 40px; height: 56px; border-radius: 4px; object-fit: cover;
    vertical-align: middle; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.poster-thumb-fallback {
    width: 40px; height: 56px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: bold; vertical-align: middle;
}

/* — admin 表单海报预览 — */
#posterPreview {
    max-width: 120px; max-height: 168px; border-radius: 8px;
    display: block; margin-top: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* — 分页控件 — */
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 4px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #333; transition: border-color 0.3s, color 0.3s, background-color 0.3s; line-height: 1.4; }
.btn-sm:hover:not(:disabled) { border-color: #e94560; color: #e94560; }
.btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm.btn-primary { background: #e94560; color: #fff; border-color: #e94560; }
.btn-sm.btn-primary:hover { background: #d63852; }
