* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', Arial, sans-serif; background: #f5f7fa; min-height: 100vh; }

body.login-page { display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; border-radius: 10px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); padding: 40px; width: 380px; }
.login-title { text-align: center; font-size: 24px; color: #333; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #666; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: 5px;
    font-size: 14px; outline: none; transition: border-color 0.3s;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #667eea; }
.login-btn {
    width: 100%; padding: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; border: none; border-radius: 5px; font-size: 16px; cursor: pointer;
    transition: opacity 0.3s;
}
.login-btn:hover { opacity: 0.9; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.error-msg { color: #f56c6c; font-size: 12px; margin-top: 5px; min-height: 16px; }

.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 16px 24px; display: flex; justify-content: center; align-items: center; position: relative; }
.header-left { display: flex; align-items: center; gap: 12px; position: absolute; left: 24px; }
.header h1 { font-size: 20px; font-weight: normal; text-align: center; }
.user-info { display: flex; align-items: center; gap: 15px; position: absolute; right: 24px; }
.mobile-menu-btn { display: none; width: 36px; height: 36px; border: none; background: rgba(255,255,255,0.2); border-radius: 6px; color: #fff; cursor: pointer; align-items: center; justify-content: center; }
.user-info span { font-size: 14px; }
.logout-btn { padding: 6px 12px; background: rgba(255,255,255,0.2); border: none; color: #fff; border-radius: 4px; cursor: pointer; font-size: 13px; }
.logout-btn:hover { background: rgba(255,255,255,0.3); }

.container { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 200px; background: #fff; border-right: 1px solid #eee; padding-top: 20px; }
.menu-item { padding: 12px 20px; cursor: pointer; font-size: 14px; color: #666; transition: all 0.3s; }
.menu-item:hover { background: #f5f7fa; color: #667eea; }
.menu-item.active { background: #667eea; color: #fff; }
.main { flex: 1; padding: 20px; overflow-y: auto; }

.page-title { font-size: 18px; color: #333; margin-bottom: 20px; font-weight: normal; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow: hidden; }
.toolbar { padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { padding: 8px 16px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; transition: opacity 0.3s; }
.btn-primary { background: #667eea; color: #fff; }
.btn-default { background: #f5f7fa; color: #666; }
.btn:hover { opacity: 0.85; }
.input-search { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; width: 200px; }
.input-search:focus { outline: none; border-color: #667eea; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 20px; text-align: left; font-size: 14px; border-bottom: 1px solid #eee; }
th { background: #fafafa; color: #666; font-weight: normal; }
td { color: #333; }
td a { color: #667eea; text-decoration: none; }
td a:hover { text-decoration: underline; }
.empty { text-align: center; color: #999; }

.action-btn { padding: 4px 10px; border: none; border-radius: 3px; font-size: 12px; cursor: pointer; margin-right: 5px; }
.action-edit { background: #409eff; color: #fff; }
.action-copy { background: #67c23a; color: #fff; }
.action-delete { background: #f56c6c; color: #fff; }
.action-finish { background: #e6a23c; color: #fff; }

.tag { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-success { background: #f0f9eb; color: #67c23a; }
.tag-danger { background: #fef0f0; color: #f56c6c; }
.tag-warning { background: #fdf6ec; color: #e6a23c; }

.pagination { padding: 15px 20px; display: flex; justify-content: center; gap: 5px; }
.pagination button { padding: 6px 12px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 13px; }
.pagination button:hover { border-color: #667eea; color: #667eea; }
.pagination button.active { background: #667eea; color: #fff; border-color: #667eea; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: flex; border-bottom: 1px solid #eee; }
.tab-item { padding: 12px 20px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; transition: all 0.3s; }
.tab-item:hover { color: #667eea; }
.tab-item.active { color: #667eea; border-bottom-color: #667eea; }

.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-content { background: #fff; border-radius: 12px; width: 480px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: scaleIn 0.25s ease-out; }
.modal-body { overflow-y: auto; flex: 1; }
.modal-header { padding: 18px 24px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #f8f9ff 0%, #f5f7fa 100%); }
.modal-header h3 { font-size: 16px; color: #303133; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border: none; background: transparent; border-radius: 6px; font-size: 20px; cursor: pointer; color: #909399; transition: all 0.2s; display: flex; align-items: center; justify-content: center; line-height: 1; }
.modal-close:hover { background: #f5f7fa; color: #606266; transform: rotate(90deg); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 12px; background: #fafbfc; }

.form-row { margin-bottom: 20px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; margin-bottom: 8px; color: #606266; font-size: 14px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #dcdfe6; border-radius: 6px;
    font-size: 14px; outline: none; transition: all 0.25s; background: #fff; color: #303133;
    font-family: inherit;
}
.form-row textarea { resize: vertical; min-height: 90px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
.form-row input:disabled, .form-row select:disabled, .form-row textarea:disabled {
    background: #f5f7fa; color: #909399; cursor: not-allowed;
}

.profile-section { padding: 20px; }
.profile-section h3 { font-size: 16px; color: #303133; margin-bottom: 16px; font-weight: 600; }
.modal-footer { padding: 15px 20px; text-align: right; border-top: 1px solid #eee; }
.card input, .card select, .card textarea { line-height: 1.4; }
.form-row input { height: 40px; }
.form-row input::-webkit-input-placeholder { color: #c0c4cc; }
.form-row input:-moz-placeholder { color: #c0c4cc; }
.form-row input::-moz-placeholder { color: #c0c4cc; }
.form-row input:-ms-input-placeholder { color: #c0c4cc; }

.form-row input[type="date"],
.form-row input[type="time"],
.form-row input[type="datetime-local"] {
    position: relative;
    cursor: pointer;
}
.form-row input[type="date"]::-webkit-calendar-picker-indicator,
.form-row input[type="time"]::-webkit-calendar-picker-indicator,
.form-row input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    background: transparent;
    color: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.modal-footer .btn { padding: 9px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.modal-footer .btn-default { background: #fff; color: #606266; border: 1px solid #dcdfe6; }
.modal-footer .btn-default:hover { color: #667eea; border-color: #c6e2ff; background: #ecf5ff; }
.modal-footer .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border: none; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
.modal-footer .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4); }

.stats-row { display: flex; gap: 16px; margin-bottom: 20px; }
.stat-card { flex: 1; max-width: 280px; background: #fff; border-radius: 10px; padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.stat-card .stat-icon { font-size: 36px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f0f4ff; }
.stat-card.stat-tw .stat-icon { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.stat-card.stat-sy .stat-icon { background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%); }
.stat-card .stat-label { font-size: 13px; color: #909399; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 24px; font-weight: 600; color: #303133; }

.chart-card { margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.card-header h3 { font-size: 15px; color: #303133; font-weight: 600; }
.chart-container { padding: 20px; height: 280px; position: relative; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

.toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { min-width: 280px; max-width: 420px; padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); animation: toastIn 0.3s ease-out; display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.toast.hide { animation: toastOut 0.3s ease-out forwards; }
.toast-success { background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%); }
.toast-error { background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%); }
.toast-warning { background: linear-gradient(135deg, #e6a23c 0%, #ebb563 100%); }
.toast-info { background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%); }
.toast-icon { font-size: 16px; font-weight: bold; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

@media screen and (max-width: 768px) {
    body { font-size: 14px; }
    
    .header { padding: 12px 16px; }
    .header h1 { font-size: 16px; }
    .header .user-info span { font-size: 13px; }
    .logout-btn { padding: 4px 10px; font-size: 12px; }
    
    .mobile-menu-btn { display: flex; }
    
    .container { flex-direction: column; }
    
    .sidebar {
        position: fixed; top: 52px; left: -200px; width: 200px; height: calc(100vh - 52px);
        z-index: 900; transition: left 0.3s ease; box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.show { left: 0; }
    
    .sidebar-mask {
        position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); z-index: 899; display: none;
    }
    .sidebar-mask.show { display: block; }
    
    .main { padding: 12px; }
    .page-title { font-size: 16px; margin-bottom: 12px; }
    
    .card { border-radius: 10px; }
    .toolbar { padding: 12px; flex-direction: column; align-items: stretch; gap: 8px; }
    .toolbar .btn { width: 100%; padding: 10px; font-size: 14px; }
    .input-search { width: 100%; padding: 10px; font-size: 14px; }
    
    .table-wrapper { overflow-x: auto; border-radius: 8px; border: 1px solid #eee; }
    table { min-width: 600px; }
    th, td { padding: 10px 12px; font-size: 13px; }
    
    .action-btn { padding: 3px 8px; font-size: 11px; margin-right: 3px; }
    
    .tabs { flex-wrap: wrap; }
    .tab-item { padding: 10px 14px; font-size: 13px; }
    
    .modal-content { width: 92%; max-width: 400px; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 18px; }
    .modal-footer { padding: 12px 16px; }
    
    .form-row input, .form-row select, .form-row textarea { padding: 12px; font-size: 15px; }
    
    .stats-row { flex-direction: column; }
    .stat-card { max-width: 100%; }
    
    .chart-container { height: 200px; }
    
    .pagination { padding: 10px; }
    .pagination button { padding: 5px 10px; font-size: 12px; }
    
    .profile-section { padding: 16px; }
    
    .toast { min-width: 240px; max-width: 90%; padding: 10px 14px; font-size: 13px; }
    
    .header-left { left: 12px; }
    .user-info { right: 12px; }
    .header h1 { padding: 0 40px; }
}

@media screen and (max-width: 480px) {
    .header { padding: 10px 12px; }
    .header h1 { font-size: 15px; }
    .main { padding: 8px; }
    .toolbar { padding: 10px; }
    .btn { padding: 9px 14px; font-size: 13px; }
    .form-row input, .form-row select, .form-row textarea { padding: 11px; font-size: 14px; }
}