/* 维保任务管理系统 - 全局样式 */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f3f4f6;
  --card-bg: #fff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --sidebar-w: 220px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 登录页 ============ */
.login-page { position:relative; min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; background:linear-gradient(135deg,#0f172a 0%,#1e1b4b 50%,#312e81 100%); overflow:hidden; padding:20px; }
.login-bg-shapes { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.login-bg-shapes .shape { position:absolute; border-radius:50%; filter:blur(60px); opacity:.15; }
.login-bg-shapes .shape-1 { width:400px; height:400px; background:#6366f1; top:-100px; left:-100px; animation:float1 8s ease-in-out infinite; }
.login-bg-shapes .shape-2 { width:350px; height:350px; background:#8b5cf6; bottom:-80px; right:-80px; animation:float2 10s ease-in-out infinite; }
.login-bg-shapes .shape-3 { width:300px; height:300px; background:#3b82f6; top:40%; left:50%; animation:float3 12s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,40px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-40px,-30px)} }
@keyframes float3 { 0%,100%{transform:translate(-50%,0)} 50%{transform:translate(-30%,-50px)} }

.login-container { position:relative; z-index:1; display:flex; background:rgba(255,255,255,.06); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border:1px solid rgba(255,255,255,.12); border-radius:24px; overflow:hidden; box-shadow:0 30px 80px rgba(0,0,0,.4); max-width:880px; width:100%; }
.login-left { flex:1; padding:48px 44px; display:flex; flex-direction:column; justify-content:center; background:rgba(255,255,255,.03); }
.login-right { width:320px; padding:48px 36px; display:flex; flex-direction:column; justify-content:center; align-items:center; background:rgba(99,102,241,.08); border-left:1px solid rgba(255,255,255,.08); }

.login-brand { text-align:center; margin-bottom:36px; }
.login-brand .brand-icon { width:64px; height:64px; margin:0 auto 16px; background:linear-gradient(135deg,#6366f1,#8b5cf6); border-radius:16px; display:flex; align-items:center; justify-content:center; color:#fff; box-shadow:0 8px 24px rgba(99,102,241,.4); }
.login-brand h1 { font-size:22px; color:#fff; font-weight:700; letter-spacing:.5px; }
.login-brand p { font-size:12px; color:rgba(255,255,255,.5); margin-top:6px; letter-spacing:1px; }

.form-header { margin-bottom:24px; }
.form-header h2 { font-size:16px; color:rgba(255,255,255,.9); font-weight:600; margin-bottom:8px; }
.form-line { height:2px; width:40px; background:linear-gradient(90deg,#6366f1,#8b5cf6); border-radius:1px; }

.login-form { display:flex; flex-direction:column; gap:16px; }
.input-group { position:relative; display:flex; align-items:center; }
.input-group .input-icon { position:absolute; left:14px; width:18px; height:18px; color:rgba(255,255,255,.35); pointer-events:none; z-index:1; }
.input-group input { width:100%; padding:13px 14px 13px 42px; border:1px solid rgba(255,255,255,.12); border-radius:10px; font-size:14px; color:#fff; background:rgba(255,255,255,.05); transition:all .25s; }
.input-group input::placeholder { color:rgba(255,255,255,.3); }
.input-group input:focus { outline:none; border-color:#6366f1; background:rgba(99,102,241,.08); box-shadow:0 0 0 3px rgba(99,102,241,.15); }
.input-group input:-webkit-autofill { -webkit-text-fill-color:#fff; -webkit-box-shadow:0 0 0 1000px rgba(255,255,255,.05) inset; transition:background-color 9999s ease-out; }

.login-btn { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:13px; border:none; border-radius:10px; font-size:15px; font-weight:600; color:#fff; cursor:pointer; background:linear-gradient(135deg,#6366f1,#7c3aed); box-shadow:0 4px 16px rgba(99,102,241,.35); transition:all .25s; margin-top:4px; }
.login-btn:hover { transform:translateY(-1px); box-shadow:0 6px 24px rgba(99,102,241,.5); }
.login-btn:active { transform:translateY(0); }

.login-form .err { color:#f87171; text-align:center; font-size:13px; min-height:20px; }

/* QR section */
.tech-qr-section { text-align:center; }
.tech-qr-section .qr-label { font-size:14px; color:rgba(255,255,255,.7); font-weight:600; margin-bottom:16px; letter-spacing:1px; }
.qr-box { position:relative; display:inline-block; padding:16px; background:#fff; border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.2); }
.qr-box canvas, .qr-box img { display:block; border-radius:4px; }
.qr-corner { position:absolute; width:20px; height:20px; border:3px solid #6366f1; }
.qr-corner-tl { top:6px; left:6px; border-right:none; border-bottom:none; border-radius:4px 0 0 0; }
.qr-corner-tr { top:6px; right:6px; border-left:none; border-bottom:none; border-radius:0 4px 0 0; }
.qr-corner-bl { bottom:6px; left:6px; border-right:none; border-top:none; border-radius:0 0 0 4px; }
.qr-corner-br { bottom:6px; right:6px; border-left:none; border-top:none; border-radius:0 0 4px 0; }
.tech-qr-section .qr-tip { font-size:12px; color:rgba(255,255,255,.4); margin-top:12px; }
.tech-qr-section .qr-actions { margin-top:8px; }
.tech-qr-section .qr-link { font-size:12px; color:rgba(255,255,255,.5); text-decoration:none; transition:color .2s; }
.tech-qr-section .qr-link:hover { color:#a78bfa; }

.login-footer { position:relative; z-index:1; margin-top:24px; font-size:12px; color:rgba(255,255,255,.25); letter-spacing:.5px; }

@media (max-width:768px) {
    .login-container { flex-direction:column; max-width:400px; }
    .login-right { width:100%; border-left:none; border-top:1px solid rgba(255,255,255,.08); padding:32px 24px; }
    .login-left { padding:32px 24px; }
}

/* ============ 主布局 ============ */
.main-layout { display:flex; min-height:100vh; }
.sidebar { width:var(--sidebar-w); background:#1e1b4b; color:#c7d2fe; position:fixed; top:0; left:0; bottom:0; overflow-y:auto; z-index:100; transition:transform .3s; }
.sidebar .logo { padding:20px 16px; font-size:16px; font-weight:700; color:#fff; border-bottom:1px solid rgba(255,255,255,.1); text-align:center; }
.sidebar .nav-item { display:flex; align-items:center; gap:10px; padding:12px 20px; color:#c7d2fe; cursor:pointer; transition:all .2s; border-left:3px solid transparent; font-size:14px; }
.sidebar .nav-item:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar .nav-item.active { background:rgba(79,70,229,.3); color:#fff; border-left-color:var(--primary); }
.sidebar .nav-item svg { width:18px; height:18px; flex-shrink:0; }
.main-area { flex:1; margin-left:var(--sidebar-w); }
.topbar { height:56px; background:#fff; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 24px; position:sticky; top:0; z-index:50; }
.topbar .page-title { font-size:16px; font-weight:600; }
.topbar .user-area { display:flex; align-items:center; gap:12px; }
.topbar .avatar { width:32px; height:32px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:600; }
.content { padding:24px; }

/* ============ 通用组件 ============ */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border:none; border-radius:var(--radius); font-size:13px; font-weight:500; cursor:pointer; transition:all .2s; }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dark); }
.btn-success { background:var(--success); color:#fff; }
.btn-danger { background:var(--danger); color:#fff; }
.btn-warning { background:var(--warning); color:#fff; }
.btn-info { background:var(--info); color:#fff; }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text); }
.btn-outline:hover { background:var(--bg); }
.btn-sm { padding:4px 10px; font-size:12px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.card { background:var(--card-bg); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; margin-bottom:20px; }
.card-title { font-size:15px; font-weight:600; margin-bottom:16px; display:flex; align-items:center; justify-content:space-between; }
input,select,textarea { font-family:inherit; font-size:14px; }
input[type=text],input[type=password],input[type=email],input[type=tel],input[type=number],input[type=date],select,textarea { width:100%; padding:8px 42px; border:1px solid var(--border); border-radius:var(--radius); transition:border .2s; }
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
label { display:block; margin-bottom:4px; font-weight:600; font-size:13px; color:var(--text); }
.form-row { margin-bottom:16px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.form-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }

/* ============ 表格 ============ */
table.data-table { width:100%; border-collapse:collapse; }
.data-table th { text-align:left; padding:10px 12px; background:var(--bg); font-weight:600; font-size:13px; color:var(--text-light); border-bottom:2px solid var(--border); white-space:nowrap; }
.data-table td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.data-table tr:hover td { background:var(--primary-light); }
.data-table .actions { display:flex; gap:4px; flex-wrap:wrap; }

/* ============ 状态徽章 ============ */
.badge { display:inline-block; padding:2px 10px; border-radius:12px; font-size:12px; font-weight:600; }
.badge-pending { background:#f3f4f6; color:#6b7280; }
.badge-assigned { background:#dbeafe; color:#1d4ed8; }
.badge-in-progress { background:#fef3c7; color:#92400e; }
.badge-completed { background:#d1fae5; color:#065f46; }
.badge-archived { background:#e0e7ff; color:#3730a3; }
.badge-success { background:#d1fae5; color:#065f46; }
.badge-danger { background:#fee2e2; color:#991b1b; }
.badge-warning { background:#fef3c7; color:#92400e; }
.badge-info { background:#dbeafe; color:#1d4ed8; }

/* ============ 统计卡片 ============ */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:#fff; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); text-align:center; }
.stat-card .stat-num { font-size:32px; font-weight:700; color:var(--primary); }
.stat-card .stat-label { font-size:13px; color:var(--text-light); margin-top:4px; }

/* ============ 模态框 ============ */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); display:none; align-items:center; justify-content:center; z-index:200; }
.modal-overlay.show { display:flex; }
.modal-box { background:#fff; border-radius:12px; width:600px; max-width:90vw; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow-lg); }
.modal-box.lg { width:800px; }
.modal-box.sm { width:400px; }
.modal-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-header h3 { font-size:16px; }
.modal-close { cursor:pointer; font-size:22px; color:var(--text-light); background:none; border:none; }
.modal-body { padding:20px; }
.modal-footer { padding:16px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }

/* ============ 子任务 ============ */
.subtask-item { display:flex; align-items:flex-start; gap:12px; padding:12px; border:1px solid var(--border); border-radius:var(--radius); margin-bottom:8px; background:#fff; }
.subtask-item.completed { background:#f0fdf4; border-color:#86efac; }
.subtask-checkbox { width:20px; height:20px; margin-top:2px; cursor:pointer; flex-shrink:0; }
.subtask-title { font-weight:600; }
.subtask-desc { font-size:13px; color:var(--text-light); margin-top:4px; }
.subtask-req { display:flex; gap:4px; margin-top:6px; flex-wrap:wrap; }
.req-tag { font-size:11px; padding:2px 8px; border-radius:10px; background:var(--primary-light); color:var(--primary-dark); }

/* ============ 地图 ============ */
#map-container { width:100%; height:600px; border-radius:var(--radius); overflow:hidden; }
#map-container-small { width:100%; height:300px; border-radius:var(--radius); overflow:hidden; }

/* ============ QR码 ============ */
.qr-display { display:flex; flex-direction:column; align-items:center; gap:16px; padding:20px; }
.qr-display canvas, .qr-display img { border:8px solid #fff; box-shadow:var(--shadow); }

/* ============ 搜索栏 ============ */
.toolbar { display:flex; gap:12px; margin-bottom:16px; align-items:center; flex-wrap:wrap; }
.toolbar input, .toolbar select { width:auto; min-width:160px; }
.toolbar .spacer { flex:1; }

/* ============ 其他 ============ */
.empty { text-align:center; padding:40px; color:var(--text-light); }
.tag-cloud { display:flex; gap:6px; flex-wrap:wrap; }
.tag { padding:4px 12px; border-radius:14px; font-size:12px; cursor:pointer; background:var(--bg); border:1px solid var(--border); }
.tag.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.toast { position:fixed; top:20px; right:20px; padding:12px 20px; border-radius:var(--radius); background:var(--text); color:#fff; z-index:300; animation:slideIn .3s; box-shadow:var(--shadow-lg); }
.toast.success { background:var(--success); }
.toast.error { background:var(--danger); }
@keyframes slideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
.loading { text-align:center; padding:40px; color:var(--text-light); }
.progress-bar { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.progress-bar .fill { height:100%; background:var(--success); transition:width .3s; }
.text-muted { color:var(--text-light); }
.text-danger { color:var(--danger); }
.text-warning { color:var(--warning); }
.text-success { color:var(--success); }
.text-center { text-align:center; }
.mt-1 { margin-top:8px; } .mt-2 { margin-top:16px; } .mb-1 { margin-bottom:8px; } .mb-2 { margin-bottom:16px; }
.flex { display:flex; } .items-center { align-items:center; } .gap-2 { gap:8px; } .flex-wrap { flex-wrap:wrap; }
.w-full { width:100%; }

/* ============ 移动端汉堡菜单 ============ */
.menu-toggle { display:none; background:none; border:none; color:var(--text); cursor:pointer; padding:4px; border-radius:6px; align-items:center; justify-content:center; }
.menu-toggle:active { background:var(--bg); }

/* 侧边栏遮罩层（仅移动端） */
.sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:99; opacity:0; transition:opacity .3s; }
.sidebar-backdrop.show { display:block; opacity:1; }

/* ============ 表格滚动容器 ============ */
.table-wrapper { overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* ============ 响应式 ============ */
/* ============ 师傅端 - 移动端 ============ */
.tech-layout { min-height:100vh; background:var(--bg); padding-bottom:60px; }
.tech-header { background:#0d9488; color:#fff; padding:16px 20px; font-size:17px; font-weight:600; position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:8px; }
.tech-header .back-btn { background:none; border:none; color:#fff; font-size:22px; cursor:pointer; padding:0 4px; }
.tech-content { padding:12px; }
.tech-bottom-nav { position:fixed; bottom:0; left:0; right:0; height:56px; background:#fff; border-top:1px solid var(--border); display:flex; z-index:100; }
.tech-nav-item { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:var(--text-light); cursor:pointer; font-size:11px; transition:color .2s; }
.tech-nav-item.active { color:#0d9488; }
.tech-nav-item svg { width:22px; height:22px; }
.tech-card { background:#fff; border-radius:10px; padding:16px; margin-bottom:12px; box-shadow:var(--shadow); }
.tech-card .tc-title { font-size:16px; font-weight:600; margin-bottom:8px; }
.tech-card .tc-sub { font-size:13px; color:var(--text-light); }
.tech-task-status { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.tech-record-section { margin-top:12px; padding-top:12px; border-top:1px dashed var(--border); }
.tech-record-item { display:flex; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.tech-record-item img { width:80px; height:80px; object-fit:cover; border-radius:6px; }
.tech-record-item video { width:120px; max-height:90px; border-radius:6px; }
.tech-media-btns { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.tech-media-btn { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 12px; border:1px dashed var(--border); border-radius:8px; cursor:pointer; font-size:12px; color:var(--text-light); }
.tech-media-btn svg { width:24px; height:24px; }
.tech-subtask-card { background:#fff; border-radius:10px; margin-bottom:12px; overflow:hidden; box-shadow:var(--shadow); }
.tech-subtask-header { display:flex; align-items:center; gap:12px; padding:16px; }
.tech-subtask-header .check { width:24px; height:24px; border:2px solid var(--border); border-radius:6px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.tech-subtask-header .check.checked { background:var(--success); border-color:var(--success); color:#fff; font-size:16px; }
.tech-subtask-body { padding:0 16px 16px; }
.tech-location-map { width:100%; height:300px; border-radius:10px; overflow:hidden; }
.tech-avatar { width:48px; height:48px; border-radius:50%; background:#0d9488; color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:600; }
.tech-profile-row { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.tech-info-list { list-style:none; }
.tech-info-list li { padding:12px 0; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; }
.tech-info-list li span:first-child { color:var(--text-light); }
.tech-empty { text-align:center; padding:60px 20px; color:var(--text-light); }
.tech-empty svg { width:48px; height:48px; opacity:.3; margin-bottom:12px; }
@media (max-width: 768px) {
  /* 汉堡菜单按钮 */
  .menu-toggle { display:flex; }
  /* 侧边栏抽屉式 */
  .sidebar { transform:translateX(-100%); box-shadow:2px 0 12px rgba(0,0,0,.15); }
  .sidebar.open { transform:translateX(0); }
  .sidebar .logo { font-size:14px; padding:16px 12px; }
  .sidebar .nav-item { padding:14px 16px; font-size:15px; }
  .main-area { margin-left:0; }
  /* 顶栏紧凑化 */
  .topbar { padding:0 12px; height:50px; }
  .topbar .page-title { font-size:15px; }
  .topbar .user-area { gap:6px; }
  .topbar .user-area .badge { display:none; }
  .topbar .user-area .user-name { display:none; }
  .topbar .user-area .avatar { width:28px; height:28px; font-size:12px; }
  /* 内容区减小padding */
  .content { padding:12px; }
  .card { padding:14px; margin-bottom:14px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .card-title { font-size:14px; margin-bottom:12px; }
  /* 表单单列 */
  .form-grid, .form-grid-3 { grid-template-columns:1fr; }
  /* 统计卡片2列 */
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:14px 10px; }
  .stat-card .stat-num { font-size:26px; }
  .stat-card .stat-label { font-size:12px; }
  /* 模态框全屏化 */
  .modal-box { width:95vw; max-height:92vh; border-radius:10px; }
  .modal-box.lg { width:95vw; }
  .modal-box.sm { width:90vw; }
  .modal-body { padding:14px; }
  .modal-header { padding:12px 14px; }
  .modal-header h3 { font-size:15px; }
  .modal-footer { padding:12px 14px; flex-wrap:wrap; }
  .modal-footer .btn { flex:1; justify-content:center; min-width:80px; }
  /* 工具栏换行 */
  .toolbar { gap:8px; }
  .toolbar input, .toolbar select { width:100% !important; min-width:0 !important; flex:1 1 100% !important; }
  /* 按钮增大触控区 */
  .btn { padding:10px 14px; font-size:13px; }
  .btn-sm { padding:6px 10px; font-size:12px; }
  .data-table .actions { gap:4px; }
  .data-table .actions .btn-sm { padding:5px 8px; font-size:11px; }
  /* 表格紧凑化 */
  .data-table th, .data-table td { padding:8px 8px; font-size:12px; }
  .data-table th { font-size:11px; }
  /* 地图缩小 */
  #map-container { height:400px; }
  /* 表单操作按钮换行 */
  .form-actions { flex-wrap:wrap; }
  .form-actions .btn { flex:1; justify-content:center; min-width:80px; }
  /* 登录页 */
  .login-container { flex-direction:column; max-width:400px; }
  .login-right { width:100%; border-left:none; border-top:1px solid rgba(255,255,255,.08); padding:32px 24px; }
  .login-left { padding:32px 24px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns:1fr; }
  .stat-card .stat-num { font-size:24px; }
  .topbar .page-title { font-size:14px; }
  .modal-footer .btn { font-size:12px; padding:8px 10px; }
}
.skill-tag { display:inline-block; background:#e0f2fe; color:#0369a1; padding:2px 8px; border-radius:12px; font-size:12px; margin:2px; }

